class NavOptions


NavOptions stores special options for navigate actions

Summary

Nested types

Builder for constructing new instances of NavOptions.

Public functions

open operator Boolean
equals(other: Any?)
@IdRes Int

This function is deprecated. Use popUpToId instead.

open Int
Boolean

Whether the destination set in getPopUpTo should be popped from the back stack.

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).

Boolean

Whether the back stack and the state of all destinations between the current destination and popUpToId should be saved for later restoration via Builder.setRestoreState or the restoreState attribute using the same ID as popUpToId (note: this matching ID is true whether isPopUpToInclusive is true or false).

Boolean

Whether this navigation action should restore any state previously saved by Builder.setPopUpTo or the popUpToSaveState attribute.

open String

Public properties

Int

The custom enter Animation/Animator that should be run.

Int

The custom exit Animation/Animator that should be run.

Int

The custom enter Animation/Animator that should be run when this destination is popped from the back stack.

Int

The custom exit Animation/Animator that should be run when this destination is popped from the back stack.

@IdRes Int

The destination to pop up to before navigating.

String?

Route for the destination to pop up to before navigating.

KClass<*>?

Route from a KClass for the destination to pop up to before navigating.

Any?

Route from an Object for the destination to pop up to before navigating.

Public functions

equals

open operator fun equals(other: Any?): Boolean

getPopUpTo

Added in 1.0.0
Deprecated in 2.4.0
fun getPopUpTo(): @IdRes Int

The destination to pop up to before navigating. When set, all non-matching destinations should be popped from the back stack.

Returns
@IdRes Int

the destinationId to pop up to, clearing all intervening destinations

hashCode

open fun hashCode(): Int

isPopUpToInclusive

Added in 1.0.0
fun isPopUpToInclusive(): Boolean

Whether the destination set in getPopUpTo should be popped from the back stack.

shouldLaunchSingleTop

Added in 1.0.0
fun shouldLaunchSingleTop(): 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.

shouldPopUpToSaveState

Added in 2.4.0
fun shouldPopUpToSaveState(): Boolean

Whether the back stack and the state of all destinations between the current destination and popUpToId should be saved for later restoration via Builder.setRestoreState or the restoreState attribute using the same ID as popUpToId (note: this matching ID is true whether isPopUpToInclusive is true or false).

shouldRestoreState

Added in 2.4.0
fun shouldRestoreState(): Boolean

Whether this navigation action should restore any state previously saved by Builder.setPopUpTo or the popUpToSaveState attribute.

toString

open fun toString(): String

Public properties

enterAnim

Added in 1.0.0
val enterAnimInt

The custom enter Animation/Animator that should be run.

Returns
Int

the resource id of a Animation or Animator or -1 if none.

exitAnim

Added in 1.0.0
val exitAnimInt

The custom exit Animation/Animator that should be run.

Returns
Int

the resource id of a Animation or Animator or -1 if none.

popEnterAnim

Added in 1.0.0
val popEnterAnimInt

The custom enter Animation/Animator that should be run when this destination is popped from the back stack.

Returns
Int

the resource id of a Animation or Animator or -1 if none.

popExitAnim

Added in 1.0.0
val popExitAnimInt

The custom exit Animation/Animator that should be run when this destination is popped from the back stack.

Returns
Int

the resource id of a Animation or Animator or -1 if none.

popUpToId

Added in 2.4.0
val popUpToId: @IdRes Int

The destination to pop up to before navigating. When set, all non-matching destinations should be popped from the back stack.

Returns
@IdRes Int

the destinationId to pop up to, clearing all intervening destinations

popUpToRoute

Added in 2.4.0
val popUpToRouteString?

Route for the destination to pop up to before navigating. When set, all non-matching destinations should be popped from the back stack.

Returns
String?

the destination route to pop up to, clearing all intervening destinations

popUpToRouteClass

Added in 2.8.0
val popUpToRouteClassKClass<*>?

Route from a KClass for the destination to pop up to before navigating. When set, all non-matching destinations should be popped from the back stack.

Returns
KClass<*>?

the destination route to pop up to, clearing all intervening destinations

popUpToRouteObject

Added in 2.8.0
val popUpToRouteObjectAny?

Route from an Object for the destination to pop up to before navigating. When set, all non-matching destinations should be popped from the back stack.

Returns
Any?

the destination route to pop up to, clearing all intervening destinations