Fixed
Status Update
Comments
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 9febd8ad6b63dc1738f11d52333e9ca116735a2e
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jan 20 17:25:17 2022
Fix improper destination nesting with deep links
When deeplinking to a destination that has multiple nested nav_graphs,
the handleDeepLink() function will incorrectly remove the start
destinations of the parent NavGraphs when navigating to child graphs of
the parent.
What we really want is that you only pop and save destinations when
navigating to sibling graphs, not child graphs.
RelNote: "Intermediate start destinations will now be present when
deep linking through multiple nested `NavGraph`s."
Bug: 214383060
Test: tested in sample app in bug
Test: verified no regressions for other handleDeepLink cases
Change-Id: I504c04d2cc4381af22405266192ea0f5094f9c16
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1956592
Branch: androidx-main
commit 9febd8ad6b63dc1738f11d52333e9ca116735a2e
Author: Jeremy Woods <jbwoods@google.com>
Date: Thu Jan 20 17:25:17 2022
Fix improper destination nesting with deep links
When deeplinking to a destination that has multiple nested nav_graphs,
the handleDeepLink() function will incorrectly remove the start
destinations of the parent NavGraphs when navigating to child graphs of
the parent.
What we really want is that you only pop and save destinations when
navigating to sibling graphs, not child graphs.
RelNote: "Intermediate start destinations will now be present when
deep linking through multiple nested `NavGraph`s."
Bug: 214383060
Test: tested in sample app in bug
Test: verified no regressions for other handleDeepLink cases
Change-Id: I504c04d2cc4381af22405266192ea0f5094f9c16
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
jb...@google.com <jb...@google.com> #3
This has been fixed internally and will be available in the Navigation 2.5.0-alpha02
and 2.4.1
releases.
wb...@gmail.com <wb...@gmail.com> #4
Here are my observations with two Navigation versions:
2.3.5
-example.com/user/{userName}/details takes me to exampleFragment, not userProfile (incorrect)
- backbutton: correctly takes me back to the QR scanning app which I opened the URL with (correct)
- up button: takes me to leaderboard (correct)
2.4.0
-example.com/user/{userName}/details takes me to userProfile (correct)
- backbutton: takes me back to exampleFragment (incorrect, it should take me back to the qr scanning app)
- up button: takes me back to exampleFragment (incorrect, it should take me back to the leaderboard)
- Does the fix in 2.4.1 fixes both back and up button (when coming from another app). And when navigating using URI from within the app itself, both back or up button are identical and go back to the previous screen (no intermediate startdestinations from nested graphs) ?
- Any idea how we can already test 2.4.1 ?
Thanks
Wim
2.3.5
-
- backbutton: correctly takes me back to the QR scanning app which I opened the URL with (correct)
- up button: takes me to leaderboard (correct)
2.4.0
-
- backbutton: takes me back to exampleFragment (incorrect, it should take me back to the qr scanning app)
- up button: takes me back to exampleFragment (incorrect, it should take me back to the leaderboard)
- Does the fix in 2.4.1 fixes both back and up button (when coming from another app). And when navigating using URI from within the app itself, both back or up button are identical and go back to the previous screen (no intermediate startdestinations from nested graphs) ?
- Any idea how we can already test 2.4.1 ?
Thanks
Wim
jb...@google.com <jb...@google.com> #5
You can follow the
wb...@gmail.com <wb...@gmail.com> #6
Here are my observations with 2.5.0-SNAPSHOT (build id: 8144622)
-example.com/user/{userName}/details takes me to userProfile (correct)
- backbutton: takes me back to other app (correct)
- up button: takes me back to exampleFragment, then Leaderboard (correct, intermediate start destinations are present)
-
- backbutton: takes me back to other app (correct)
- up button: takes me back to exampleFragment, then Leaderboard (correct, intermediate start destinations are present)
Description
Version used: 2.4.0-rc01
Devices/Android versions reproduced on:
Pixel 6 / Android 12
In the example project I have the following nested nav graph structure:
nav_graph{ startDestination=home
home {...}
list { startDestination=leaderboard
leaderboard
exampleNestedGraph { startDestination=exampleFragment
exampleFragment - deepLink="
userProfile - deepLink="
}
}
form {...}
}
Following the deep link:
Then clicking back pops to the exampleFragment
Expected: Clicking back again takes the user to the leaderboard fragment, then clicking back a final time takes the user back to the home fragment.
Actual: Clicking back takes the user to the home fragment, skipping the leaderboard fragment.
I've also updated the bottomNavView_DeepLink_HandlesIntent_BackGoesToList test to test this case
It looks like this was introduced with