https://kotlinlang.org logo
Join Slack
Powered by
# compose
  • e

    eygraber

    11/25/2025, 9:58 AM
    I didn't notice it in the recipe repo, but is there a way to get a NavEntry scoped SavedStateHandle in nav3?
    i
    g
    • 3
    • 11
  • s

    Stylianos Gakis

    11/25/2025, 1:23 PM
    Trying to configure
    org.jetbrains.compose.resources.ResourcesExtension
    from my gradle convention plugin, but I can't seem to find the way to do this at the right time. When doing:
    Copy code
    project.pluginManager.apply("org.jetbrains.compose")
    project.pluginManager.withPlugin("org.jetbrains.compose") {
      // 1
      project.configure<org.jetbrains.compose.resources.ResourcesExtension> {
        // 2
      }
    }
    I can see that I can get in //1 but not in //2. I see that the resources extension is created after the ComposePlugin is applied https://github.com/JetBrains/compose-multiplatform/blob/1b40a6db80c9f97859ac56c088[…]/compose/src/main/kotlin/org/jetbrains/compose/ComposePlugin.kt so I figured it should be available. When using the generated DSL and doing this outside of my convention plugin (
    compose.resources { ... }
    ) this works fine, so I am sure there is something I am doing wrong regarding the ordering of things. Or it's something else I don't understand.
    ✅ 1
    • 1
    • 1
  • j

    Jonas

    11/27/2025, 4:46 PM
    I'm experiencing a strange behaviour when using nav3: I'm passing a function
    navigateUp
    to a composable which is implemented as
    backstack::removeLastOrNull
    . This function is being called when a certain state is collected from the
    ViewModel
    . When the function is called, it causes the composable to re-render twice which removes more screens from the backstack. When I remove the function call and replace it with a
    println
    it's only printed once. Can someone explain to me why removing a composable from the backstack causes it to rerender without any other state changes? Did someone experience the same?
    ❌ 1
    w
    • 2
    • 2
  • p

    Pablo

    11/28/2025, 1:17 PM
    In Jetpack Compose + MVVM I have a parent screen with 3 child screens (via Navigation). Each child generates a PDF differently (download, local build, etc.), but all need to display, email, and print it. Right now each child stores the PDF in its own
    uiState
    , then I use
    LaunchedEffect
    to pass it up to the parent, which also stores it. That duplicates state and breaks Single Source of Truth. Example of my parent section receiving the pdf and storing it in it's own uistate to do actions with it:
    Copy code
    composable(InfractionsDestinations.Pending.name) {
        PendingScreen(
            infractions = uiState.pendingInfractions,
            onPDFDisplayRequested = { pdf -> vm.storePDFForDisplayingItAndOtherActions(pdf) }
        )
    }
    Child ViewModel:
    Copy code
    data class UiState(val loading: Boolean = false, val pdf: PDF? = null)
    Child Composable:
    Copy code
    LaunchedEffect(uiState.pdf) {
        uiState.pdf?.let { onPDFDisplayRequested(it) }
    }
    👉 Question: What’s the recommended Compose/MVVM strategy to avoid duplicating the PDF in both child and parent state, while still letting each child generate it?
    g
    • 2
    • 1
  • a

    Ali Khaleqi Yekta

    11/30/2025, 11:54 AM
    In Compose UI or better put, in skiko, is there native support for displaying colors beyond rgb? I'm asking because even though Compose Color class supports storing a color in Oklab space, its companion Color properties use RGB. Can we actually "display" oklab colors like in web?
    r
    • 2
    • 40
  • a

    Ankit Kumar

    11/30/2025, 3:08 PM
    Hello team, Need your help ! Watch the video and guide on how slack have implemented this transition. Through my own research I found that they host a fab button in compose view and upon clicking it transition to a composable like dialog that is attached to a LayoutNode on top of RootOwner. Any guidance?
    Screenrecorder-2025-11-09-11-37-11-431.mp4
    p
    • 2
    • 2
  • s

    Serhii K

    12/01/2025, 9:59 AM
    Hi all. Has anyone solved the issue where the keyboard covers the input text? I know there are two ways to “fix” it, but both are not acceptable for me: 1. Set a fixed height for the text field — but I want to show all text on screen. 2. Remove
    .verticalScroll(rememberScrollState())
    - needs full text to remain visible. Any ideas? See the video.
    Screen_recording_20251201_113412.mp4
    t
    v
    • 3
    • 7
  • s

    swanti

    12/01/2025, 12:33 PM
    Has anyone ever run into a bug where Text on low end devices gets an alpha applied to it which doesn't get applied on high end devices? I have a NavHost that works perfectly fine on a Pixel phone, but on a Huawei phone after a couple navigations the text inside the screen gets an alpha applied to it. I'm using Compose Multiplatform with Compose Navigation 2
  • c

    Colton Idle

    12/01/2025, 8:13 PM
    If I want to update all of my
    Text
    in material to be TitleLarge, what's the best way to do that? Use
    ProvideTextStyle
    or a
    CompositionLocalProvider
    or something else at the top near my theme declaration?
    k
    k
    +3
    • 6
    • 12
  • e

    Erfannj En

    12/03/2025, 6:25 AM
    Hello everybody I'm curious about why rememberUpdatedState sets the value again after remembering. It seems that without
    apply { value = newValue }
    there is no problem.
    Copy code
    @Composable
    public fun <T> rememberUpdatedState(newValue: T): State<T> =
        remember { mutableStateOf(newValue) }.apply { value = newValue }
    a
    m
    z
    • 4
    • 6
  • r

    Rafs

    12/03/2025, 10:23 AM
    The
    ScrollableTabRow
    is getting skipped by accessibility when talkback element type is set to
    controls
    . It get's selected however when the element type is set to
    containers
    . Is this expected behaviour?
  • k

    Kyant

    12/03/2025, 11:39 AM
    How to force enable overscroll effect even if the content height is smaller than the scroll container?
    👀 1
    l
    • 2
    • 1
  • d

    dorche

    12/03/2025, 3:43 PM
    @Ian Lake is there a built in Compose equivalent for your answer about reselecting a bottom nav tab here https://stackoverflow.com/a/68779398 ? Or is there any guidance on how this should be implemented in Compose ?
    d
    i
    • 3
    • 6
  • t

    Tolriq

    12/05/2025, 8:17 AM
    I'm getting a
    java.lang.IllegalArgumentException: Can't represent a width of 0 and height of 4983405 in Constraints
    on a specific LazyColumn when it reaches a very very large number of lines. (See full stack trace below) Can someone see something in the stack that could point to what triggers this ? It seems tied to InstrinsicSize but I'm not sure how to find what and if there's a workaround for this.
    • 1
    • 1
  • e

    ebtokyo

    12/05/2025, 11:28 AM
    I'm trying to use compose resources files in my commonMain. If add a drawable I can render it perfectly in my compose preview via
    painterResource(Res.drawable.test)
    . Now if I do
    Res.getUri("files/test.txt")
    or
    Res.readBytes("files/test.txt")
    I'm getting this error:
    Copy code
    java.lang.IllegalStateException: Android context is not initialized. If it happens in the Preview mode then call PreviewContextConfigurationEffect() function.
    Is it a limitation from compose resources, no file loading from common code?
    m
    • 2
    • 6
  • a

    andrew

    12/05/2025, 8:34 PM
    Do we not get veil/unveil transitions in 1.10.0-rc01 for cmp?
    • 1
    • 1
  • u

    ursus

    12/05/2025, 11:35 PM
    How can I view compose value classes like
    Offset
    in the debugger? It's giving me the long, and I only see the
    x,y
    components after I evaluate the expression, which is super annoying
    r
    i
    • 3
    • 9
  • k

    Kyant

    12/06/2025, 2:41 AM
    When clip for large containers with
    GenericShape
    , click listener won't work after scroll to a certain position, which is a very urgent bug, and it has been there for a long time. Code is in🧵
    VID_20251206_103551_492.mp4
    r
    l
    • 3
    • 17
  • e

    ebtokyo

    12/06/2025, 3:21 AM
    I don't understand this error, I add the dependencies, the error message isn't super intuitive
    Copy code
    Exception in thread "main" kotlin.NotImplementedError: Implemented only in JetBrains fork.
    Please use `org.jetbrains.compose.ui:ui-util` package instead.
    r
    j
    • 3
    • 9
  • a

    Ameer Amjed

    12/06/2025, 8:19 AM
    👋 Hello, team! I am working on a TV Compose app that uses ExoPlayer for streaming, running on a custom Android TV box. Everything was working fine earlier, but after the recent implementation (using specific DRM), enabling
    setMultiSession(true)
    is required. However, on the TV box, this is causing resource limitations and some lag. When
    setMultiSession(false)
    is disabled, the stream stops completely. Do you have any suggestions?
    r
    c
    • 3
    • 4
  • o

    Olivier Patry

    12/06/2025, 12:49 PM
    Using Navigation3, I would like to achieve generic transition spec based on
    NavKey
    subclass specific properties. Say I have
    MyAppNavKey
    which extends
    NavKey
    and this interface defines a property to be implemented by final routes/NavKey. The idea would be to define the transition spec at
    NavDisplay
    level, based on
    targetState
    or
    initialState
    , and
    MyAppNavKey.someProperty
    , I could take the decision of which transition to apply. The issue I have is that I can't access
    NavEntry.key
    which is private, but this is the object I'd need to take the decision.
    ContentKey
    is a string I can't rely on. Ideally, I don't want to impact any
    entry<Foo>
    call sites of the
    entryProvider {}
    , everything should be statically declared in each route.
    data object MyFinalRoute(override val someProperty: Boolean) : MyAppNavKey
    s
    i
    • 3
    • 11
  • u

    ursus

    12/06/2025, 5:57 PM
    Copy code
    class Particles(
        val positions: Array<androidx.compose.ui.geometry.Offset>,
        val velocities: Array<androidx.compose.ui.geometry.Offset>
    )
    For educational purposes, I tried a SoA of
    Offsets
    , but looking at byte code it autoboxes, so no performance gains. Is there a way to convince the compiler to give me
    LongArray
    under the hood? (The type is convenient, ideally I'd not like to lose it)
    s
    r
    • 3
    • 80
  • p

    purezen

    12/07/2025, 3:23 PM
    I want to use state-based textfield. But Studio is not able to find the api. Do I need to update any package ?
  • a

    Adrian

    12/07/2025, 8:43 PM
    Hi! Which setup do you use for onboarding screens, do you use any library (for navigation between steps, progress bar etc.), or do you build it with raw composables and setup everything manually?
    r
    • 2
    • 1
  • r

    Rey (Kingg22)

    12/07/2025, 10:16 PM
    Hii folks cmp K How do you implement fetching in an API based on a lazy layout? After reaching section X, perform the fetch, then perform the fetch in another section, and so on. I thought it was a launched effect, but when exiting and re-entering the app, it makes an unnecessary fetch again. It's important to me that it be a testable form without a view model (something like a lambda or flag). Thx u in advance
    p
    • 2
    • 3
  • h

    HaniFakhouri

    12/08/2025, 4:49 PM
    Hi! I am exploring Navigation3, more specifically displaying dialogs and bottom sheets. I've seen in the recipes repo one example of a bottom sheet scene strategy:
    NavDisplay(sceneStrategy = bottomSheetStrategy)
    and another example of dialog scene strategy:
    NavDisplay(sceneStrategy = dialogStrategy)
    But what if I want to display one entry as a dialog and another entry as a bottom sheet? I mean NavDisplay does take in several scene strategies.
    i
    • 2
    • 3
  • a

    Alex Styl

    12/09/2025, 11:25 AM
    is the Hot Reload plugin not compatible with non-Multiplatform Android projects? I am trying to add a CMP module in a Android app (built using Android Studio) and I try to do
    ./gradlew run
    when i add the hot reload plugin i get:
    Copy code
    e: Unsupported plugin option: androidx.compose.compiler.plugins.kotlin:generateFunctionKeyMetaAnnotations=true
    when i remove the hot reload plugin, i can run the jvm target w/o a problem cc @Sebastian Sellmair [JB] @zsmb
    s
    z
    • 3
    • 8
  • f

    fal

    12/09/2025, 6:30 PM
    Hey everyone! I've been trying to create native E2E tests for my app (and avoid Appium). To be clear, what I mean by this is my test should theoretically know as little as possible about the app. Of course, under the hood it still knows about the test tags, and it is still instrumentation tests so it is grey-box after all. But, I do E2E test flows, where I always start from the starting activity/screen and go through the regular bootstrap flows etc. Now what I struggle the most is the fact that I sometimes have to babysit the ComposeTestRule TestClock. So, suppose in my test I have the following:
    Copy code
    private val composeTestRule: ComposeTestRule = createEmptyComposeRule()
    
    // and then I launch my starting activity like:
    ActivityScenario.launch<T>(startActivityIntent)
    We of course need
    ComposeTestRule
    to be able to match semantics as it is
    SemanticsNodeInteractionsProvider
    . This is fine, but sometimes I will need to either manually advance the
    composeTestRule.mainClock
    or use functions like
    composeTestRule.waitUntil
    which under the hood advances the clock (if autoAdvance is true). If I don't do this and I have things like the following in my screen:
    Copy code
    LaunchedEffect(Unit) {
        delay(1000)
        onEvent(ScreenEvent.CloseThis)
    }
    it will completely freeze the app and fail assertions. This level of control is great for precise UI tests where I want to specifically care about this, but from the perspective of an E2E test ideally I'd like to not care about this. It's the same when it comes to infinite animations and needing workarounds like
    withInfiniteAnimationFrameNanos
    . It feels like I should be able to not care if I don't want to. It seems like if I want to make E2E tests, I should instead do them through UiAutomator2 (which indeed is more black-box), but that has so many tradeoffs on speed and reliability that I feel like there should be a middle-ground no? Maybe I'm just super off-base here, so really curious on any opinions here, thanks!
    v
    • 2
    • 2
  • d

    dorche

    12/10/2025, 9:50 AM
    How are people sending screen_view analytics to Firebase from their Compose code? Which side effect function do you use? I'm trying to find how to match SwiftUI's
    onAppear
    which runs on navigating to and back to a screen but does not run on background and foregrounding the app...
    n
    • 2
    • 4
  • s

    Stylianos Gakis

    12/10/2025, 11:24 AM
    Looking at the
    PredictiveBackHandler
    in the CMP sources here, they mention that one should "Use NavigationEventHandler instead". However I do not see a way to setup that in a CMP context while still being able to get a hold of the progress percentage of the predictive back etc. What is it that I am missing here?
    i
    • 2
    • 1