Fixed
Status Update
Comments
kr...@gmail.com <kr...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit a735aaa4d06c90454de772fae5a02f6cbde210b3
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Feb 28 22:58:23 2023
Ensure FragmentNavigator destroys intermediate entries on popUpTo
We need to make sure that when Fragment are destroyed their entries are
also always destroyed.
RelNote: "Fixes a regressions in previous release that caused the wrong
BottomNav menu item to be highlighted when using system back to go
between tabs."
Test: Added FragmentNavigatorTest
Bug: 270447657
Change-Id: I634f6047b7016bcb8b690047605a6f66b2dc1438
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.kt
https://android-review.googlesource.com/2461556
Branch: androidx-main
commit a735aaa4d06c90454de772fae5a02f6cbde210b3
Author: Jeremy Woods <jbwoods@google.com>
Date: Tue Feb 28 22:58:23 2023
Ensure FragmentNavigator destroys intermediate entries on popUpTo
We need to make sure that when Fragment are destroyed their entries are
also always destroyed.
RelNote: "Fixes a regressions in previous release that caused the wrong
BottomNav menu item to be highlighted when using system back to go
between tabs."
Test: Added FragmentNavigatorTest
Bug: 270447657
Change-Id: I634f6047b7016bcb8b690047605a6f66b2dc1438
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
M navigation/navigation-fragment/src/main/java/androidx/navigation/fragment/FragmentNavigator.kt
il...@google.com <il...@google.com> #4
This has been fixed internally and will be available in the Navigation 2.6.0-alpha07
release.
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 96cee05bdb8f61a92e4be00a52b991cfc1ed2f4e
Author: Clara Fok <clarafok@google.com>
Date: Wed Mar 01 12:28:09 2023
Add FragmentNavigator test to assert entry destroyed
Add test to assert that NavBackStackEntry is destroyed after being restored upon recreation/configuration change.
Asserts that the fix on this bug also fixes b/270610768 .
Test: ./gradlew navigation:navigation-fragment
Bug: 270447657
Change-Id: I8874d2dfaa17e560dd2f6d9da54e435494c187d2
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
https://android-review.googlesource.com/2464422
Branch: androidx-main
commit 96cee05bdb8f61a92e4be00a52b991cfc1ed2f4e
Author: Clara Fok <clarafok@google.com>
Date: Wed Mar 01 12:28:09 2023
Add FragmentNavigator test to assert entry destroyed
Add test to assert that NavBackStackEntry is destroyed after being restored upon recreation/configuration change.
Asserts that the fix on this bug also fixes
Test: ./gradlew navigation:navigation-fragment
Bug: 270447657
Change-Id: I8874d2dfaa17e560dd2f6d9da54e435494c187d2
M navigation/navigation-fragment/src/androidTest/java/androidx/navigation/fragment/FragmentNavigatorTest.kt
Description
Version used: 1.0.0-alpha06
Devices/Android versions reproduced on: Android 8.1.0, Samsung Galaxy J5 (I don't think it's device related)
Navigation library doesn't handle deep links properly when there are 2 deep links registered and the second one is an "extension" of the previous one. Let me give a simplified example to make it more clear:
<fragment android:name="com.example.EventFragment">
<argument
android:name="eventId"
app:argType="string" />
<action
android:id="@+id/exhibitorDetails"
app:destination="@id/exhibitorDetails" />
<deepLink app:uri="example://events/{eventId}" />
</fragment>
<activity android:id="@+id/exhibitorDetails"
android:name="com.example.ExhibitorsActivity">
<!-- I know, not a single Activity app. But that's the case. -->
<argument
android:name="exhibitorId"
app:argType="string" />
<deepLink app:uri="example://events/{eventId}/exhibitors/{exhibitorId}" />
</activity>
When I use a link: example://events/event123/exhibitors/exhibitor123 I expect navigation library to navigate to an ExhibitorsActivity. Instead, it navigates to EventFragment. Furthermore, an eventId passed to a fragment is invalid, in this case, it's: "event123/exhibitors/exhibitor123".
I believe it's a bug of regex: in my example, passed link matches both regexes: example://events/{eventId} and example://events/{eventId}/exhibitors/{exhibitorId}.