It's happening now, watch the livestream.

NavOptions

public final class NavOptions
extends Object

java.lang.Object
   ↳ androidx.navigation.NavOptions


NavOptions stores special options for navigate actions

Summary

Nested classes

class NavOptions.Builder

Builder for constructing new instances of NavOptions. 

Public methods

int getEnterAnim()

The custom enter Animation/Animator that should be run.

int getExitAnim()

The custom exit Animation/Animator that should be run.

int getPopEnterAnim()

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

int getPopExitAnim()

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

int getPopUpTo()

The destination to pop up to before navigating.

boolean isPopUpToInclusive()

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

boolean shouldLaunchSingleTop()

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

Inherited methods

Public methods

getEnterAnim

public int getEnterAnim ()

The custom enter Animation/Animator that should be run.

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

getExitAnim

public int getExitAnim ()

The custom exit Animation/Animator that should be run.

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

getPopEnterAnim

public int getPopEnterAnim ()

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.

getPopExitAnim

public int getPopExitAnim ()

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.

getPopUpTo

public int getPopUpTo ()

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

Returns
int the destinationId to pop up to, clearing all intervening destinations

isPopUpToInclusive

public boolean isPopUpToInclusive ()

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

Returns
boolean

shouldLaunchSingleTop

public boolean shouldLaunchSingleTop ()

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 Intent.FLAG_ACTIVITY_SINGLE_TOP works with activites.

Returns
boolean