Fixed
Status Update
Comments
as...@google.com <as...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit d8ae257b1d34561fa4838556c41050b79033a18a
Author: Clara Fok <clarafok@google.com>
Date: Wed Feb 28 12:47:31 2024
DeepLink query params now allow {argName} values for String types
For arguments of NavType<String>, arg values that are in the form of curly braces around argument name is now allowed as valid values. For all other types, this value is still considered as invalid (or absent of argument value).
Internal tests have been updated to reflect this new change. To be precise:
1. NavControllerRouteTest.kt - tests that are setup with absence of value were passing values of {argName} with StringType. Since this is no longer processed as absence of value, StringType has been changed to IntArrayType.
2. NavDeepLinkTest - likewise as NavControllerRouteTest.kt, with additional new test to assert that {argName} is invalid for non-String types.
Test: ./gradlew navigation:navigation-common:cC
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 327274038
Relnote: "Query parameters in DeepLink now allows values in the form of curly braces around argument name (i.e. {argName}) as valid values for string-based NavTypes. This contrasts with before where such a value would be considered invalid (or absence of value) for all types."
Change-Id: I183028e2f77d63158a9a567c43da016722397cb8
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
https://android-review.googlesource.com/2982559
Branch: androidx-main
commit d8ae257b1d34561fa4838556c41050b79033a18a
Author: Clara Fok <clarafok@google.com>
Date: Wed Feb 28 12:47:31 2024
DeepLink query params now allow {argName} values for String types
For arguments of NavType<String>, arg values that are in the form of curly braces around argument name is now allowed as valid values. For all other types, this value is still considered as invalid (or absent of argument value).
Internal tests have been updated to reflect this new change. To be precise:
1. NavControllerRouteTest.kt - tests that are setup with absence of value were passing values of {argName} with StringType. Since this is no longer processed as absence of value, StringType has been changed to IntArrayType.
2. NavDeepLinkTest - likewise as NavControllerRouteTest.kt, with additional new test to assert that {argName} is invalid for non-String types.
Test: ./gradlew navigation:navigation-common:cC
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 327274038
Relnote: "Query parameters in DeepLink now allows values in the form of curly braces around argument name (i.e. {argName}) as valid values for string-based NavTypes. This contrasts with before where such a value would be considered invalid (or absence of value) for all types."
Change-Id: I183028e2f77d63158a9a567c43da016722397cb8
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavDeepLinkTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavDeepLink.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
ju...@google.com <ju...@google.com>
na...@google.com <na...@google.com> #3
Fixed internally and available in navigation 2.8.0-alpha05
Description
Navigation recently added support for actions and mimeTypes inside of deep links.
There is also a new NavDeepLink Kotlin DSL .
While is is not possible to construct an empty NavDeepLink from java, you can do so from the Kotlin DSL and it will throw an IllegalStateException.
We should add a lint check to notify developers that when using the Kotlin DSL a NavDeepLink must have an uri, action, and/or mimetype or it is invalid.