NavOptionsBuilder
-
Cmn
@NavOptionsDsl
class NavOptionsBuilder
DSL for constructing a new NavOptions
Summary
Public constructors |
|
|---|---|
|
Cmn
android
|
Public functions |
||
|---|---|---|
Unit |
anim(animBuilder: AnimBuilder.() -> Unit)Sets any custom Animation or Animator resources that should be used. |
android
|
inline Unit |
<T : Any> popUpTo(noinline popUpToBuilder: PopUpToBuilder.() -> Unit)Pop up to a given destination before navigating. |
Cmn
android
|
Unit |
popUpTo(id: @IdRes Int, popUpToBuilder: PopUpToBuilder.() -> Unit)Pop up to a given destination before navigating. |
android
|
Unit |
<T : Any> popUpTo(route: KClass<T>, popUpToBuilder: PopUpToBuilder.() -> Unit)Pop up to a given destination before navigating. |
Cmn
android
|
Unit |
<T : Any> popUpTo(route: T, popUpToBuilder: PopUpToBuilder.() -> Unit)Pop up to a given destination before navigating. |
Cmn
android
|
Unit |
popUpTo(route: String, popUpToBuilder: PopUpToBuilder.() -> Unit)Pop up to a given destination before navigating. |
Cmn
android
|
Public properties |
||
|---|---|---|
Boolean |
Whether this navigation action should launch as single-top (i.e., there will be at most one copy of a given destination on the top of the back stack). |
Cmn
android
|
Int |
This property is deprecated. Use the popUpToId property. |
android
|
@IdRes Int |
Returns the current destination that the builder will pop up to. |
android
|
String? |
The destination to pop up to before navigating. |
Cmn
android
|
KClass<*>? |
The destination to pop up to before navigating. |
Cmn
android
|
Any? |
The destination to pop up to before navigating. |
Cmn
android
|
Boolean |
Whether this navigation action should restore any state previously saved by |
Cmn
android
|
Public constructors
Public functions
anim
fun anim(animBuilder: AnimBuilder.() -> Unit): Unit
Sets any custom Animation or Animator resources that should be used.
Note: Animator resources are not supported for navigating to a new Activity
popUpTo
inline fun <T : Any> popUpTo(noinline popUpToBuilder: PopUpToBuilder.() -> Unit = {}): Unit
Pop up to a given destination before navigating. This pops all non-matching destination routes from the back stack until the destination with a matching route is found.
| Parameters | |
|---|---|
<T : Any> |
route from a |
noinline popUpToBuilder: PopUpToBuilder.() -> Unit = {} |
builder used to construct a popUpTo operation |
popUpTo
fun popUpTo(id: @IdRes Int, popUpToBuilder: PopUpToBuilder.() -> Unit = {}): Unit
Pop up to a given destination before navigating. This pops all non-matching destinations from the back stack until this destination is found.
popUpTo
fun <T : Any> popUpTo(route: KClass<T>, popUpToBuilder: PopUpToBuilder.() -> Unit): Unit
Pop up to a given destination before navigating. This pops all non-matching destination routes from the back stack until the destination with a matching route is found.
| Parameters | |
|---|---|
route: KClass<T> |
|
popUpToBuilder: PopUpToBuilder.() -> Unit |
builder used to construct a popUpTo operation |
popUpTo
fun <T : Any> popUpTo(route: T, popUpToBuilder: PopUpToBuilder.() -> Unit = {}): Unit
Pop up to a given destination before navigating. This pops all non-matching destination routes from the back stack until the destination with a matching route is found.
| Parameters | |
|---|---|
route: T |
route from a Object for the destination |
popUpToBuilder: PopUpToBuilder.() -> Unit = {} |
builder used to construct a popUpTo operation |
popUpTo
fun popUpTo(route: String, popUpToBuilder: PopUpToBuilder.() -> Unit = {}): Unit
Pop up to a given destination before navigating. This pops all non-matching destination routes from the back stack until the destination with a matching route is found.
| Parameters | |
|---|---|
route: String |
route for the destination |
popUpToBuilder: PopUpToBuilder.() -> Unit = {} |
builder used to construct a popUpTo operation |
Public properties
launchSingleTop
var launchSingleTop: Boolean
Whether this navigation action should launch as single-top (i.e., there will be at most one copy of a given destination on the top of the back stack).
This functions similarly to how android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP works with activities.
popUpTo
var popUpTo: Int
The destination to pop up to before navigating. All non-matching destinations from the back stack up until this destination will also be popped.
popUpToId
val popUpToId: @IdRes Int
Returns the current destination that the builder will pop up to.
popUpToRoute
val popUpToRoute: String?
The destination to pop up to before navigating. All non-matching destinations from the back stack up until this destination will also be popped.
popUpToRouteClass
val popUpToRouteClass: KClass<*>?
The destination to pop up to before navigating. All non-matching destinations from the back stack up until this destination will also be popped.
popUpToRouteObject
val popUpToRouteObject: Any?
The destination to pop up to before navigating. All non-matching destinations from the back stack up until this destination will also be popped.
restoreState
var restoreState: Boolean
Whether this navigation action should restore any state previously saved by PopUpToBuilder.saveState or the popUpToSaveState attribute. If no state was previously saved with the destination ID being navigated to, this has no effect.