NavDestinationBuilder
Kotlin
|Java
open class NavDestinationBuilder<out D : NavDestination>
kotlin.Any | |
↳ | androidx.navigation.NavDestinationBuilder |
DSL for constructing a new NavDestination
Summary
Public constructors | |
---|---|
DSL for constructing a new NavDestination |
Public methods | |
---|---|
Unit |
action(: Int, : NavActionBuilder.() -> Unit) Adds a new NavAction to the destination |
Unit |
argument(: String, : NavArgumentBuilder.() -> Unit) Add a NavArgument to this destination. |
open D |
build() Build the NavDestination by calling Navigator.createDestination. |
Unit |
Add a deep link to this destination. |
Unit |
deepLink(: NavDeepLinkDslBuilder.() -> Unit) Add a deep link to this destination. |
Properties | |
---|---|
Int | |
CharSequence? |
The descriptive label of the destination |
Navigator<out D> |
Public constructors
<init>
NavDestinationBuilder(
: Navigator<out D>,
@IdRes : Int)
DSL for constructing a new NavDestination
Public methods
action
fun action(
: Int,
: NavActionBuilder.() -> Unit
): Unit
Adds a new NavAction to the destination
argument
fun argument(
: String,
: NavArgumentBuilder.() -> Unit
): Unit
Add a NavArgument to this destination.
deepLink
fun deepLink(: String): Unit
Add a deep link 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 matchhttp://www.example.com
andhttps://www.example.com
. - Placeholders in the form of
{placeholder_name}
matches 1 or more characters. The Stri