NavOptionsBuilder



DSL for constructing a new NavOptions

Summary

Public constructors

Cmn
android

Public functions

inline Unit
<T : Any> popUpTo(noinline popUpToBuilder: PopUpToBuilder.() -> Unit)

Pop up to a given destination before navigating.

Cmn
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
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 PopUpToBuilder.saveState or the popUpToSaveState attribute.

Cmn
android

Public constructors

NavOptionsBuilder()
NavOptionsBuilder()

Public functions

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 KClass for the destination

noinline popUpToBuilder: PopUpToBuilder.() -> Unit = {}

builder used to construct a popUpTo operation

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>

the KClass of the destination 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 launchSingleTopBoolean

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.

popUpToRoute

var popUpToRouteString?

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

var popUpToRouteClassKClass<*>?

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

var popUpToRouteObjectAny?

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 restoreStateBoolean

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.