Marcin Wisniowski
05/02/2023, 10:06 PMonStart
. However I'm trying to build a full Compose app and using Compose Navigation, so the Activity lifecycle events not longer relate to the screens in the Compose world. What would be the correct alternative?Ian Lake
05/02/2023, 10:07 PMIan Lake
05/02/2023, 10:08 PMLifecycle
, so the LocalLifecycleOwner
being used there isn't the activity if you are on one of the screens inside a NavHost
Marcin Wisniowski
05/02/2023, 10:10 PMIan Lake
05/02/2023, 10:11 PMLifecycleEventEffect(Lifecycle.Event.ON_START) {
// Do your onStart side effect here
}
Ian Lake
05/02/2023, 10:11 PMMarcin Wisniowski
05/02/2023, 10:16 PMdewildte
05/02/2023, 10:17 PMIan Lake
05/02/2023, 10:22 PMlifecycle.currentStateAsState
which converts Lifecycle.State
into observable Compose State (e.g., it will automatically trigger recomposition when the Lifecycle.State changes and the upcoming LifecycleStartEvent
and LifecycleResumeEvent
that give DisposableEffect
style pairs of `onStart`/`onStop` and `onResume`/`onPause` calls for automatic cleanup style workPablichjenkov
05/02/2023, 11:15 PMcollectAsStateWithLifecycle
? Or perhaps not deprecate it but change the internal implementation of it?
Last time I checked, current implementation relied on listening the lifecycle events and starting/canceling a collecting job when start/stop respectively.Ian Lake
05/02/2023, 11:45 PMrepeatOnLifecycle
, which we're happy with the implementation with already (and doesn't depend on Compose, so can't use most of what we're building at this level)Pablichjenkov
05/03/2023, 12:21 AMKata
05/16/2023, 2:32 PMColton Idle
07/20/2023, 3:31 PMKata
07/20/2023, 5:12 PMIan Lake
07/20/2023, 11:21 PMColton Idle
07/21/2023, 3:02 PM