• Archie

    Archie

    2 years ago
    Is there a way to integrate
    Navigation Component
    in
    Compose
    without using
    Fragments
    ?
    Archie
    i
    3 replies
    Copy to Clipboard
  • galex

    galex

    2 years ago
    What about Hilt ? 😄 (dislaimer: didn’t try it yet, will do soon)
    galex
    Adam Powell
    +5
    36 replies
    Copy to Clipboard
  • d

    Daniel Rampelt

    2 years ago
    I'm having some trouble getting previews to work with the latest versions, last time I tried compose was with dev05 and I didn't have any issues. Project builds and runs fine on a device, it's just previews not working. I'm using AS 4.2 Canary 5 and compose dev15, getting this error in the preview pane (I'll post the full stack trace in a thread):
    The following classes could not be instantiated: - androidx.ui.tooling.preview.ComposeViewAdapter
    d
    m
    +4
    10 replies
    Copy to Clipboard
  • Timo Drick

    Timo Drick

    2 years ago
    Just started open beta test for my Wallpaper App. The UI is exclusive Compose. Single Activity no Fragments. It is still work in progress and compose version dev14. Please try it and report problems. If you have any questions how i implemented s.th. i am looking forward to explain it and share code with you.https://play.google.com/apps/testing/de.appsonair.fanart Did not have any compose based app with big user base now. So i do not know if there are some problems. In theory it should run on all devices since Android API 21
    Timo Drick
    Halil Ozercan
    +1
    8 replies
    Copy to Clipboard
  • m

    MBegemot

    2 years ago
    Hi timo, why don't just use a google drive link like https://drive.google.com/file/d/1p647P0bOjpoqZtDZQEwu-9bIZmyleibn/view?usp=sharing it's easier specially at early stages, you can check it if you wish it's an app for language students , still in alfa.
    m
    1 replies
    Copy to Clipboard
  • Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    2 years ago
    With this change that landed yesterday (https://android-review.googlesource.com/c/platform/frameworks/support/+/1369437), it looks like the API for entering Compose from classic Android Views is moving away from
    setContent
    extension functions to the dedicated
    AbstractComposeView
    and
    ComposeView
    classes. Is the
    ViewGroup.setContent
    extension potentially going away as well? If so, will there still be a way to pass CompositionReferences to compositions hosted inside android views? (This issue: https://issuetracker.google.com/issues/156527485)
    Zach Klippenstein (he/him) [MOD]
    l
    +1
    11 replies
    Copy to Clipboard
  • Ricardo C.

    Ricardo C.

    2 years ago
    Why are we getting indexed variants for lazy composables instead of adding index to the existing ones?https://android-review.googlesource.com/c/platform/frameworks/support/+/1364679
    Ricardo C.
    l
    +3
    25 replies
    Copy to Clipboard
  • Halil Ozercan

    Halil Ozercan

    2 years ago
    I see that with dev15,
    Transition
    composable is deprecated in favor of
    transition
    which is highly similar but instead of receiving children as a trailing lambda, it provides a state that can be used by following composables in the same scope. The docs suggest that
    toState
    is the main control unit for transition state. Whenever it changes, animation will change the course to this new destination state whether the animation was running or not. However, I'm having trouble understanding how to reset the current animation all together. Let's say my initial configuration is to go from
    A
    to
    B
    . In the middle of this transition, Composable receives a new state, which means the animation needs to restart. Animation should go back to state
    A
    and again head for
    B
    . I could not find a way of simply resetting
    initState
    and
    toState
    at the same time. What is the recommendation for such behavior?
    Halil Ozercan
    i
    +1
    8 replies
    Copy to Clipboard
  • c

    chris

    2 years ago
    When working with state on a mutable object even if I tell the state that it is
    NeverEqual
    to invoke the comparison of the objects to trigger a recompose I still have to call the setter. So I end up assigning the object to itself. Am I missing another way to do this?
    c
    Zach Klippenstein (he/him) [MOD]
    2 replies
    Copy to Clipboard
  • Zach Klippenstein (he/him) [MOD]

    Zach Klippenstein (he/him) [MOD]

    2 years ago
    Does a
    CompositionLifecycleObserver
    that enters a composition by being captured by a composable lambda get its callbacks invoked? E.g.
    class MyActivity : AppCompatActivity() {
      private val myObserver: CompositionLifecycleObserver = object : …
    
      override fun onCreate() {
        setContent { MyApp(myObserver) }
      }
    AFAIK the only way an observer can be “registered” is by being returned from
    remember {}
    .
    Zach Klippenstein (he/him) [MOD]
    l
    +1
    4 replies
    Copy to Clipboard