NavGraphBuilder

public class NavGraphBuilder extends NavDestinationBuilder

Known direct subclasses

DSL for constructing a new NavGraph

Summary

Public fields

final int

The destination's unique ID.

final @Nullable CharSequence

The descriptive label of the destination

final @NonNull NavigatorProvider

The NavGraphBuilder's NavigatorProvider.

final @Nullable String

The destination's unique route.

Public constructors

NavGraphBuilder(
    @NonNull NavigatorProvider provider,
    @IdRes int id,
    @IdRes int startDestination
)

DSL for constructing a new NavGraph

NavGraphBuilder(
    @NonNull NavigatorProvider provider,
    @NonNull String startDestination,
    @Nullable String route
)

DSL for constructing a new NavGraph

Public methods

final void

Add the destination to the NavGraphBuilder

@NonNull NavGraph

Build the NavDestination by calling Navigator.createDestination.

final void
<D extends NavDestination> destination(
    @NonNull NavDestinationBuilder<@NonNull D> navDestination
)

Build and add a new destination to the NavGraphBuilder

final void

Adds this destination to the NavGraphBuilder

Extension functions

final void

This method is deprecated. Use routes to build your ActivityDestination instead

final void

Construct a new ActivityNavigator.Destination

final void

This method is deprecated. Use routes to create your DialogFragmentDestination instead

final void

This method is deprecated. Use routes to create your DialogFragmentDestination instead

final void

Construct a new DialogFragmentNavigator.Destination

final void

Construct a new DialogFragmentNavigator.Destination

final void
<F extends Fragment> FragmentNavigatorDestinationBuilderKt.fragment(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id
)

This method is deprecated. Use routes to create your FragmentDestination instead

final void
<F extends Fragment> FragmentNavigatorDestinationBuilderKt.fragment(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id,
    @NonNull Function1<@NonNull FragmentNavigatorDestinationBuilderUnit> builder
)

This method is deprecated. Use routes to create your FragmentDestination instead

final void

Construct a new FragmentNavigator.Destination

final void

Construct a new FragmentNavigator.Destination

final void
NavGraphBuilderKt.navigation(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id,
    @IdRes int startDestination,
    @NonNull Function1<@NonNull NavGraphBuilderUnit> builder
)

This method is deprecated. Use routes to build your nested NavGraph instead

final void
NavGraphBuilderKt.navigation(
    @NonNull NavGraphBuilder receiver,
    @NonNull String startDestination,
    @NonNull String route,
    @NonNull Function1<@NonNull NavGraphBuilderUnit> builder
)

Construct a nested NavGraph

Inherited methods

From class NavDestinationBuilder
final void
action(
    int actionId,
    @NonNull Function1<@NonNull NavActionBuilderUnit> actionBuilder
)

This method is deprecated. Building NavDestinations using IDs with the Kotlin DSL has been deprecated in favor of using routes.

final void
argument(
    @NonNull String name,
    @NonNull Function1<@NonNull NavArgumentBuilderUnit> argumentBuilder
)

Add a NavArgument to this destination.

final void
deepLink(
    @NonNull Function1<@NonNull NavDeepLinkDslBuilderUnit> navDeepLink
)

Add a deep link to this destination.

final void
deepLink(@NonNull String uriPattern)

Add a deep link to this destination.

Public fields

id

@NonNull
public final int id

The destination's unique ID.

label

@Nullable
public final @Nullable CharSequence label

The descriptive label of the destination

route

@Nullable
public final @Nullable String route

The destination's unique route.

Public constructors

public final NavGraphBuilder(
    @NonNull NavigatorProvider provider,
    @IdRes int id,
    @IdRes int startDestination
)

DSL for constructing a new NavGraph

Parameters
@NonNull NavigatorProvider provider

navigator used to create the destination

@IdRes int id

the graph's unique id

@IdRes int startDestination

the starting destination for this NavGraph

Returns
NavGraphBuilder

the newly created NavGraph

public final NavGraphBuilder(
    @NonNull NavigatorProvider provider,
    @NonNull String startDestination,
    @Nullable String route
)

DSL for constructing a new NavGraph

Parameters
@NonNull NavigatorProvider provider

navigator used to create the destination

@NonNull String startDestination

the starting destination's route for this NavGraph

@Nullable String route

the graph's unique route

Returns
NavGraphBuilder

the newly created NavGraph

Public methods

addDestination

@NonNull
public final void addDestination(@NonNull NavDestination destination)

Add the destination to the NavGraphBuilder

build

@NonNull
public NavGraph build()

Build the NavDestination by calling Navigator.createDestination.

destination

@NonNull
public final void <D extends NavDestination> destination(
    @NonNull NavDestinationBuilder<@NonNull D> navDestination
)

Build and add a new destination to the NavGraphBuilder

NavGraphBuilderKt.unaryPlus

@NonNull
public final void NavGraphBuilderKt.unaryPlus(@NonNull NavDestination receiver)

Adds this destination to the NavGraphBuilder

Extension functions

ActivityNavigatorDestinationBuilderKt.activity

@NonNull
public final void ActivityNavigatorDestinationBuilderKt.activity(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id,
    @NonNull Function1<@NonNull ActivityNavigatorDestinationBuilderUnit> builder
)

Construct a new ActivityNavigator.Destination

ActivityNavigatorDestinationBuilderKt.activity

@NonNull
public final void ActivityNavigatorDestinationBuilderKt.activity(
    @NonNull NavGraphBuilder receiver,
    @NonNull String route,
    @NonNull Function1<@NonNull ActivityNavigatorDestinationBuilderUnit> builder
)

Construct a new ActivityNavigator.Destination

DialogFragmentNavigatorDestinationBuilderKt.dialog

@NonNull
public final void <F extends DialogFragment> DialogFragmentNavigatorDestinationBuilderKt.dialog(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id
)

Construct a new DialogFragmentNavigator.Destination

Parameters
@IdRes int id

the destination's unique id

DialogFragmentNavigatorDestinationBuilderKt.dialog

@NonNull
public final void <F extends DialogFragment> DialogFragmentNavigatorDestinationBuilderKt.dialog(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id,
    @NonNull Function1<@NonNull DialogFragmentNavigatorDestinationBuilderUnit> builder
)

Construct a new DialogFragmentNavigator.Destination

Parameters
@IdRes int id

the destination's unique id

@NonNull Function1<@NonNull DialogFragmentNavigatorDestinationBuilderUnit> builder

the builder used to construct the fragment destination

DialogFragmentNavigatorDestinationBuilderKt.dialog

@NonNull
public final void <F extends DialogFragment> DialogFragmentNavigatorDestinationBuilderKt.dialog(
    @NonNull NavGraphBuilder receiver,
    @NonNull String route
)

Construct a new DialogFragmentNavigator.Destination

Parameters
@NonNull String route

the destination's unique route

DialogFragmentNavigatorDestinationBuilderKt.dialog

@NonNull
public final void <F extends DialogFragment> DialogFragmentNavigatorDestinationBuilderKt.dialog(
    @NonNull NavGraphBuilder receiver,
    @NonNull String route,
    @NonNull Function1<@NonNull DialogFragmentNavigatorDestinationBuilderUnit> builder
)

Construct a new DialogFragmentNavigator.Destination

Parameters
@NonNull String route

the destination's unique route

@NonNull Function1<@NonNull DialogFragmentNavigatorDestinationBuilderUnit> builder

the builder used to construct the fragment destination

FragmentNavigatorDestinationBuilderKt.fragment

@NonNull
public final void <F extends Fragment> FragmentNavigatorDestinationBuilderKt.fragment(
    @NonNull NavGraphBuilder receiver,
    @IdRes int id
)

Construct a new FragmentNavigator.Destination

Parameters
@IdRes int id

the destination's unique id

<