• André Thiele

    André Thiele

    1 year ago
    Whats the easiest way to request focus of a TextField in Compose when clicked inside it? My keyboard is showing in front of it everytime and i have to manually scroll up to write in the field
    André Thiele
    1 replies
    Copy to Clipboard
  • steelahhh

    steelahhh

    1 year ago
    After upgrading compose to alpha12, I'm getting an exception
    java.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 🧵
    steelahhh
    s
    +2
    10 replies
    Copy to Clipboard
  • Mikołaj Kąkol

    Mikołaj Kąkol

    1 year ago
    has anyone been able to use new layout inspector:https://developer.android.com/studio/preview/features?utm_source=android-studio-4-2&utm_medium=studio-assistant-preview#compose-layout-inspector it doesn’t work for my project or in jetnews sample app. It’s just blank
    Mikołaj Kąkol
    a
    +2
    26 replies
    Copy to Clipboard
  • Vsevolod Ganin

    Vsevolod Ganin

    1 year ago
    Any idea why Android Studio uses
    :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 all
    Vsevolod Ganin
    Javier
    6 replies
    Copy to Clipboard
  • escodro

    escodro

    1 year ago
    Hello, everyone. Has anyone having problems with
    ./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?
    escodro
    1 replies
    Copy to Clipboard
  • s

    Se7eN

    1 year ago
    [Code in thread 👇] I have this code where I'm using the
    pointerInput
    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.
    s
    Vsevolod Ganin
    +2
    17 replies
    Copy to Clipboard
  • clhols

    clhols

    1 year ago
    I am doing this:
    return 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-alpha12
    clhols
    André Thiele
    +4
    13 replies
    Copy to Clipboard
  • p

    Pablo Costa

    1 year ago
    Hi there folks, hope you all are extremely well 👋
    Row(
        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!!! 🙏
    p
    Adam Powell
    4 replies
    Copy to Clipboard
  • tylerwilson

    tylerwilson

    1 year ago
    Quick question: does Compose require the IR backend? I see this in the docs:
    freeCompilerArgs += ["-Xallow-jvm-ir-dependencies"]
    but that does not look exactly like the use-IR flag we see elsewhere.
    tylerwilson
    jim
    +1
    6 replies
    Copy to Clipboard