Register now for Android Dev Summit 2019!

NavOptionsBuilder

class NavOptionsBuilder
kotlin.Any
   ↳ androidx.navigation.NavOptionsBuilder

DSL for constructing a new NavOptions

Summary

Public constructors

DSL for constructing a new NavOptions

Public methods

Unit
anim(animBuilder: AnimBuilder.() -> Unit)

Sets any custom Animation or Animator resources that should be used.

Unit
popUpTo(@IdRes id: Int, popUpToBuilder: PopUpToBuilder.() -> Unit)

Pop up to a given destination before navigating.

Properties

Boolean

Whether this navigation action should launch as single-top (i.

Int

Pop up to a given destination before navigating.

Public constructors

<init>

NavOptionsBuilder()

DSL for constructing a new NavOptions

Public methods

anim

fun anim(animBuilder: AnimBuilder.() -> Unit): Unit

Sets any custom Animation or Animator resources that should be used.

Note: Animator resources are not supported for navigating to a new Activity

popUpTo

fun popUpTo(@IdRes id: Int, popUpToBuilder: PopUpToBuilder.() -> Unit): Unit

Pop up to a given destination before navigating. This pops all non-matching destinations from the back stack until this destination is found.

Properties

launchSingleTop

var launchSingleTop: 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.

popUpTo

var popUpTo: Int

Pop up to a given destination before navigating. This pops all non-matching destinations from the back stack until this destination is found.