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 | |
---|---|
Boolean | |
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. |
Int |
hashCode() |
Boolean |
Whether the destination set in |
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 |
See Also
hashCode
fun hashCode(): Int
isPopUpToInclusive
fun isPopUpToInclusive(): Boolean
Whether the destination set in getPopUpTo
should be popped from the back stack.
See Also
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.