• Mikael Alfredsson

    Mikael Alfredsson

    2 years ago
    I’ve must have missed something about how the UI updates are handled. Before (when the magic of @Model existed) I could change the data model outside a @compose scope (data pushed via FCM) and it automatically updated the UI. Without that magic, I should according to the migration guide, I should use
    by state
    or
    mutableStateOf
    together with
    remember
    , both of them reassign the datamodel to a wrapped variable inside the @Compose scope and i’m not sure how to mutate the data class and force a refresh.
    Mikael Alfredsson
    m
    +3
    16 replies
    Copy to Clipboard
  • b

    bmo

    2 years ago
    Hello everyone, I made a very simple app using compose and it crashes with the error :
    java.lang.IllegalArgumentException: Key 640122159 was already registered. Please call unregister before registering again
    The code can be found here https://github.com/bmonjoie/ComposeTipsCalculator I have seriously no idea what I'm doing wrong so if someone could give me any pointers, that would be really appreciated
    b
    Andrey Kulikov
    5 replies
    Copy to Clipboard
  • Timo Drick

    Timo Drick

    2 years ago
    I cannot find the constructor for
    androidx.ui.core.LayoutNode(modifier = currentComposer.materialize(modifier), measureBlocks = measureBlocks) { childrend() }
    Which is used in many base composable components. I would like to use especially the way LayzyItems using it to be able to add and remove Nodes during measurement runs. Why is it hidden from the Public API? Or maybe i just missed something?
    Timo Drick
    shikasd
    +1
    10 replies
    Copy to Clipboard
  • andylamax

    andylamax

    2 years ago
    https://twitter.com/intelligibabble/status/1273339533891788800 This tweet referes to using compose in any tree. Does this mean it can be applicable to kotlin/jvm for desktop? or even used in kotlin/js?
    andylamax
    shikasd
    +3
    17 replies
    Copy to Clipboard
  • louiscad

    louiscad

    2 years ago
    Hello, people from Flutter made an extensive document about state restoration and their plans (since it's not supported natively yet). When it comes to Jetpack Compose, I've not seen much about facilities to ease state saving (yet), so I'm wondering if that document could help shape the APIs that we can use to support state restoration easily. Here it is: https://flutter.dev/go/state-restoration-design
    louiscad
    Zach Klippenstein (he/him) [MOD]
    +2
    26 replies
    Copy to Clipboard
  • aipok

    aipok

    2 years ago
    I need to make an animation for
    Image
    using an array of
    DrawableResIds
    . Let say to switch an image every second. Does anyone know how to achieve this using Compose animation API or transition? Or might there is some other way to do it?
    aipok
    Zach Klippenstein (he/him) [MOD]
    4 replies
    Copy to Clipboard
  • Vince Rickey

    Vince Rickey

    2 years ago
    Hi. My coworker @Jordan Carlyon and I are Android developers at the Wall Street Journal. We’re working on a joint initiative with our iOS and backend teams to create a Component Library that uses Jetpack Compose backed by JSON models. We successfully completed a concept thanks to the documentation and samples, but I haven’t found much information on the roadmap in terms of moving to alpha or beta. A level of parity with SwiftUI is important. Right now we’re debating whether or not it’s worth using Jetpack Compose in a small corner of our app or just building a standalone library and waiting to integrate until Jetpack Compose is more mature knowing that it could be a while. Any advice or general feedback would be helpful. Thanks!
    Vince Rickey
    bryansills
    +1
    6 replies
    Copy to Clipboard
  • h

    Hyun

    2 years ago
    Hi, I need an advice again. the code below hide ui if shown == false
    if (shown) {
        Column {
            Text("Success")
        }
    }
    but, I would like to use the way below similar to data binding.(
    android:visiblity="@{model.shown}"
    ) as it reduce indent depth, so, seems easy to read UI code. and feel better to separate ui and logic.
    Column(Modifier.visible(shown)) {
        Text("Success")
    }
    I tried to customize Modifier. but, it looks difficult. is there any possible solution? or is it not recommended approach?
    h
    Timo Drick
    +2
    20 replies
    Copy to Clipboard
  • manueldidonna

    manueldidonna

    2 years ago
    ListItem
    icon is wrapped in a
    Box
    with
    ContentGravity.TopStart
    . I think that a Center Alignment would be more appropriate
    manueldidonna
    Andrey Kulikov
    +2
    5 replies
    Copy to Clipboard
  • amar_1995

    amar_1995

    2 years ago
    Is there any solution to integrate pagination library with compose
    AdapterList
    ?
    amar_1995
    1 replies
    Copy to Clipboard