Fixed
Status Update
Comments
ra...@gmail.com <ra...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit bade7af890d31f0f4a4b094ff1fd475b24fff95c
Author: jbwoods <jbwoods@google.com>
Date: Mon Feb 25 15:49:05 2019
Fix typo in ActivityNavigator
Both popEnterAnim and popExitAnim were getting the intent extra intended
for popEnterAnim in the applyPopAnimationsToPendingTransition method. Made
popExitAnim get the proper extra.
Test: ran nav test app
BUG: 126237567
Change-Id: Iecdcdd62695f66e1a66eeb5ec84df09c1faaff24
M navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java
https://android-review.googlesource.com/912259
https://goto.google.com/android-sha1/bade7af890d31f0f4a4b094ff1fd475b24fff95c
Branch: androidx-master-dev
commit bade7af890d31f0f4a4b094ff1fd475b24fff95c
Author: jbwoods <jbwoods@google.com>
Date: Mon Feb 25 15:49:05 2019
Fix typo in ActivityNavigator
Both popEnterAnim and popExitAnim were getting the intent extra intended
for popEnterAnim in the applyPopAnimationsToPendingTransition method. Made
popExitAnim get the proper extra.
Test: ran nav test app
BUG: 126237567
Change-Id: Iecdcdd62695f66e1a66eeb5ec84df09c1faaff24
M navigation/runtime/src/main/java/androidx/navigation/ActivityNavigator.java
jb...@google.com <jb...@google.com>
cl...@google.com <cl...@google.com> #3
Fixed for Navigation 1.0.0-rc02
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 5499d88b63726e63900b89d3100be1b3a17b84ce
Author: Clara Fok <clarafok@google.com>
Date: Tue Mar 28 17:00:19 2023
Fix set same graph to replace old destinations
When setting the same graph (exact same routes and destinations but different instances), NavController would keep the original graph but replace the existing graph's nodes with the new graph's nodes. Fix the replace logic to ensure this replacement happens. Also replace backqueue's entry destinations with new instances to ensure the graph and backstack is in sync.
Test: ./gradlew navigation:navigation-compose:cC
Bug: 275258161
Bug: 275407804
Relnote: "When NavController sets the same graph with same route and destinations, it now properly replaces its current graph nodes and its bacstack destinations with new instances."
Change-Id: I5bc582e315578ee53383596070ee3ea4a23aed69
M navigation/navigation-compose/build.gradle
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2512125
Branch: androidx-main
commit 5499d88b63726e63900b89d3100be1b3a17b84ce
Author: Clara Fok <clarafok@google.com>
Date: Tue Mar 28 17:00:19 2023
Fix set same graph to replace old destinations
When setting the same graph (exact same routes and destinations but different instances), NavController would keep the original graph but replace the existing graph's nodes with the new graph's nodes. Fix the replace logic to ensure this replacement happens. Also replace backqueue's entry destinations with new instances to ensure the graph and backstack is in sync.
Test: ./gradlew navigation:navigation-compose:cC
Bug: 275258161
Bug: 275407804
Relnote: "When NavController sets the same graph with same route and destinations, it now properly replaces its current graph nodes and its bacstack destinations with new instances."
Change-Id: I5bc582e315578ee53383596070ee3ea4a23aed69
M navigation/navigation-compose/build.gradle
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
cl...@google.com <cl...@google.com> #5
Fixed internally and will be available navigation 2.6.0-alpha09
na...@google.com <na...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-compose:2.6.0-alpha09
androidx.navigation:navigation-runtime:2.6.0-alpha09
ra...@gmail.com <ra...@gmail.com> #7
It looks good to me. At least, this specific behaviour seems to be fixed.
Description
Component used: Navigation
Version used: 2.6.0-alpha05
Devices/Android versions reproduced on:
Not relevant, it will happen on all.
If this is a bug in the library, we would appreciate it if you could attach: Sample project to trigger the issue.
I'll add a couple of simple kotlin files instead, just use them with any version after 2.6.0-alpha05 navigation dependency and you'll be able to reproduce it.
MainActivity_rook.kt File
If we add destinations directly on "root" (route passed to NavHost call), then this will be the log of the back stack as we navigate:
MainActivity_no_root.kt File
If we add a navigation graph ("home_graph") as the only direct child of "root" and add destinations on that instead, it will work as expected, we'll see this:
This was a breaking change that could introduce bugs for anyone relying on that "root" sent on the NavHost and popping up to that, since after updating navigation it would instead just pop their last screen.