https://kotlinlang.org logo
Join Slack
Powered by
# compose-android
  • m

    mattinger

    10/08/2025, 3:19 PM
    Hi all. I'm working in a composed based design system library. It gets published as an aar, and it has a reference app that we maintain so we can see a catalog of the components we're providing in the library. As such, it only really has a debug variant, and thus does not need any code signing. We will also typically take our @Preview functions and deploy them to the emulator. When we do that, we select the reference application as part of the run configuration. Sometime recently i've started getting this error when trying to do this in AS (narwhal 3 feature drop):
    Copy code
    Error: The apk for your currently selected variant cannot be signed. Please specify a signing configuration for this variant (debug).
    I've even tried adding a debug signing key by adding the keystore and doign this in the app module:
    Copy code
    signingConfigs {
            getByName("debug") {
                storeFile = rootProject.file("keystore/debug.keystore")
                storePassword = "xxxxx"
                keyAlias = "xxxxx"
                keyPassword = "xxxxx"
            }
        }
    
        buildTypes {
            getByName("debug") {
                signingConfig = signingConfigs.getByName("debug")
            }
        }
    But it still shows the same error. Does anyone have any idea how to resolve this and/or what changed recently to cause this?
  • t

    Tlaster

    10/09/2025, 3:45 AM
    After updated to navigation3 1.0.0-alpha11, using
    SceneStrategy<T>.then
    will cause infinite loop and the app will crash, seems like this line cause the issue.
    i
    b
    • 3
    • 5
  • b

    bryankeltonadams

    10/10/2025, 12:30 AM
    Would you want to use SceneStrategy with a per screen top app bar setup or would that not really work well? I was excited to try it after watching how easy it was to get a list detail view setup that way but not need to necessarily build it with a single Composable. But I always do TopBar per screen rather than a global one.
    s
    • 2
    • 2
  • e

    eygraber

    10/10/2025, 4:14 PM
    I'm using the latest stable Compose BOM together with nav3. If I update nav3 to 1.0.0-alpha11 I start getting NPE from
    LookaheadPassDelegate.forEachChildAlignmentLinesOwner
    (via material3
    Scaffold
    ). Is this because nav3 is pulling in some alpha Compose artifacts, but others are on stable?
    • 1
    • 2
  • p

    Poulastaa

    10/11/2025, 7:23 PM
    Hello everyone, Live-reload keep breaking even in simple changes. code is in thread. Any and all suggestion is helpful. Thank you for taking the time to help. Really grateful for that.
    • 1
    • 4
  • t

    Tgo1014

    10/16/2025, 9:08 AM
    Is there a way to hide the ActionBar in the previews that show the device system bars?
    ➕ 1
    c
    • 2
    • 1
  • f

    Fergus Hewson

    10/16/2025, 5:39 PM
    I want to export a visual assets library and am evaluating using ImageVector or svg/android-drawable. I was planning on using ImageVector due to the kotlin API and inherit KMP support. But it seems recently that the MaterialIcons lib was deprecated due to "outdate styling" and "slow compilation times". There is an obvious byte code bloat when using ImageVector, but if we are using a compiled lib, what actually slows down App compilation? It seems a little bizarre to me. It seems svgs are support OOTB for KMP now, so maybe converting assets to Android drawables just for that target could work.
    l
    m
    • 3
    • 4
  • b

    bj0

    10/23/2025, 8:30 PM
    I just bumped my compose deps to the latest, and where my UI used an
    ExposedDropdownMenuBox
    , it just started throwing an exception:
    Copy code
    java.lang.IllegalStateException: No OnBackPressedDispatcherOwner was provided via LocalOnBackPressedDispatcherOwner
                                                                                                        	at androidx.activity.compose.BackHandlerKt.BackHandler(BackHandler.kt:97)
                                                                                                        	at androidx.compose.material3.internal.BackHandler_androidKt.BackHandler(BackHandler.android.kt:26)
                                                                                                        	at androidx.compose.material3.ExposedDropdownMenuKt.ExposedDropdownMenuBox(ExposedDropdownMenu.kt:247)
    I'm not familiar with
    OnBackPressedDispatcherOwner
    or
    BackHandler
    , is it supposed to be set automatically or is it something I have to explicitly set now I'm using compose inside a
    ComposeView
    because I have to run inside some legacy views.
  • s

    starke

    10/24/2025, 6:58 PM
    Does anyone know how to set the
    IME_FLAG_NO_PERSONALIZED_LEARNING
    flag for a compose
    TextField
    to enable the incognito keyboard? 🤔
    e
    • 2
    • 1
  • a

    alexhelder

    10/27/2025, 9:50 PM
    In recent versions of the Android Settings app, groups of items appear to be on another surface with rounded corners. What is the most straightforward way to achieve that using LazyColumn etc? Are those items inside Cards or do individual ListItem(s) just have the corners clipped, etc?
    t
    c
    s
    • 4
    • 3
  • a

    Archie

    11/05/2025, 2:36 PM
    Hi @Ian Lake, In the example nav3 recipes for common ui, defines the bottom navigation on the top level scaffold outside of the
    NavDisplay
    . Am I wrong to think that common ui could be defined inside custom scenes instead? Or is it better to defined the common ui on each destination and do SharedElementTransition on destination switching? Whats the correct approach for this case? Thanks in advance.
    ➕ 1
    👀 2
    v
    i
    • 3
    • 13
  • g

    Guyaume Tremblay

    11/10/2025, 5:53 PM
    Hi! I've an issue with Accessibility of a LazyColumn. With Talkback activated, when user reach the last visible item and focus the next one using finger gesture, the next item go to the top of the screen, almost completely out of it actually, and the focus leave the list and go back the the Top App Bar ! Did anyone have face the same issue or know what's happening ?
    • 1
    • 3
  • e

    Edgars Malahovskis

    11/10/2025, 8:12 PM
    Hi! I am having an issue with accessibility, since 1.9.0 version. I know that there are braking changes on graphicsLayer, but even if I remove all direct applications of graphicsLayer, entire app is just broken. Accessibility is not working. Not sure where to even dig for a way out 😄
    k
    s
    • 3
    • 10
  • r

    Rene Win

    11/12/2025, 1:48 PM
    Hello, anyone has some idea how to disable the scrolling of largetopappbar with exitUntilCollapsedScrollBehavior if the content beneath cant be scrolled (because its so small that no scrolling is necessary) i tried to intercept the pointerInputs on the app bar but it doesnt worked. i can remove the scrolling from the content, but when dragging on the app bar i can collapse and expand it
  • c

    Colton Idle

    11/12/2025, 5:07 PM
    a11y question. I'm using a
    SingleChoiceSegmentedButtonRow
    from m3. My team got a report back from an accessibility audit service saying that the buttons in the row should announce the name of the overall group that they're in. I don't see an api for that. Am I missing something? My impl is basically copy pasted from the compose samples:
    Copy code
    fun SegmentedButtonSingleSelectSample() {
        var selectedIndex by remember { mutableStateOf(0) }
        val options = listOf("Day", "Month", "Week")
        SingleChoiceSegmentedButtonRow {
            options.forEachIndexed { index, label ->
                SegmentedButton(
                    shape = SegmentedButtonDefaults.itemShape(index = index, count = options.size),
                    onClick = { selectedIndex = index },
                    selected = index == selectedIndex
                ) {                Text(label)            }        }    }} //moved closing braces to one line to save lines
    c
    • 2
    • 2
  • b

    bryankeltonadams

    11/12/2025, 6:37 PM
    Is there a good way yet to use ModalBottomSheet with nested navigation inside of it and having the backButton navigate back rather than closing the sheet? I asked this a couple years ago and didn't really find a good solution. You can set
    Copy code
    properties = ModalBottomSheetProperties(
                    shouldDismissOnBackPress = true
                )
    but that just makes the back button do nothing, can't use backHandlers or anything. I also still want the swipe to dismiss to fully dismiss so I'm not sure if there's a combo of messing with confirmValueChange + onDismissRequest that works for this situation.
    i
    c
    • 3
    • 5
  • b

    bryankeltonadams

    11/12/2025, 7:37 PM
    When dealing with certain navigation flows with Navigation3, does it make sense to just have really complicated SceneStrategies with different pane types, or is there a current pattern for doing like "Nested Navigation" somewhat like "Nested graphs" in Jetpack Navigation? Is it as simple as having an entryProvider that is another NavDisplay that has its own SceneStrategy?
    i
    • 2
    • 9
  • b

    bryankeltonadams

    11/12/2025, 11:53 PM
    Anyone know why this was changed?
    BottomSheetDefaults.windowInsets
    now includes
    <http://WindowInsets.safeDrawing.Top|WindowInsets.safeDrawing.Top>
    . (I0ab67, b/321877275, b/336962418, b/342093067) This just makes it so the sheet is automatically padded by the statusBars, but I've been applying a color to my full screen content and not the sheet background color itself. I can fix it by setting WindowInsets(0.dp,0.dp,0.dp,0.dp) on the sheet and then consuming the WindowInsets on the content.
    a
    • 2
    • 11
  • b

    bryankeltonadams

    11/13/2025, 10:07 PM
    with Navigation 3, I've been clearing the backStack because I'm also setting state to the boolean that shows the NavDisplay to false, doing this I haven't ran into any exceptions, but should I just leave the last entry on the backStack and just update the state to hide the NavDisplay?
    • 1
    • 2
  • p

    Pablo

    11/14/2025, 9:39 AM
    In jetpack compose mvvm, how to update screen content each 5 seconds only when the screen is in foreground? doing it in a while(isActive) in the init block of the viewmodel doesn't work, because it still does the job when the screen is in background Is it a good practice and the best option to do it using this code inside the screen composable? (seems to work perfectly)
    Copy code
    val lifecycleOwner = LocalLifecycleOwner.current
        LaunchedEffect(lifecycleOwner) {
            lifecycleOwner.lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) {
                while (isActive) {
                    vm.populateData()
                    delay(5_000) // every 5 seconds
                }
            }
        }
    f
    • 2
    • 4
  • c

    Colton Idle

    11/14/2025, 9:00 PM
    I (admittedly) haven't done too many screen size dependent layouts etc so I'm out of the loop on what the modern way to do that in compose. One thing I need to do now (as per my designer) is "If the screen is small, please use 12.sp for this. In all other cases use 16.sp" How would I do that in a composable? I've let my designer know that auto size text exists, but in this case they want this conditional.
    c
    j
    +3
    • 6
    • 12
  • b

    Bradleycorn

    11/19/2025, 6:19 PM
    Is this the right/best way to enable immersive mode (hide the system bars) for a specific composable?
    Copy code
    @Composable
    fun ImmersiveContent() {
        val view = LocalView.current
        
        DisposableEffect(Unit) {
            val window = (view.context as? Activity)?.window ?: return@DisposableEffect onDispose {}
            val insetsController = WindowCompat.getInsetsController(window, view)
            
            // Enable immersive mode
            insetsController.apply {
                hide(WindowInsetsCompat.Type.systemBars())
                systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
            }
            
            // Restore when composable leaves
            onDispose {
                insetsController.show(WindowInsetsCompat.Type.systemBars())
            }
        }
        
        // Your content here
    }
    i
    s
    • 3
    • 6
  • e

    eygraber

    11/20/2025, 2:47 AM
    Do I need to add a dependency on
    androidx.compose.ui:ui-tooling
    in all modules that have previews, or if there is one module that depends on it in the project it should be good enough? I tried removing it from some modules, and previews seem to be working without it.
    m
    • 2
    • 1
  • c

    Colton Idle

    11/20/2025, 6:03 PM
    Are there any official docs that state compose will make touch targets 48.dp by default? I remember it coming up a few times in this slack but can't seem to find it.
    k
    • 2
    • 6
  • c

    Colton Idle

    11/20/2025, 6:24 PM
    Anyone familiar with talkback on android + compose know if this is possible (this comes from ios documentation). basically how to let a11y users know that there are more actions available on a list item.
    CleanShot 2025-11-20 at 13.22.54.mp4
    a
    • 2
    • 2
  • c

    Colton Idle

    11/20/2025, 11:34 PM
    In this example of an IconButton from the docs... will
    composeTestRule.onNodeWithText("Localized Description")
    select the inner icon, or the outer button?
    t
    • 2
    • 3
  • m

    mohamed rejeb

    11/23/2025, 12:25 PM
    Is there a way to prevent AndroidView Composable from consuming gestures, currently if I have a normal composable behind an AndroidView Composable, I can't receive gestures in the normal Composable.
    • 1
    • 1
  • m

    Mini

    11/25/2025, 1:56 PM
    Considering nav3 "Offers you full control of the back stack" Does this mean we will finally be able to perform navigation directly from our viewmodels? (Assuming the owner of the backstack state is something the viewmodel has access to/not a composable)
    z
    • 2
    • 2
  • j

    Jonathan

    11/26/2025, 4:38 AM
    Has anyone been able to address the bug in Navigation2 (
    NavHost
    ) where you’re unable to return to a given “top level destination” after navigating to another “top level destination” with route args? To exit this erroneous state, you must manually pop the top-most “top level destination” from the back stack then everything works as it should. I’m able to reproduce this bug in the Now In Android app so I know it’s not a bug unique to my app/implementation. If anyone has any insights on how to work around this bug it would be more than appreciated.
    Screen_recording_20251125_233704.mp4
    🤨 1
  • c

    Colton Idle

    11/26/2025, 6:25 PM
    lazyweb: I haven't created a brand new design system with custom type in compose since a few years ago. I know back then we used to have to "reset" all of the line height stuff in android/compose in order to match figma. Do we still need to do that or did that get "fixed" cc: @Siyamed because I think I spoke to you about it a few years ago.
    g
    • 2
    • 1