Google 致力于为黑人社区推动种族平等。查看具体举措

NavGraph

open class NavGraph : NavDestination, MutableIterable<NavDestination!>
kotlin.Any
   ↳ androidx.navigation.NavDestination
   ↳ androidx.navigation.NavGraph

NavGraph is a collection of NavDestination nodes fetchable by ID.

A NavGraph serves as a 'virtual' destination: while the NavGraph itself will not appear on the back stack, navigating to the NavGraph will cause the starting destination to be added to the back stack.

Summary

Public constructors
<init>(@NonNull navGraphNavigator: Navigator<out NavGraph!>)

Construct a new NavGraph.

Public methods
Unit
addAll(@NonNull other: NavGraph)

Add all destinations from another collection to this one.

Unit

Adds a destination to this NavGraph.

Unit

Adds multiple destinations to this NavGraph.

Unit
addDestinations(@NonNull vararg nodes: NavDestination!)

Adds multiple destinations to this NavGraph.

Unit

Clear all destinations from this navigation graph.

NavDestination?
findNode(@IdRes resid: Int)

Finds a destination in the collection by ID.

Int

Returns the starting destination for this NavGraph.

MutableIterator<NavDestination!>

open Unit
onInflate(@NonNull context: Context, @NonNull attrs: AttributeSet)

Unit
remove(@NonNull node: NavDestination)

Remove a given destination from this NavGraph

Unit
setStartDestination(@IdRes startDestId: Int)

Sets the starting destination for this NavGraph.

open String

Inherited functions
Extension functions
From androidx.navigation
operator Boolean