Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Filling in the data
, action
, and mimeType
fields of the Intent
for any usages of NavDeepLinkRequest
makes sense to me.
il...@google.com <il...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 6ac4bffb0f35827a19f761599bb642dbd98e146a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 24 12:10:03 2021
Add intent when navigating with NavDeepLinkRequest
When you navigate with a NavDeepLinkRequest, we should also fill an
intent with the data, action, and type with the values from the
NavDeepLinkRequest, and pass that intent in the arguments of the
resulting destination using KEY_DEEP_LINK_INTENT. That way, the info can
be accessed from the resulting destination.
RelNote: "When navigating using a NavDeepLinkRequest, you can now
access the uri, action, and mimetype in the resulting destination by
getting the intent from arguments via KEY_DEEP_LINK_INTENT."
Bug: 181521877
Test: Adjusted tests in NavControllerTest
Change-Id: Ide575ab7123522da7816c1b219f444173dbfab8d
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/1651033
Branch: androidx-main
commit 6ac4bffb0f35827a19f761599bb642dbd98e146a
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Mar 24 12:10:03 2021
Add intent when navigating with NavDeepLinkRequest
When you navigate with a NavDeepLinkRequest, we should also fill an
intent with the data, action, and type with the values from the
NavDeepLinkRequest, and pass that intent in the arguments of the
resulting destination using KEY_DEEP_LINK_INTENT. That way, the info can
be accessed from the resulting destination.
RelNote: "When navigating using a NavDeepLinkRequest, you can now
access the uri, action, and mimetype in the resulting destination by
getting the intent from arguments via KEY_DEEP_LINK_INTENT."
Bug: 181521877
Test: Adjusted tests in NavControllerTest
Change-Id: Ide575ab7123522da7816c1b219f444173dbfab8d
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
Description
For example, if I had an action defined similarly to the following example:
```
fragment<MyFragment>("my_fragment_dest_id") {
...
argument("my_arg") {
type = NavType.StringType
}
}
```
I would expect to be able to create an action to that destination that provides a default argument, like the following (or something similar).
```
action("my_action_id") {
destinationId = "my_fragment_dest_id"
argument("my_arg") {
defaultValue = "action_provided_default_value"
}
}
}
```
This seems like something that would be important to keep in parity with the functionality provided by the XML navigation graph resource.