Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 82fb3248e2a4d59712c14fa741eb9bea18ec9448
Author: Ian Lake <ilake@google.com>
Date: Mon Jun 08 15:54:22 2020
Provide a view scoped SavedStateRegistryOwner
Rather than returning the Fragment itself as the
ViewTreeSavedStateRegistryOwner for a Fragment,
create a separate SavedStateRegistryOwner that is tied
into the view lifecycle.
This ensures that the SavedStateRegistryOwner provided
there correctly has its state saved alongside the
View itself and restored when the view state is restored.
This particularly fixes cases where the Fragment
is put on the back stack and the Fragment itself
has not gone through onSaveInstanceState().
Test: new FragmentViewLifecycleTest passes
BUG: 158503763
Change-Id: I3741fc1a1b289d6594b22a192c4496625ec9e5e9
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentViewLifecycleOwner.java
https://android-review.googlesource.com/1326611
Branch: androidx-master-dev
commit 82fb3248e2a4d59712c14fa741eb9bea18ec9448
Author: Ian Lake <ilake@google.com>
Date: Mon Jun 08 15:54:22 2020
Provide a view scoped SavedStateRegistryOwner
Rather than returning the Fragment itself as the
ViewTreeSavedStateRegistryOwner for a Fragment,
create a separate SavedStateRegistryOwner that is tied
into the view lifecycle.
This ensures that the SavedStateRegistryOwner provided
there correctly has its state saved alongside the
View itself and restored when the view state is restored.
This particularly fixes cases where the Fragment
is put on the back stack and the Fragment itself
has not gone through onSaveInstanceState().
Test: new FragmentViewLifecycleTest passes
BUG: 158503763
Change-Id: I3741fc1a1b289d6594b22a192c4496625ec9e5e9
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentViewLifecycleTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentStateManager.java
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentViewLifecycleOwner.java
il...@google.com <il...@google.com> #3
This has been fixed internally and will be available in Fragment 1.3.0-alpha07
.
Description
Following is true for fragment's view and it complicates usage of it.
It would be nice to explore if it is possible to make
viewLifecycleOwner
SavedStateRegistryOwner
and make those lifecycles the same