Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit cf02f6280164d7b39dfbad059d46bd907c898cd9
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 30 16:40:47 2021
Allow clearing a saved back stack and its state
In addition to the existing saveBackStack(name) and
restoreBackStack(name) APIs, users should be able to
clearBackStack(name) to remove any saved state
associated with a saved back stack as a single
operation.
Test: newly added tests pass
BUG: 189979430
Relnote: "You can now call `clearBackStack(name)` to
clear any state previous saved with `saveBackStack(name)`."
Change-Id: I70cd75a17faffed340424ef0769bd312df9035ae
M fragment/fragment/api/current.txt
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SaveRestoreBackStackTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
https://android-review.googlesource.com/1814304
Branch: androidx-main
commit cf02f6280164d7b39dfbad059d46bd907c898cd9
Author: Ian Lake <ilake@google.com>
Date: Mon Aug 30 16:40:47 2021
Allow clearing a saved back stack and its state
In addition to the existing saveBackStack(name) and
restoreBackStack(name) APIs, users should be able to
clearBackStack(name) to remove any saved state
associated with a saved back stack as a single
operation.
Test: newly added tests pass
BUG: 189979430
Relnote: "You can now call `clearBackStack(name)` to
clear any state previous saved with `saveBackStack(name)`."
Change-Id: I70cd75a17faffed340424ef0769bd312df9035ae
M fragment/fragment/api/current.txt
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/src/androidTest/java/androidx/fragment/app/SaveRestoreBackStackTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentManager.java
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 4525021af55ff373e89d45d0ea4b3e0c5e9aa1af
Author: Ian Lake <ilake@google.com>
Date: Wed Sep 08 13:36:28 2021
Nav: Allow clearing a saved back stack and its state
In addition to saving the back stack (via
popBackStack()/popupTo) and restoring the back stack
(via restoreState), developers should be able to
clearBackStack(), passing in the destination ID or
route associated with a saved back stack.
Test: newly added tests pass
BUG: 189979430
Relnote: "You can now use the `clearBackStack()` method
to clear any state that was saved with `popBackStack()`
or `popUpToSaveState`."
Change-Id: I80a0f7baf982d750383a7db7aa9311b4f8e2a77d
M navigation/navigation-runtime/api/current.txt
M navigation/navigation-runtime/api/public_plus_experimental_current.txt
M navigation/navigation-runtime/api/restricted_current.txt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1822493
Branch: androidx-main
commit 4525021af55ff373e89d45d0ea4b3e0c5e9aa1af
Author: Ian Lake <ilake@google.com>
Date: Wed Sep 08 13:36:28 2021
Nav: Allow clearing a saved back stack and its state
In addition to saving the back stack (via
popBackStack()/popupTo) and restoring the back stack
(via restoreState), developers should be able to
clearBackStack(), passing in the destination ID or
route associated with a saved back stack.
Test: newly added tests pass
BUG: 189979430
Relnote: "You can now use the `clearBackStack()` method
to clear any state that was saved with `popBackStack()`
or `popUpToSaveState`."
Change-Id: I80a0f7baf982d750383a7db7aa9311b4f8e2a77d
M navigation/navigation-runtime/api/current.txt
M navigation/navigation-runtime/api/public_plus_experimental_current.txt
M navigation/navigation-runtime/api/restricted_current.txt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 0b7e9b9845dfa9ae3064d3311d31d8fb9df0fabc
Author: Ian Lake <ilake@google.com>
Date: Wed Sep 08 15:59:35 2021
setGraph() will now also clear saved back stacks
When you call setGraph() a second time with a
different graph, the back stack was popped. Now,
that code also clears all saved back stacks, ensuring
that the state is reset back to where it was as
if the first graph was not ever set.
Test: new NavControllerTest tests pass
BUG: 189979430
Relnote: "Calling `setGraph()` with a new graph
will now also clear any saved back stacks in addition
to its previous behavior of popping the back stack."
Change-Id: I97f96a65efea43d4341c9572c3c1c63f343ab6ed
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/androidTest/res/navigation/nav_start_destination.xml
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1822406
Branch: androidx-main
commit 0b7e9b9845dfa9ae3064d3311d31d8fb9df0fabc
Author: Ian Lake <ilake@google.com>
Date: Wed Sep 08 15:59:35 2021
setGraph() will now also clear saved back stacks
When you call setGraph() a second time with a
different graph, the back stack was popped. Now,
that code also clears all saved back stacks, ensuring
that the state is reset back to where it was as
if the first graph was not ever set.
Test: new NavControllerTest tests pass
BUG: 189979430
Relnote: "Calling `setGraph()` with a new graph
will now also clear any saved back stacks in addition
to its previous behavior of popping the back stack."
Change-Id: I97f96a65efea43d4341c9572c3c1c63f343ab6ed
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/androidTest/res/navigation/nav_start_destination.xml
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
il...@google.com <il...@google.com> #5
We've made two changes:
- Added
clearBackStack()
APIs at both the Fragment and Navigation level, allowing you to manually clear a saved back stack at either level. It is your responsibility for tracking what back stacks exist (but note that both operations are no-ops if the stack does not exist). - When calling
setGraph
with a new (i.e., not the same graph) we now clear all saved back stacks in addition to the existing behavior of popping the entire back stack.
Description
We need a way to clear all the back stacks at once (i.e. when the user logs out)