NavigatorProvider

public class NavigatorProvider


A NavigationProvider stores a set of Navigators that are valid ways to navigate to a destination.

Summary

Public constructors

Public methods

final @Nullable Navigator<@NonNull NavDestination>

Register a navigator using the name provided by the Navigator.Name annotation.

@CallSuper @Nullable Navigator<@NonNull NavDestination>
addNavigator(
    @NonNull String name,
    @NonNull Navigator<@NonNull NavDestination> navigator
)

Register a navigator by name.

final @NonNull T
<T extends Navigator<@NonNull ?>> getNavigator(
    @NonNull Class<@NonNull T> navigatorClass
)

Retrieves a registered Navigator using the name provided by the Navigator.Name annotation.

@CallSuper @NonNull T
<T extends Navigator<@NonNull ?>> getNavigator(@NonNull String name)

Retrieves a registered Navigator by name.

Extension functions

final @NonNull NavGraph
DynamicNavGraphBuilderKt.navigation(
    @NonNull NavigatorProvider receiver,
    @IdRes int id,
    @IdRes int startDestination,
    @NonNull Function1<@NonNull DynamicNavGraphBuilderUnit> builder
)

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

final @NonNull NavGraph
DynamicNavGraphBuilderKt.navigation(
    @NonNull NavigatorProvider receiver,
    @NonNull String startDestination,
    @Nullable String route,
    @NonNull Function1<@NonNull DynamicNavGraphBuilderUnit> builder
)

Construct a new DynamicGraphNavigator.DynamicNavGraph

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

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

final @NonNull NavGraph
NavGraphBuilderKt.navigation(
    @NonNull NavigatorProvider receiver,
    @NonNull String startDestination,
    @Nullable String route,
    @NonNull Function1<@NonNull NavGraphBuilderUnit> builder
)

Construct a new NavGraph

final @NonNull T

Retrieves a registered Navigator by name.

final @NonNull T
<T extends Navigator<@NonNull NavDestination>> NavigatorProviderKt.get(
    @NonNull NavigatorProvider receiver,
    @NonNull KClass<@NonNull T> clazz
)

Retrieves a registered Navigator using the name provided by the Navigator.Name annotation.

final void

Register a navigator using the name provided by the Navigator.Name annotation.

final @Nullable Navigator<@NonNull NavDestination>