Archie
09/28/2020, 1:48 PMYann Badoual
09/28/2020, 2:13 PMAdam Powell
09/28/2020, 2:17 PMArchie
09/29/2020, 1:50 PMViewModelStore
which I could scope to a "composable screen" lifecycle. Kinda like how Fragment's ViewModel work but instead for "composable screen".Adam Powell
09/29/2020, 2:07 PMContextAmbient
to get the current context, unwrap its base context until you find an Activity
instance, and check its isChangingConfiguration
methodArchie
09/29/2020, 2:11 PMAndrey Kulikov
09/29/2020, 4:56 PMArchie
09/30/2020, 7:38 AMNavigation Compose
Library which is currently in the SNAPSHOT. Is the feature you mentioned already in that version? If yes I'm curious and want to having a look at it.Andrey Kulikov
10/10/2020, 3:25 PMArchie
10/10/2020, 3:55 PMArchie
10/12/2020, 9:23 AMviewModel()
thank you very much.ViewModel
across multiple composable()
?
Something like:
NavHost(...) {
composable("route1) {
val viewModel: SharedViewModel = viewModel() // Where this ViewModel
Screen(...)
}
composable("route2) {
val viewModel: SharedViewModel = viewModel() // and this
Screen(...)
}
composable("route3) {
val viewModel: SharedViewModel = viewModel() // And this are all same instances
Screen(...)
}
....
}
Andrey Kulikov
11/01/2020, 12:21 PM