NavOptions

class NavOptions
kotlin.Any
   ↳ androidx.navigation.NavOptions

NavOptions stores special options for navigate actions

Summary

Nested classes

Builder for constructing new instances of NavOptions.

Public methods

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.

Int

The destination to pop up to before navigating.

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

Public methods

getEnterAnim

@AnimRes @AnimatorRes fun getEnterAnim(): Int

The custom enter Animation/Animator that should be run.

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

getExitAnim

@AnimRes @AnimatorRes fun getExitAnim(): Int

The custom exit Animation/Animator that should be run.

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

getPopEnterAnim

@AnimRes @AnimatorRes fun getPopEnterAnim(): Int

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

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

getPopExitAnim

@AnimRes @AnimatorRes fun getPopExitAnim(): Int

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

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

getPopUpTo

@IdRes fun getPopUpTo(): Int

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

Return
Int: the destinationId to pop up to, clearing all intervening destinations

isPopUpToInclusive

fun isPopUpToInclusive(): Boolean

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

shouldLaunchSingleTop

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