NavOptions
public final class NavOptions
NavOptions stores special options for navigate actions
Summary
Nested types |
|---|
public final class NavOptions.BuilderBuilder for constructing new instances of NavOptions. |
Public methods |
|
|---|---|
boolean |
|
final @AnimatorRes @AnimRes int |
The custom enter Animation/Animator that should be run. |
final @AnimatorRes @AnimRes int |
The custom exit Animation/Animator that should be run. |
final @AnimatorRes @AnimRes int |
The custom enter Animation/Animator that should be run when this destination is popped from the back stack. |
final @AnimatorRes @AnimRes int |
The custom exit Animation/Animator that should be run when this destination is popped from the back stack. |
final @IdRes int |
This method is deprecated. Use popUpToId instead. |
final @IdRes int |
The destination to pop up to before navigating. |
final String |
Route for the destination to pop up to before navigating. |
final KClass<@NonNull ?> |
Route from a |
final Object |
Route from an Object for the destination to pop up to before navigating. |
int |
hashCode() |
final boolean |
Whether the destination set in |
final 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). |
final boolean |
Whether the back stack and the state of all destinations between the current destination and |
final boolean |
Whether this navigation action should restore any state previously saved by |
@NonNull String |
toString() |
Public methods
getEnterAnim
public final @AnimatorRes @AnimRes int getEnterAnim()
The custom enter Animation/Animator that should be run.
| Returns | |
|---|---|
@AnimatorRes @AnimRes int |
the resource id of a Animation or Animator or -1 if none. |
getExitAnim
public final @AnimatorRes @AnimRes int getExitAnim()
The custom exit Animation/Animator that should be run.
| Returns | |
|---|---|
@AnimatorRes @AnimRes int |
the resource id of a Animation or Animator or -1 if none. |
getPopEnterAnim
public final @AnimatorRes @AnimRes int getPopEnterAnim()
The custom enter Animation/Animator that should be run when this destination is popped from the back stack.
| Returns | |
|---|---|
@AnimatorRes @AnimRes int |
the resource id of a Animation or Animator or -1 if none. |
getPopExitAnim
public final @AnimatorRes @AnimRes int getPopExitAnim()
The custom exit Animation/Animator that should be run when this destination is popped from the back stack.
| Returns | |
|---|---|
@AnimatorRes @AnimRes int |
the resource id of a Animation or Animator or -1 if none. |
public final @IdRes intgetPopUpTo()
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 |
getPopUpToId
public final @IdRes int getPopUpToId()
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 |
getPopUpToRoute
public final String getPopUpToRoute()
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 |
getPopUpToRouteClass
public final KClass<@NonNull ?> getPopUpToRouteClass()
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.
getPopUpToRouteObject
public final Object getPopUpToRouteObject()
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 | |
|---|---|
Object |
the destination route to pop up to, clearing all intervening destinations |
isPopUpToInclusive
public final boolean isPopUpToInclusive()
Whether the destination set in popUpToRoute should be popped from the back stack.
| See also | |
|---|---|
setPopUpTo |
|
popUpToRoute |
shouldLaunchSingleTop
public final 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 android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP works with activities.
shouldPopUpToSaveState
public final boolean shouldPopUpToSaveState()
Whether the back stack and the state of all destinations between the current destination and popUpToRoute should be saved for later restoration via Builder.setRestoreState or the restoreState attribute using the same ID as popUpToRoute (note: this matching ID is true if isPopUpToInclusive is true. If isPopUpToInclusive is false, this matching ID is the id of the last destination that is popped).
shouldRestoreState
public final boolean shouldRestoreState()
Whether this navigation action should restore any state previously saved by Builder.setPopUpTo or the popUpToSaveState attribute.