Fixed
Status Update
Comments
ae...@google.com <ae...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit c70e44710c9295c6a9610f92856ac96e84cf90fe
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Tue Oct 20 19:09:31 2020
RestorableStateHolder
RestorableStateHolder allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state. It will be used by the Navigation compose library and is flexible enough to be used by any other similar use case or third party implementation of the navigation pattern. To demonstrate it I integrated it with our existing Crossfade animation component in CrossfadeDemo. This mechanism will also power the saving of the state for items which are no longer visible in LazyColumn to be able to restore item's state like inner LazyRow scroll position when the item with LazyRow would became visible again.
Relnote: New experimental api RestorableStateHolder. It allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state.
Bug: 166586419
Test: new tests in RestorableStateHolderTest
Change-Id: I66884b1e65f716de7936c4fe9e573efc6539b80f
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/CrossfadeDemo.kt
M compose/runtime/runtime-saved-instance-state/api/current.txt
M compose/runtime/runtime-saved-instance-state/api/public_plus_experimental_current.txt
M compose/runtime/runtime-saved-instance-state/api/restricted_current.txt
M compose/runtime/runtime-saved-instance-state/samples/build.gradle
A compose/runtime/runtime-saved-instance-state/samples/src/main/java/androidx/compose/runtime/savedinstancestate/samples/RestorableStateHolderSamples.kt
A compose/runtime/runtime-saved-instance-state/src/androidAndroidTest/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolderTest.kt
A compose/runtime/runtime-saved-instance-state/src/commonMain/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolder.kt
https://android-review.googlesource.com/1425674
Branch: androidx-master-dev
commit c70e44710c9295c6a9610f92856ac96e84cf90fe
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Tue Oct 20 19:09:31 2020
RestorableStateHolder
RestorableStateHolder allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state. It will be used by the Navigation compose library and is flexible enough to be used by any other similar use case or third party implementation of the navigation pattern. To demonstrate it I integrated it with our existing Crossfade animation component in CrossfadeDemo. This mechanism will also power the saving of the state for items which are no longer visible in LazyColumn to be able to restore item's state like inner LazyRow scroll position when the item with LazyRow would became visible again.
Relnote: New experimental api RestorableStateHolder. It allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state.
Bug: 166586419
Test: new tests in RestorableStateHolderTest
Change-Id: I66884b1e65f716de7936c4fe9e573efc6539b80f
M compose/animation/animation/integration-tests/animation-demos/src/main/java/androidx/compose/animation/demos/CrossfadeDemo.kt
M compose/runtime/runtime-saved-instance-state/api/current.txt
M compose/runtime/runtime-saved-instance-state/api/public_plus_experimental_current.txt
M compose/runtime/runtime-saved-instance-state/api/restricted_current.txt
M compose/runtime/runtime-saved-instance-state/samples/build.gradle
A compose/runtime/runtime-saved-instance-state/samples/src/main/java/androidx/compose/runtime/savedinstancestate/samples/RestorableStateHolderSamples.kt
A compose/runtime/runtime-saved-instance-state/src/androidAndroidTest/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolderTest.kt
A compose/runtime/runtime-saved-instance-state/src/commonMain/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolder.kt
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 80d76cf207a41378ec4387e058ee399933dddeb9
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Nov 27 19:08:42 2020
Use RestorableStateHolder in lazy lists
RestorableStateHolder allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state. We use it to save the state for items which are no longer visible in LazyColumn to be able to restore item's state like inner LazyRow scroll position when the item with LazyRow would became visible again.
Bug: 166586419
Test: new demo, new tests in LazyItemStateRestoration
Change-Id: I595a4eb517786b4a4aa30bf65c91399b3de0a510
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyItemStateRestoration.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/runtime/runtime-saved-instance-state/src/commonMain/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolder.kt
https://android-review.googlesource.com/1468223
Branch: androidx-master-dev
commit 80d76cf207a41378ec4387e058ee399933dddeb9
Author: Andrey Kulikov <andreykulikov@google.com>
Date: Fri Nov 27 19:08:42 2020
Use RestorableStateHolder in lazy lists
RestorableStateHolder allows to save the state defined with [savedInstanceState] and [rememberSavedInstanceState] for the subtree before disposing it to make it possible to compose it back next time with the restored state. We use it to save the state for items which are no longer visible in LazyColumn to be able to restore item's state like inner LazyRow scroll position when the item with LazyRow would became visible again.
Bug: 166586419
Test: new demo, new tests in LazyItemStateRestoration
Change-Id: I595a4eb517786b4a4aa30bf65c91399b3de0a510
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/ListDemos.kt
A compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/LazyItemStateRestoration.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt
M compose/runtime/runtime-saved-instance-state/src/commonMain/kotlin/androidx/compose/runtime/savedinstancestate/RestorableStateHolder.kt
Description