Builder
class Builder
kotlin.Any | |
↳ | androidx.navigation.NavOptions.Builder |
Builder for constructing new instances of NavOptions.
Summary
Public constructors | |
---|---|
<init>() |
Public methods | |
---|---|
NavOptions |
build() |
NavOptions.Builder |
setEnterAnim(@AnimRes @AnimatorRes : Int) Sets a custom Animation or Animator resource for the enter animation. |
NavOptions.Builder |
setExitAnim(@AnimRes @AnimatorRes : Int) Sets a custom Animation or Animator resource for the exit animation. |
NavOptions.Builder |
Launch a navigation target as single-top if you are making a lateral navigation between instances of the same target (e.g. detail pages about similar data items) that should not preserve history. |
NavOptions.Builder |
setPopEnterAnim(@AnimRes @AnimatorRes : Int) Sets a custom Animation or Animator resource for the enter animation when popping off the back stack. |
NavOptions.Builder |
setPopExitAnim(@AnimRes @AnimatorRes : Int) Sets a custom Animation or Animator resource for the exit animation when popping off the back stack. |
NavOptions.Builder |
setPopUpTo(@IdRes : Int, : Boolean) Pop up to a given destination before navigating. |
Public constructors
<init>
Builder()
Public methods
setEnterAnim
@NonNull fun setEnterAnim(@AnimRes @AnimatorRes : Int): NavOptions.Builder
Sets a custom Animation or Animator resource for the enter animation.
Note: Animator resources are not supported for navigating to a new Activity
Parameters | |
---|---|
enterAnim |
Int: Custom animation to run |
Return | |
---|---|
NavOptions.Builder |
this Builder |
See Also
setExitAnim
@NonNull fun setExitAnim(@AnimRes @AnimatorRes : Int): NavOptions.Builder
Sets a custom Animation or Animator resource for the exit animation.
Note: Animator resources are not supported for navigating to a new Activity
Parameters | |
---|---|
exitAnim |
Int: Custom animation to run |
Return | |
---|---|
NavOptions.Builder |
this Builder |
See Also
setLaunchSingleTop
@NonNull fun setLaunchSingleTop(: Boolean): NavOptions.Builder
Launch a navigation target as single-top if you are making a lateral navigation between instances of the same target (e.g. detail pages about similar data items) that should not preserve history.
Parameters | |
---|---|
singleTop |
Boolean: true to launch as single-top |
setPopEnterAnim
@NonNull fun setPopEnterAnim(@AnimRes @AnimatorRes : Int): NavOptions.Builder
Sets a custom Animation or Animator resource for the enter animation when popping off the back stack.
Note: Animator resources are not supported for navigating to a new Activity
Parameters | |
---|---|
popEnterAnim |
Int: Custom animation to run |
Return | |
---|---|
NavOptions.Builder |
this Builder |
See Also
setPopExitAnim
@NonNull fun setPopExitAnim(@AnimRes @AnimatorRes : Int): NavOptions.Builder
Sets a custom Animation or Animator resource for the exit animation when popping off the back stack.
Note: Animator resources are not supported for navigating to a new Activity
Parameters | |
---|---|
popExitAnim |
Int: Custom animation to run |
Return | |
---|---|
NavOptions.Builder |
this Builder |
See Also
setPopUpTo
@NonNull fun setPopUpTo(
@IdRes : Int,
: Boolean
): NavOptions.Builder
Pop up to a given destination before navigating. This pops all non-matching destinations from the back stack until this destination is found.
Parameters | |
---|---|
destinationId |
Int: The destination to pop up to, clearing all intervening destinations. |
inclusive |
Boolean: true to also pop the given destination from the back stack. |
Return | |
---|---|
NavOptions.Builder |
this Builder |