DynamicNavGraph
class DynamicNavGraph : NavGraph
The NavGraph for dynamic features.
Summary
Public constructors |
The NavGraph for dynamic features.
|
Inherited functions |
|
From class NavDestination
Unit |
addArgument(@NonNull argumentName: String, @NonNull argument: NavArgument)
Sets an argument type for an argument name
|
Unit |
addDeepLink(@NonNull uriPattern: String)
Add a deep link to this destination. Matching Uris sent to NavController#handleDeepLink(Intent) or NavController#navigate(Uri) will trigger navigating to this destination.
In addition to a direct Uri match, the following features are supported:
- Uris without a scheme are assumed as http and https. For example,
www.example.com will match http://www.example.com and https://www.example.com .
- Placeholders in the form of
{placeholder_name} matches 1 or more characters. The String value of the placeholder will be available in the arguments Bundle with a key of the same name. For example, http://www.example.com/users/{id} will match http://www.example.com/users/4 .
- The
.* wildcard can be used to match 0 or more characters.
These Uris can be declared in your navigation XML files by adding one or more <deepLink app:uri="uriPattern" /> elements as a child to your destination.
Deep links added in navigation XML files will automatically replace instances of ${applicationId} with the applicationId of your app. Programmatically added deep links should use Context#getPackageName() directly when constructing the uriPattern.
|
| |