fabio.carballo
02/12/2021, 9:59 AMAndré Thiele
02/12/2021, 11:01 AMsteelahhh
02/12/2021, 11:04 AMjava.lang.IllegalArgumentException: Anchor refers to a group that was removed
when interacting with a TextField inside of the dialog. Specifically when TextField is focused
Stack trace and the sample in the thread 🧵Sergey Y.
02/12/2021, 11:14 AMMikołaj Kąkol
02/12/2021, 11:19 AMVsevolod Ganin
02/12/2021, 12:24 PM:app:assemble
to build when running @Preview @Composable
and how to avoid it? In most cases I need only quick debug build. Regularly building release variant may take pretty long due to R8 and allescodro
02/12/2021, 2:28 PM./gradlew connectedAndroidTest
using compose-test?
My application runs ./gradlew build
just fine, but my instrumented tests does not run.
If I play them by Android Studio they work, but not via command line.
The issues is
A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
Type androidx.core.animation.AnimatorKt$addListener$1 is defined multiple times
If I exclude the core-ktx
from the compose-test dependencies, it starts failing other modules in loop.
Could anyone help me please?Se7eN
02/12/2021, 2:45 PMpointerInput
modifier to allow dragging inside my Box
. The problem is when the locked
parameter (and other parameters) change, onPositionChange
and onDragStateChange
still executes with the old value of the parameters. Like if locked
was true by default and the state changes to false, the if statement in onPositionChange
will still run. I don't know it might be related to some kotlin magic but I was using the now deprecated dragGestureFilter
modifier before alpha12 and it was working fine with the same code. I've also tried using detectDragGestures
inside pointerInput
but no luck.clhols
02/12/2021, 3:47 PMreturn inflater.inflate(R.layout.fragment_hello, container, false).apply {
findViewById<ComposeView>(R.id.cvHelloWorld).setContent {
// In Compose world
MaterialTheme {
HelloWorld()
}
}
}
But then I get:
java.lang.IllegalStateException: ViewTreeLifecycleOwner not found from DecorView@d0eeb9[HomeActivity]
at androidx.compose.ui.platform.WindowRecomposerKt.createLifecycleAwareViewTreeRecomposer(WindowRecomposer.kt:231)
at androidx.compose.ui.platform.WindowRecomposerKt.access$createLifecycleAwareViewTreeRecomposer(WindowRecomposer.kt:1)
at androidx.compose.ui.platform.WindowRecomposerFactory$Companion$LifecycleAware$1.createRecomposer(WindowRecomposer.kt:115)
at androidx.compose.ui.platform.WindowRecomposerPolicy.createAndInstallWindowRecomposer$ui_release(WindowRecomposer.kt:168)
at androidx.compose.ui.platform.WindowRecomposerKt.getWindowRecomposer(WindowRecomposer.kt:216)
at androidx.compose.ui.platform.AbstractComposeView.ensureCompositionCreated(ComposeView.kt:184)
at androidx.compose.ui.platform.AbstractComposeView.onAttachedToWindow(ComposeView.kt:215)
at android.view.View.dispatchAttachedToWindow(View.java:17445)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3326)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3333)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3333)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3333)
at android.view.ViewGroup.addViewInner(ViewGroup.java:4977)
at android.view.ViewGroup.addView(ViewGroup.java:4768)
at androidx.fragment.app.FragmentContainerView.addView(FragmentContainerView.java:280)
at android.view.ViewGroup.addView(ViewGroup.java:4708)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:536)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1324)
at androidx.fragment.app.FragmentManager.addAddedFragments(FragmentManager.java:2392)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2137)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2061)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1957)
at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:496)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I am using Kotlin 1.4.30, Compose 1.0.0-alpha12Pablo Costa
02/12/2021, 3:58 PMRow(
modifier = Modifier.padding(horizontal = 16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
HeighDependsOnContentComposable(modifier = Modifier.weight(1f))
HeighDependsOnContentComposable(modifier = Modifier.weight(1f))
}
Is there any way I can have both composables with the same height? This is taking the heigh of the tallest one?
Is this one of the scenarios where ConstraintLayout would help?
Thanks!!! 🙏tylerwilson
02/12/2021, 4:06 PMfreeCompilerArgs += ["-Xallow-jvm-ir-dependencies"]
but that does not look exactly like the use-IR flag we see elsewhere.Jakub Ledwon
02/12/2021, 4:56 PMdraggable
. Now I want to use it inside a LazyColumn
, but when I'm picking the number, column's content is scrolling as well. What is the easiest way to block scrolling for parent in this situation? Should I use nestedScroll
modifier or something else?Janne Mareike Koschinski
02/12/2021, 6:19 PMmonospace
like im Slack web and desktop (although Slack Android also can't handle that correctly)robnik
02/12/2021, 6:43 PMKotlin version that is used for building with Gradle (1.4.30) differs from the one bundled into the IDE plugin (1.4.21)
. It's on the line inside buildscript.dependencies: `classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"`` . I thought we were supposed to use Kotlin 1.4.30 now? The Kotlin plugin doesn't seem to have an update available. I'm getting a much worse internal compiler error later, so I'm trying to sort out this warning first.Vivek Sharma
02/12/2021, 7:43 PMTony Kazanjian
02/12/2021, 8:12 PMandroidx.compose.runtime.saveable.Saver
? Having a tough time trying to find the source for androidx.compose.runtime.saveable.samples.CustomSaverSample
spierce7
02/12/2021, 10:54 PMBradleycorn
02/13/2021, 1:34 AMText
and Scaffold
show up with red underline, and the problem says:
'Text( ... ) Unit' is only available since Kotlin 1.4.30 and cannot be used in Kotlin 1.4First, I have my project set to use Kotlin 1.4.30, so ... what? Also, despite the "error", the project compiles and runs fine ... what gives?
spierce7
02/13/2021, 2:30 AMScott Kruse
02/13/2021, 8:16 AMalpha12
?
Duplicate class androidx.compose.runtime.savedinstancestate.ExperimentalRestorableStateHolder found in modules jetified-runtime-saveable-1.0.0-alpha12-runtime (androidx.compose.runtime:runtime-saveable:1.0.0-alpha12) and jetified-runtime-saved-instance-state-1.0.0-alpha11-runtime (androidx.compose.runtime:runtime-saved-instance-state:1.0.0-alpha11)
Duplicate class androidx.compose.runtime.savedinstancestate.RestorableStateHolder found in modules jetified-runtime-saveable-1.0.0-alpha12-runtime (androidx.compose.runtime:runtime-saveable:1.0.0-alpha12) and jetified-runtime-saved-instance-state-1.0.0-alpha11-runtime (androidx.compose.runtime:runtime-saved-instance-state:1.0.0-alpha11)
Klaas Kabini
02/13/2021, 10:00 AMval scale = Animatable(0f)
Modifier.draggable(onDrag = {
LaunchedEffect("test"){
scale.snapTo(0.5f)
}
}
louiscad
02/13/2021, 10:34 AMandroidx.compose
to just compose
in light of #compose-desktop, #compose-web, etc and move to beta stage happening soon? ✋
Put another way, if it was originated by Microsoft, or Apple, you can ask yourself if you would want to see it from the windowsx.compose
or macosx.compose
package, plus also see it in the imports in all the files where use it, even if for an Android or Linux app.Ilias Zosimadis
02/13/2021, 11:48 AMKshitij Patil
02/13/2021, 12:57 PMCard
as much as we can for Text
(shadowColor, blur, etc)Vsevolod Ganin
02/13/2021, 2:27 PMDrawerState
have a mutable value
? The way things are working now forces to synchronize internal drawer state with external one (i.e. view model, app state). Wouldn’t it be more idiomatic to export callbacks of user intention to change drawer state so I could update state appropriately myself? Currently it looks like this
fun MyComposable(showDrawer: Boolean, dispatch: (Action) -> Unit) {
val drawerState = rememberDrawerState(DrawerValue.Closed)
LaunchedEffect(showDrawer) {
if (showDrawer) drawerState.open() else drawerState.close()
}
// If user swipes or taps on free zone, drawerState.value will change
LaunchedEffect(drawerState.value) {
when (drawerState.value) {
DrawerValue.Closed -> dispatch(CloseDrawer)
DrawerValue.Open -> dispatch(OpenDrawer)
}
}
...
}
carbaj0
02/13/2021, 4:10 PMVivek Sharma
02/13/2021, 6:30 PMHiltViewModelFactory
?3bdoelnaggar
02/13/2021, 8:21 PMMehdi Haghgoo
02/13/2021, 9:56 PMClass 'androidx.navigation.compose.NavHostKt' is compiled by an unstable version of the Kotlin compiler and cannot be loaded by this compilerWhat does this mean? It happened after updating kotlin to 1.4.30 and compose to 1.0.0-alpha12.
Mehdi Haghgoo
02/14/2021, 12:28 AMvar showMessage by remember { mutableStateOf(false) }
Column (verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.background(Color.Red).size(200.dp)){
if (showMessage) {
BasicText(
"You Pressed The Button",
style = TextStyle.Default.copy(fontStyle = FontStyle.Italic),
)
}
Button(
onClick = { showMessage = !showMessage },
) {
BasicText("Show")
}
}
}
Currently, the problem is both Text and Button are fighting to be in the center of Column.Mehdi Haghgoo
02/14/2021, 12:28 AMvar showMessage by remember { mutableStateOf(false) }
Column (verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.background(Color.Red).size(200.dp)){
if (showMessage) {
BasicText(
"You Pressed The Button",
style = TextStyle.Default.copy(fontStyle = FontStyle.Italic),
)
}
Button(
onClick = { showMessage = !showMessage },
) {
BasicText("Show")
}
}
}
Currently, the problem is both Text and Button are fighting to be in the center of Column.Denis
02/14/2021, 8:08 AMKshitij Patil
02/14/2021, 8:39 AMBox
for that.