• s

    Smorg

    1 year ago
    My
    hiltViewModel
    calls (from the
    androidx.hilt.naviagtion.compose
    lib) returns a new instance of the retrieved viewmodel as opposed to returning the same viewmodel scoped to a navigation graph where it is first retrieved. Any ideas what I might be missing?
    s
    Colton Idle
    +1
    5 replies
    Copy to Clipboard
  • rnett

    rnett

    1 year ago
    I want to be able to pick up and drag one element into a "container" element, i.e. moving files around in folders in AS or IntelliJ. Dragging is supported fine, but detecting when something is dropped on the current composable seems hard (looking for enter/exit doesn't work since
    detectDragGesturesAfterLongPress
    consumes the position change events). Is there any support for this I'm not seeing, or has anyone implemented anything similar?
    rnett
    1 replies
    Copy to Clipboard
  • d

    darkmoon_uk

    1 year ago
    focusable(...)
    does not seem to be working as advertised? I'm trying to make a
    Box
    (or
    Surface
    - I'm not fussy 😁) be focusable so have modified it to: • be
    .focusable(true)
    • have a
    focusOrder(myFocusRequester)
    Documentation suggests this is all we need for a custom composable to be focused, and yet, when I call
    requestFocus()
    on my Box's focus requester, the previously focused component (a regular
    TextField
    ) does not appear to 'let go' of it's focus, also TalkBack does not shift it's highlight to the
    Box
    component. What else do I need to do to effect a full transfer of focus over to my custom component?
    d
    rnett
    3 replies
    Copy to Clipboard
  • rnett

    rnett

    1 year ago
    I have two conflicting state changes being done from an event handler. I would like the first to be done, trigger recompose, and then the second (no-longer conflicting, since it would be based on the newly updated state) to be done. This isn't what happens, is there a way to force it? Note that these event handlers are passed in. I could potentially force recomposition between them, but that would be expensive when the event handlers don't need it. Minimal example in :thread-please:
    rnett
    d
    6 replies
    Copy to Clipboard
  • r

    Ravin Jain

    1 year ago
    Question about recomposition with
    List
    and
    SnapshotStateList
    Using
    List
    instead of
    SnapshotStateList
    with
    items.forEachIndexed
    causes recomposition of all the composables. For example in the below code when I click
    Button A
    it calls a function in viewmodel which increments the
    progressState
    by 10. This state change should recompose only the
    A
    composable but it causes recomposition of
    B
    as well. Any idea why ? Example in the thread :thread-please:
    r
    Colton Idle
    3 replies
    Copy to Clipboard
  • Anton Dmytryshyn

    Anton Dmytryshyn

    1 year ago
    https://developer.android.com/jetpack/androidx/releases/navigation#2.4.0-alpha07 Got to wait before upgrading to this dependency to use alongside accompanist, despite all the great bug fixes. It doesn't play nice with accompanist AnimatedNavhost(), when trying to use it an error occurs
    java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Set
            at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost$lambda-3(AnimatedNavHost.kt:323)
            at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:158)
            at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:85)
    Anton Dmytryshyn
    i
    3 replies
    Copy to Clipboard
  • a

    allan.conda

    1 year ago
    has this been fixed in the latest navigation update?https://issuetracker.google.com/issues/194313238
    navigation-compose 2.4.0-alpha05 does not keep a subgraph’s BackStackEntry until the transition animation completes
    a
    i
    3 replies
    Copy to Clipboard
  • aiidziis

    aiidziis

    1 year ago
    Hey! Maybe someone has encountered Skia crashes in production when running Compose.Stacktrace in thread 👇🏻
    aiidziis
    Adam Powell
    8 replies
    Copy to Clipboard
  • z

    zhagnfei

    1 year ago
    TextField(
            value = feedContent.observeAsState().value ?: "",
            onValueChange = {
                if (it.length <= 200) {
                    feedContent.value = it
                }
            },
            maxLines = 4,
            colors = textFieldColors(
                    textColor = colorResource(id = R.color.color_22BE8C),
                    cursorColor = colorResource(id = R.color.colorPrimary),
                    backgroundColor = colorResource(id = R.color.color_f1f3f7),
                    focusedIndicatorColor = Color.Transparent,
                    unfocusedIndicatorColor = Color.Transparent,
                    disabledIndicatorColor = Color.Transparent
            ),
            shape = RoundedCornerShape(6.dp),
            placeholder = {
                Text(text = stringResource(id = R.string.feedback_input_desc),
                        modifier = Modifier.wrapContentSize(),
                        color = colorResource(id = R.color.color_BBBBC3), fontSize = 14.sp)
            },
            modifier = Modifier
                    .fillMaxWidth()
                    .wrapContentHeight(align = <http://Alignment.Top|Alignment.Top>)
                    .padding(top = 20.dp)
                    .background(Color(0xF1F3F7), RoundedCornerShape(6.dp)),
    )
    why show the textcolor is colorPrimary????
    z
    a
    7 replies
    Copy to Clipboard
  • Alex

    Alex

    1 year ago
    What could be a reason that a LazyColumn produces this crash?
    java.lang.ArrayIndexOutOfBoundsException: length=32; index=32
            at androidx.compose.runtime.collection.IdentityArrayMap.remove(IdentityArrayMap.kt:100)
            ...
    Alex
    Albert Chang
    3 replies
    Copy to Clipboard