Fixed
Status Update
Comments
mg...@google.com <mg...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 66494e2d6810347e6a3b41ec3f2665e598f108f0
Author: Ian Lake <ilake@google.com>
Date: Thu Apr 14 00:14:24 2022
Ensure that SavedStateHandle restores upon initial creation
runOnNextRecreation() only runs on the next time
the lifecycle reaches CREATED, not the first time.
By using a LifecycleObserver directly, we ensure that
each Lifecycle move causes a performRestore() to
consistently happen.
Test: existing tests pass, sample app works
BUG: 228865698
Relnote: "Fixed an issue where nesting one `NavHost` within
another `NavHost` in a non-primary bottom navigation tab
would lead to an `IllegalStateException` when using
multiple back stacks."
Change-Id: I11bd5173f035ae1da7922b4142fcedc0f3b54ff6
M lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandleSupport.kt
https://android-review.googlesource.com/2064518
Branch: androidx-main
commit 66494e2d6810347e6a3b41ec3f2665e598f108f0
Author: Ian Lake <ilake@google.com>
Date: Thu Apr 14 00:14:24 2022
Ensure that SavedStateHandle restores upon initial creation
runOnNextRecreation() only runs on the next time
the lifecycle reaches CREATED, not the first time.
By using a LifecycleObserver directly, we ensure that
each Lifecycle move causes a performRestore() to
consistently happen.
Test: existing tests pass, sample app works
BUG: 228865698
Relnote: "Fixed an issue where nesting one `NavHost` within
another `NavHost` in a non-primary bottom navigation tab
would lead to an `IllegalStateException` when using
multiple back stacks."
Change-Id: I11bd5173f035ae1da7922b4142fcedc0f3b54ff6
M lifecycle/lifecycle-viewmodel-savedstate/src/main/java/androidx/lifecycle/SavedStateHandleSupport.kt
na...@google.com <na...@google.com> #3
Thanks for quick fix! Works well with latest snapshot.
pr...@google.com <pr...@google.com> #4
Thanks for confirming! The fix will be in the next release of Lifecycle (2.5.0-beta01).
Description
Currently
lifecycle-viewmodel-compose
are depending oncompose-ui
incommonMain
. The dependency is only used inandroidMain
.This dependency brings alot of code for projects aiming to use Compose Runtime only, for example Redwood. At Voyager the Core and Navigator modules only depend on Compose Runtime, by adding the support for ViewModel to KMP projects with Voyager would bring the hole
compose-ui
.The solution here is just move the
compose-ui
dependency toandroidMain
.