Fixed
Status Update
Comments
so...@gmail.com <so...@gmail.com> #2
il...@google.com <il...@google.com> #3
I wanted to make sure this was not a duplicate of
As of right now, I haven't found a way to make this work without still adding the enum to the typemap with a custom NavType and annotating it with @Serializable. But that still does work at least.
I did also try to do this with nullable or non-nullable enums and I experienced the same behavior.
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 5dbad47d38781e8513a884bb88956f85e8c3e586
Author: Clara Fok <clarafok@google.com>
Date: Thu Aug 08 08:46:11 2024
Fix navigration crash with top level enum
Fix the classname parsing for top level Enums so that navigation can correctly identify its enum class to map to a Enum NavType.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 358137294
Relnote: "Fix navigation crash when passing in top level Enum classes as type safe arguments"
Change-Id: I0ba7670109e378668548a47dd6981a5b1a2f5aba
M navigation/navigation-common/src/main/java/androidx/navigation/serialization/NavTypeConverter.kt
M navigation/navigation-common/src/test/java/androidx/navigation/serialization/NavArgumentGeneratorTest.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
https://android-review.googlesource.com/3213680
Branch: androidx-main
commit 5dbad47d38781e8513a884bb88956f85e8c3e586
Author: Clara Fok <clarafok@google.com>
Date: Thu Aug 08 08:46:11 2024
Fix navigration crash with top level enum
Fix the classname parsing for top level Enums so that navigation can correctly identify its enum class to map to a Enum NavType.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 358137294
Relnote: "Fix navigation crash when passing in top level Enum classes as type safe arguments"
Change-Id: I0ba7670109e378668548a47dd6981a5b1a2f5aba
M navigation/navigation-common/src/main/java/androidx/navigation/serialization/NavTypeConverter.kt
M navigation/navigation-common/src/test/java/androidx/navigation/serialization/NavArgumentGeneratorTest.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
ka...@gmail.com <ka...@gmail.com> #5
Fixed and available in the release on Aug 21st.
Description
Version used: 1.0.0-alpha08
Devices/Android versions reproduced on:
Assuming:
- Main Activity has a NavHostFragment, which navigates between Fragment A & Fragment B
- Main activity handles going back with onSupportNavigateUp
- Fragment B has it's own NavHostFragment, which navigated between InnerFragmentB1 & InnerFragmentB2
- Parent NavHostFragment navigates from A -> B (which starts with B1)
- Sub NavHostFragment navigates from B1 -> B2
- Press up: Sub NavHostFragment returns to B1
- Press up: Parent NavHostFragment returns from B to A
What's the proper way of handling these types of situations where we'd like the back button to handle backing out of Inner Fragments first and then Outer Fragments after?
Details here:
Sample Code: