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 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> #3
Fixed internally and will be available in navigation 2.6.0-alpha09
na...@google.com <na...@google.com> #4
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
Description
Component used: Navigation Version used: navigation-compose:2.6.0-alpha08 Devices/Android versions reproduced on: Pixel 7 / Android 13
Since upgrading to compose navigation alpha07 (and 8) we are seeing a crash when using a bottom menu.
Attached is a sample project, but the core to recreate this issue is: