MBegemot
04/24/2020, 7:40 AMcamkadev
04/24/2020, 3:15 PMvar authState by state { AuthState() }
complaint about Functions which invoke @Composable functions must be marked with the @Composable annotation
what should i do?alexzhukovich
04/24/2020, 5:47 PMKazemihabib1996
04/25/2020, 2:30 PMModifier.gravity()
inside ColumnScope
the IDEA suggests whole alignments as they are all defined in componian object of`Alignment` class but our ColumnScope gravity Modifier
just accepts Alignment.Horizontal
and IMHO this API needs some modifications.carbaj0
04/25/2020, 5:52 PMstate
, there is some special technical reason?itnoles
04/25/2020, 6:26 PMcaelum19
04/25/2020, 10:26 PMSheroz Nazhmudinov
04/26/2020, 1:31 PMColton Idle
04/26/2020, 5:00 PMdavid.bilik
04/26/2020, 5:18 PMspierce7
04/26/2020, 11:12 PMaipok
04/27/2020, 7:13 AMdev09
working. For me with latest AS 4.1 canary 7 and dev09
the preview not displayed and every time I’m trying to run the code on the device it gives me an error java.lang.NoSuchMethodError: No static method setContent(Landroidx/activity/ComponentActivity;Lkotlin/jvm/functions/Function0;)Landroidx/compose/Composition
molikto
04/28/2020, 6:51 AMShreemanArjun
04/28/2020, 7:48 AMBrian Gardner
04/28/2020, 1:32 PMstate{}
to wrap the list but the AdapterList
is still not updating when I change the data. I tried both ReferentiallyEqual
and StructurallyEqual
for the state
parameter. I also tried moving the state down to the individual row views themselves. This does cause the row to update when the user interacts with it but if the item scrolls off screen and comes back on then it is composed with the old state since nothing told the list component to change the state. I'll do some digging into React to see what their best practices are for dealing with list stateGuy Bieber
04/28/2020, 7:05 PMsetContent {
MaterialTheme {
//for some reason this gets an error
//pageData.page()
// moved to a switch statement
when (page) {
Pages.SPLASH_PAGE -> {
SplashPage()
}
Pages.LOGIN_PAGE -> {
LoginPage()
}
Pages.RESET_PASSWORD_PAGE -> {
ForgotPasswordPage()
Here is the error:
2020-04-28 11:55:16.113 26150-26150/com.nikolamotor.nikolamotor E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nikolamotor.nikolamotor, PID: 26150
java.lang.IllegalArgumentException: Start/end imbalance
at androidx.compose.Composer.finalizeCompose(Composer.kt:1595)
at androidx.compose.Composer.endRoot(Composer.kt:509)
at androidx.compose.Recomposer.recompose(Recomposer.kt:79)
at androidx.compose.Recomposer.access$recompose$1(Unknown Source:0)
at androidx.compose.Recomposer$Companion.recompose$compose_runtime_release(Recomposer.kt:56)
at androidx.compose.CompositionImpl.setContent(Composition.kt:91)
at androidx.ui.core.WrappedComposition.setContent(Wrapper.kt:221)
at androidx.ui.core.WrapperKt.doSetContent(Wrapper.kt:201)
at androidx.ui.core.WrapperKt.setContent(Wrapper.kt:156)
at androidx.ui.core.WrapperKt.setContent(Wrapper.kt:129)
at com.nikolamotor.nikolamotor.MainActivity$PageControl.SwitchPage(MainActivity.kt:207)
at com.nikolamotor.nikolamotor.MainActivity$HomePage$3.invoke(MainActivity.kt:499)
at com.nikolamotor.nikolamotor.MainActivity$HomePage$3.invoke(Unknown Source:6)
at androidx.compose.internal.RestartableFunction.invoke(RestartableFunction.kt:140)
at androidx.compose.internal.RestartableFunction$invoke$1.invoke(RestartableFunction.kt:141)
at androidx.compose.internal.RestartableFunction$invoke$1.invoke(Unknown Source:3)
at androidx.compose.RecomposeScope.compose(Composer.kt:265)
at androidx.compose.Composer.composeScope(Composer.kt:1431)
at androidx.compose.Composer.recomposeComponentRange(Composer.kt:1377)
at androidx.compose.Composer.skipCurrentGroup(Composer.kt:1426)
at androidx.compose.Composer.recompose(Composer.kt:1495)
at androidx.compose.Recomposer.performRecompose(Recomposer.kt:107)
at androidx.compose.Recomposer.dispatchRecomposes(Recomposer.kt:135)
at androidx.compose.AndroidRecomposer.access$dispatchRecomposes$1(Unknown Source:0)
at androidx.compose.AndroidRecomposer$frameCallback$1.doFrame(AndroidRecomposer.kt:27)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:965)
at android.view.Choreographer.doCallbacks(Choreographer.java:791)
at android.view.Choreographer.doFrame(Choreographer.java:722)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:952)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Any thoughts?
Note I can call the same function from back and it works every time (outside a composable function)
//@Composable
override fun onBackPressed() {
pg.BackPage()
//super.onBackPressed()
}
fun BackPage () {
if (currentPage != <http://Pages.NO|Pages.NO>_PAGE) {
val pageData = pageMap[currentPage]
if (pageData != null) {
// this page has a specific back page
if (pageData.backPage != <http://Pages.NO|Pages.NO>_PAGE) {
SwitchPage(pageData.backPage)
// this go back to
} else if (priorPage != <http://Pages.NO|Pages.NO>_PAGE){
SwitchPage(priorPage)
}
}
}
}
Colton Idle
04/29/2020, 9:06 AMKazemihabib1996
04/29/2020, 4:48 PMfling
animation
fun AnimatedFloat.fling(
startVelocity: Float,
decay: DecayAnimation = ExponentialDecay(),
adjustTarget: (Float) -> TargetAnimation?,
onEnd: OnAnimationEnd? = null
)
it accepts a startVelocity
and decay
so far it makes sence.
but it also accepts an adjustTarget
that's the what I can't understand, setting new target with new animation inside fling animation?Leland Richardson [G]
04/29/2020, 5:39 PMGuy Bieber
04/29/2020, 5:56 PMjava.lang.RuntimeException: Unable to start activity ComponentInfo{com.nikolamotor.nikolamotor/com.nikolamotor.nikolamotor.MainActivity}: java.lang.IllegalStateException: Not in a frame
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.IllegalStateException: Not in a frame
at androidx.compose.frames.FramesKt.currentFrame(Frames.kt:180)
at androidx.compose.frames.FramesKt.readable(Frames.kt:448)
at androidx.compose.frames.FramesKt._readable(Frames.kt:461)
at com.nikolamotor.nikolamotor.DataModel.getTemperature(Unknown Source:5)
at com.nikolamotor.nikolamotor.MainActivity.onCreate(MainActivity.kt:95)
at android.app.Activity.performCreate(Activity.java:7825)
at android.app.Activity.performCreate(Activity.java:7814)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Here is the data model:
@Model
data class DataModel (
var username : String = "dude",
var password : String = "blah",
var oldPage : Pages = Pages.SPLASH_PAGE,
var newPage : Pages = Pages.SPLASH_PAGE,
var temperature : Int = 72
)
var dataModel = DataModel()
Here is the onCreate code:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// NOTE many items can't be constructed until onCreate is called
ui = UiStyled(this)
pg = PageControl(this)
homePageControls = arrayOf(
//Row 1
BasicControl(
icon = imageFromResource(resources, R.drawable.fan_lvl_0),
name = resources.getString(R.string.home_auto)
),
VertTempControl(
temp = dataModel.temperature,
step = 1
),
Guy Bieber
04/29/2020, 6:01 PMdata class VertTempControl (
var temp : Int = 72,
var step : Int = 1
) : Control()
...
@Model
data class DataModel (
var username : String = "dude",
var password : String = "blah",
var oldPage : Pages = Pages.SPLASH_PAGE,
var newPage : Pages = Pages.SPLASH_PAGE,
var temperature : Int = 72
)
var dataModel = DataModel()
...
var vt = VertTempControl(
temp = dataModel.temperature,
step = 1
)
...
showControl (vt)
Andrey Kulikov
04/29/2020, 6:42 PMFlow
integration should work fine with dev10 if you want to try it. unfortunately we didn't merge the adapter before the build cut, so it will be added in dev11. but feel free to temporary copy it from here and play with ititnoles
04/29/2020, 9:07 PMGabriel Feo
04/29/2020, 11:25 PMConstraints2
I think I like itlouiscad
04/30/2020, 2:36 AMkotlinPlugin
may be a configuration that will actually exist in Kotlin 1.4 or 1.5 at some point, but it's nowhere to be found in 1.3.72, nor 1.4-M1.
The kotlinCompilerExtensionVersion = "0.1.0-dev10"
is the replacement, while the page shows both.
I lost some time with it that I'd have preferred to spend playing with Compose itself, or something else. Would be great that this doc stops to be misleading by removing the line, until the configuration actually exists.
EDIT: Reported the issue: https://issuetracker.google.com/issues/155323417louiscad
04/30/2020, 3:09 AMExecution failed for task ':some-parent-project:app-android:prepareDebugKotlinCompileTask'.
> org/jetbrains/kotlin/gradle/tasks/KotlinCompile
How can I find the root cause?Zach Klippenstein (he/him) [MOD]
04/30/2020, 5:22 AMRuntime JAR files in the classpath have the version 1.3, which is older than the API version 1.4. Consider using the runtime of version 1.4
. These go away if I add the apiVersion = "1.3"
configuration for my KotlinCompile
tasks, and the code runs fine. Are these warnings expected? Should we be using Kotlin 1.4-M1 to use Compose now?nicopasso
04/30/2020, 7:49 AMjava.lang.LinkageError: loader constraint violation: when resolving method "kotlin.coroutines.AbstractCoroutineContextKey.<init>(Lkotlin/coroutines/CoroutineContext$Key;Lkotlin/jvm/functions/Function1;)V" the class loader (instance of org/jetbrains/android/uipreview/ModuleClassLoader) of the current class, kotlinx/coroutines/CoroutineDispatcher$Key, and the class loader (instance of com/intellij/ide/plugins/cl/PluginClassLoader) for the method's defining class, kotlin/coroutines/AbstractCoroutineContextKey, have different Class objects for the type kotlin/coroutines/CoroutineContext$Key used in the signature
at kotlinx.coroutines.CoroutineDispatcher$Key.<init>(CoroutineDispatcher.kt:35)
at kotlinx.coroutines.CoroutineDispatcher$Key.<init>(CoroutineDispatcher.kt:35)
at kotlinx.coroutines.CoroutineDispatcher.<clinit>(CoroutineDispatcher.kt)
at kotlinx.coroutines.CoroutineContextKt.createDefaultDispatcher(CoroutineContext.kt:23)
at kotlinx.coroutines.Dispatchers.<clinit>(Dispatchers.kt:33)
at androidx.ui.core.WrapperKt$doSetContent$compositionWrapper$1$setContent$1.invoke(Wrapper.kt:178)
at androidx.ui.core.WrapperKt$doSetContent$compositionWrapper$1$setContent$1.invoke(Wrapper.kt)
at androidx.compose.internal.RestartableFunction.invoke(RestartableFunction.kt:132)
at androidx.compose.internal.RestartableFunction.invoke(RestartableFunction.kt)
at androidx.compose.ComposerKt.invokeComposable(Composer.kt:2052)
at androidx.compose.Recomposer.recompose(Recomposer.kt:77)
...
jitinsharma
04/30/2020, 8:41 AMjitinsharma
04/30/2020, 9:17 AMdev-10
🎉jitinsharma
04/30/2020, 9:17 AMdev-10
🎉Arun
04/30/2020, 9:34 AMkapt
should work?jitinsharma
04/30/2020, 9:43 AMkapt
in release notes. You’ll have to try and check with other libs.Adrian Blanco
04/30/2020, 10:00 AMVinay Gaba
04/30/2020, 3:20 PMLeland Richardson [G]
04/30/2020, 4:25 PMArun
05/01/2020, 1:02 AMAli Zargar Shabestari
05/02/2020, 4:59 AM