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 ea3e4a52660591921facef1fb9a56ac08c178478
Author: Sanura N'Jaka <sanura@google.com>
Date: Tue Jun 07 17:33:48 2022
Add support for repeated query params in navigation routes
Adding support for repeated query params in
navigation routes that will map to arrays
RelNote: "`NavDeepLink` now supports default values for
arrays, which allows for support for repeated query params
that will map to the argument's array type. `NavType` also
now includes a default method which can be overriden to
combine two parsed values."
Test: deepLinkRepeatedQueryParamsMappedToArray
Fixes: 209977108
Change-Id: Id68c3153e38412add55a8ddef3cd9b1c339677b0
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-common/api/restricted_current.txt
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavType.kt
M navigation/navigation-common/api/public_plus_experimental_current.txt
M navigation/navigation-common/api/current.txt
https://android-review.googlesource.com/2075332
Branch: androidx-main
commit ea3e4a52660591921facef1fb9a56ac08c178478
Author: Sanura N'Jaka <sanura@google.com>
Date: Tue Jun 07 17:33:48 2022
Add support for repeated query params in navigation routes
Adding support for repeated query params in
navigation routes that will map to arrays
RelNote: "`NavDeepLink` now supports default values for
arrays, which allows for support for repeated query params
that will map to the argument's array type. `NavType` also
now includes a default method which can be overriden to
combine two parsed values."
Test: deepLinkRepeatedQueryParamsMappedToArray
Fixes: 209977108
Change-Id: Id68c3153e38412add55a8ddef3cd9b1c339677b0
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-common/api/restricted_current.txt
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavType.kt
M navigation/navigation-common/api/public_plus_experimental_current.txt
M navigation/navigation-common/api/current.txt
il...@google.com <il...@google.com> #3
This has been fixed internally and will be available in Navigation 2.6.0-alpha01.
na...@google.com <na...@google.com> #4
This bug was linked in a change in the following release(s):
androidx.navigation:navigation-common:2.6.0-alpha01
Description
Following conversation here:https://kotlinlang.slack.com/archives/CJLTWPH7S/p1638968657294300
We're working on a "compose new message" screen, whose recipients box might be prefilled. We want to pass these optional recipients (e.g. contact ids) to this screen, ideally with the same format used by our server: example.com/newmessage?to=contact1&to=contact2 , using navigation library routes.
Repeated query params is a common way to pass arrays. It would be nice if navigation routes supported this pattern too. There is also a less common, but more explicit pattern of adding square brackets, e.g. to[]=me&to[]=you - this might be considered as well.