Fixed
Status Update
Comments
ra...@gmail.com <ra...@gmail.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 3765621e2b049eaec4f249a7d39ee8d9dde848a8
Author: Clara Fok <clarafok@google.com>
Date: Mon Jun 12 13:43:01 2023
Fix zIndex in NavHost
Currently zIndex is based on currentBackStack size, which causes zIndex ordering issues such as zIndex decreasing instead of increasing while navigating forward with pop. Now zIndex increment/decrement is based on direction of navigaton (forward/backward).
Test: manual test
Bug: 285153947
Change-Id: Ib1c3a329755b2cbec3d28568d03d73e5aa9b9128
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
https://android-review.googlesource.com/2623329
Branch: androidx-main
commit 3765621e2b049eaec4f249a7d39ee8d9dde848a8
Author: Clara Fok <clarafok@google.com>
Date: Mon Jun 12 13:43:01 2023
Fix zIndex in NavHost
Currently zIndex is based on currentBackStack size, which causes zIndex ordering issues such as zIndex decreasing instead of increasing while navigating forward with pop. Now zIndex increment/decrement is based on direction of navigaton (forward/backward).
Test: manual test
Bug: 285153947
Change-Id: Ib1c3a329755b2cbec3d28568d03d73e5aa9b9128
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
jb...@google.com <jb...@google.com>
cl...@google.com <cl...@google.com> #3
Fixed internally and will be available in navigation-compose 2.7.0-beta02
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 62f4fb24bcfb6c77684dad3a33d4a70b22fdf5aa
Author: Clara Fok <clarafok@google.com>
Date: Wed Jun 14 13:15:57 2023
Add screenshot test for NavHost zIndex
Test: ./gradlew navigation:navigation-compose:cC
Bug: 285153947
Change-Id: Id810649107018fcc480cc26a33171a2dded5bdb0
M navigation/navigation-compose/build.gradle
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.kt
https://android-review.googlesource.com/2627217
Branch: androidx-main
commit 62f4fb24bcfb6c77684dad3a33d4a70b22fdf5aa
Author: Clara Fok <clarafok@google.com>
Date: Wed Jun 14 13:15:57 2023
Add screenshot test for NavHost zIndex
Test: ./gradlew navigation:navigation-compose:cC
Bug: 285153947
Change-Id: Id810649107018fcc480cc26a33171a2dded5bdb0
M navigation/navigation-compose/build.gradle
M navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostTest.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.