Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit b3af8650cc51d87063c9cd814b32144bfa48bc8b
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 11 14:17:02 2019
Implement FragmentTransaction methods in the class
Split the FragmentTransaction methods out of BackStackRecord and back
into FragmentTransaction to create a layer of separation between the
manipulation and the execution of Operations.
Moving the implementation to FragmentTransaction means new operations
can be added without the need to create empty methods in
FragmentTransactions.
Test: ran fragment tests, ./gradlew checkApi
Bug: 129780800
Change-Id: If352280983fa798eafa6aa41162e4b7d24106ecb
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
https://android-review.googlesource.com/943726
https://goto.google.com/android-sha1/b3af8650cc51d87063c9cd814b32144bfa48bc8b
Branch: androidx-master-dev
commit b3af8650cc51d87063c9cd814b32144bfa48bc8b
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 11 14:17:02 2019
Implement FragmentTransaction methods in the class
Split the FragmentTransaction methods out of BackStackRecord and back
into FragmentTransaction to create a layer of separation between the
manipulation and the execution of Operations.
Moving the implementation to FragmentTransaction means new operations
can be added without the need to create empty methods in
FragmentTransactions.
Test: ran fragment tests, ./gradlew checkApi
Bug: 129780800
Change-Id: If352280983fa798eafa6aa41162e4b7d24106ecb
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
va...@google.com <va...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a6c8bc7b1d821496ae8cad896566b7d334336a27
Author: jbwoods <jbwoods@google.com>
Date: Fri Apr 12 15:38:15 2019
Set max Lifecycle for a Fragment
Added FragmentTransaction API to allow Fragment Lifecycle states to be
capped at a lower Lifecycle than FragmentManager or Activity. Passing
Lifecycle.State.RESUMED effectively removes any restriction. If the
transactions are added and popped off of the FragmentManager back stack,
the max Lifecycle state returns to the previous value.
Test: new tests. Ran Fragment tests
./gradlew checkApi
BUG: 129780800
Change-Id: I20735b88ed78735894ace9ae68a1287c6235dfdc
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.kt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/BackStackState.java
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransition.java
https://android-review.googlesource.com/942528
https://goto.google.com/android-sha1/a6c8bc7b1d821496ae8cad896566b7d334336a27
Branch: androidx-master-dev
commit a6c8bc7b1d821496ae8cad896566b7d334336a27
Author: jbwoods <jbwoods@google.com>
Date: Fri Apr 12 15:38:15 2019
Set max Lifecycle for a Fragment
Added FragmentTransaction API to allow Fragment Lifecycle states to be
capped at a lower Lifecycle than FragmentManager or Activity. Passing
Lifecycle.State.RESUMED effectively removes any restriction. If the
transactions are added and popped off of the FragmentManager back stack,
the max Lifecycle state returns to the previous value.
Test: new tests. Ran Fragment tests
./gradlew checkApi
BUG: 129780800
Change-Id: I20735b88ed78735894ace9ae68a1287c6235dfdc
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/BackStackStateTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/FragmentLifecycleTest.kt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/BackStackState.java
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentManagerImpl.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransition.java
il...@google.com <il...@google.com>
al...@gmail.com <al...@gmail.com> #4
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a24863fab1958f10c3791f0dbf612862c972be21
Author: jbwoods <jbwoods@google.com>
Date: Wed Apr 17 10:09:32 2019
Save fragment maxState on save and restore
Added mMaxState to fragmentState.
Test: Added test and reran Fragment tests
BUG: 129780800
Change-Id: Ibbe023668043e82078aa7fd97e0fd233457972f8
M fragment/src/androidTest/java/androidx/fragment/app/SaveStateFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentState.java
https://android-review.googlesource.com/946700
https://goto.google.com/android-sha1/a24863fab1958f10c3791f0dbf612862c972be21
Branch: androidx-master-dev
commit a24863fab1958f10c3791f0dbf612862c972be21
Author: jbwoods <jbwoods@google.com>
Date: Wed Apr 17 10:09:32 2019
Save fragment maxState on save and restore
Added mMaxState to fragmentState.
Test: Added test and reran Fragment tests
BUG: 129780800
Change-Id: Ibbe023668043e82078aa7fd97e0fd233457972f8
M fragment/src/androidTest/java/androidx/fragment/app/SaveStateFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/FragmentState.java
va...@google.com <va...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c37223a1b4512f1d34e100d2e521062dbad028d7
Author: jbwoods <jbwoods@google.com>
Date: Tue Apr 16 13:39:38 2019
Deprecate setUserVisibleHint()
We the addition of the setMaxLifecycle() Api in FragmentTransactions,
setUserVisibleHint() can be deprecated.
Deprecate setUserVisibleHint() method in fragments and marking all
usages (only used in FragmentPagerAdapter and
FragmentStatePagerAdapter) with SuppressWarnings("deprecated").
Test: ran Fragment Test
./gradlew checkApi
BUG: 129780800
Change-Id: I3d99991eb33dfc65d4b79efe566b54d0adce9d68
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/NestedInflatedFragmentTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/SaveStateFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentPagerAdapter.java
M fragment/src/main/java/androidx/fragment/app/FragmentStatePagerAdapter.java
https://android-review.googlesource.com/945776
https://goto.google.com/android-sha1/c37223a1b4512f1d34e100d2e521062dbad028d7
Branch: androidx-master-dev
commit c37223a1b4512f1d34e100d2e521062dbad028d7
Author: jbwoods <jbwoods@google.com>
Date: Tue Apr 16 13:39:38 2019
Deprecate setUserVisibleHint()
We the addition of the setMaxLifecycle() Api in FragmentTransactions,
setUserVisibleHint() can be deprecated.
Deprecate setUserVisibleHint() method in fragments and marking all
usages (only used in FragmentPagerAdapter and
FragmentStatePagerAdapter) with SuppressWarnings("deprecated").
Test: ran Fragment Test
./gradlew checkApi
BUG: 129780800
Change-Id: I3d99991eb33dfc65d4b79efe566b54d0adce9d68
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/androidTest/java/androidx/fragment/app/NestedInflatedFragmentTest.kt
M fragment/src/androidTest/java/androidx/fragment/app/SaveStateFragmentTest.kt
M fragment/src/main/java/androidx/fragment/app/Fragment.java
M fragment/src/main/java/androidx/fragment/app/FragmentPagerAdapter.java
M fragment/src/main/java/androidx/fragment/app/FragmentStatePagerAdapter.java
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 27bacd7294b8bcb312fadeb155724ebf9ac99e16
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 18 10:16:21 2019
Change max lifecycle state in FragmentState to ordinal
Saving the max lifecycle state as an int instead of a String.
Also renamed mLifecycleState to mMaxLifecycleState.
Test: all test pass
BUG: 129780800
Change-Id: Id8e3cf5acfee491f0fe6dae1799b83fbbff49635
M fragment/src/main/java/androidx/fragment/app/FragmentState.java
https://android-review.googlesource.com/947817
https://goto.google.com/android-sha1/27bacd7294b8bcb312fadeb155724ebf9ac99e16
Branch: androidx-master-dev
commit 27bacd7294b8bcb312fadeb155724ebf9ac99e16
Author: jbwoods <jbwoods@google.com>
Date: Thu Apr 18 10:16:21 2019
Change max lifecycle state in FragmentState to ordinal
Saving the max lifecycle state as an int instead of a String.
Also renamed mLifecycleState to mMaxLifecycleState.
Test: all test pass
BUG: 129780800
Change-Id: Id8e3cf5acfee491f0fe6dae1799b83fbbff49635
M fragment/src/main/java/androidx/fragment/app/FragmentState.java
jb...@google.com <jb...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c727857cf258f06d003c42417f37c75a4139b369
Author: jbwoods <jbwoods@google.com>
Date: Wed Apr 17 02:15:03 2019
Add constructors for new opt-in FragmentPagerAdapter behavior
FragmentPagerAdapter can make use of the setMaxLifecycle()
FragmentTransaction Api to ensure that only the fragment currently
visible to the user is resumed.
The default behavior places all fragments in a resumed state. This gives
developers the option to pass a boolean in to take advantage of the new
behavior.
Test: Ran supportv7 app
./gradlew checkApi
BUG: 129780800
Change-Id: Idbd97b4ebe0c22ac588340ef3b4369c7c5f4a1bd
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/BackStackState.java
M fragment/src/main/java/androidx/fragment/app/FragmentPagerAdapter.java
M fragment/src/main/java/androidx/fragment/app/FragmentStatePagerAdapter.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ToolbarFragmentPagerMenu.java
https://android-review.googlesource.com/945787
https://goto.google.com/android-sha1/c727857cf258f06d003c42417f37c75a4139b369
Branch: androidx-master-dev
commit c727857cf258f06d003c42417f37c75a4139b369
Author: jbwoods <jbwoods@google.com>
Date: Wed Apr 17 02:15:03 2019
Add constructors for new opt-in FragmentPagerAdapter behavior
FragmentPagerAdapter can make use of the setMaxLifecycle()
FragmentTransaction Api to ensure that only the fragment currently
visible to the user is resumed.
The default behavior places all fragments in a resumed state. This gives
developers the option to pass a boolean in to take advantage of the new
behavior.
Test: Ran supportv7 app
./gradlew checkApi
BUG: 129780800
Change-Id: Idbd97b4ebe0c22ac588340ef3b4369c7c5f4a1bd
M fragment/api/1.1.0-alpha07.txt
M fragment/api/current.txt
M fragment/src/main/java/androidx/fragment/app/BackStackRecord.java
M fragment/src/main/java/androidx/fragment/app/BackStackState.java
M fragment/src/main/java/androidx/fragment/app/FragmentPagerAdapter.java
M fragment/src/main/java/androidx/fragment/app/FragmentStatePagerAdapter.java
M fragment/src/main/java/androidx/fragment/app/FragmentTransaction.java
M samples/Support7Demos/src/main/java/com/example/android/supportv7/app/ToolbarFragmentPagerMenu.java
Description
Compose provides
rememberSaveable
, along with accompanying tools likeSaver
andSaveableStateRegistry
as its mechanisms for storing saved instance state. Currently, there isn't a provided interoperability layer between these tools andSavedStateHandle
.If
SavedStateHandle
isn't used in theViewModel
, state that is hoisted from@Composable
s toViewModel
s won't be stored to saved instance state. This might either cause bugs due to state loss upon process death, or act as a barrier to hoisting state sufficiently if it seems likerememberSaveable
has to be used to remember state across process recreation.The proposal is to provide the necessary hooks for
SavedStateHandle
withSaver
so that any state holder that is being saved viarememberSaveable
could also be saved withSavedStateHandle
.