@<Error class: unknown class>
public final class DynamicGraphNavigator extends NavGraphNavigator


Navigator for graphs in dynamic feature modules.

This class handles navigating to a progress destination when the installation of a dynamic feature module is required. By default, the progress destination set by installDefaultProgressDestination will be used, but this can be overridden by setting the app:progressDestinationId attribute in your navigation XML file.

Summary

Nested types

The NavGraph for dynamic features.

Public constructors

DynamicGraphNavigator(
    @NonNull NavigatorProvider navigatorProvider,
    @NonNull DynamicInstallManager installManager
)

Public methods

@NonNull DynamicGraphNavigator.DynamicNavGraph

Create a destination for the DynamicNavGraph.

final void
installDefaultProgressDestination(
    @NonNull Function0<@NonNull NavDestination> progressDestinationSupplier
)

Installs the default progress destination to this graph via a lambda.

void
navigate(
    @NonNull List<@NonNull NavBackStackEntry> entries,
    NavOptions navOptions,
    Navigator.Extras navigatorExtras
)

Navigate to a destination.

void
Bundle

Inherited methods

From androidx.navigation.NavGraphNavigator
From androidx.navigation.Navigator
final @NonNull NavigatorState
final boolean
NavDestination
navigate(
    @NonNull NavGraph destination,
    SavedState args,
    NavOptions navOptions,
    Navigator.Extras navigatorExtras
)
void
void
void
boolean
void
popBackStack(@NonNull NavBackStackEntry popUpTo, boolean savedState)
final void
setAttached(boolean isAttached)

Public constructors

DynamicGraphNavigator

Added in 2.3.0
public DynamicGraphNavigator(
    @NonNull NavigatorProvider navigatorProvider,
    @NonNull DynamicInstallManager installManager
)

Public methods

createDestination

Added in 2.3.0
public @NonNull DynamicGraphNavigator.DynamicNavGraph createDestination()

Create a destination for the DynamicNavGraph.

Returns
@NonNull DynamicGraphNavigator.DynamicNavGraph

The created graph.

installDefaultProgressDestination

public final void installDefaultProgressDestination(
    @NonNull Function0<@NonNull NavDestination> progressDestinationSupplier
)

Installs the default progress destination to this graph via a lambda. This supplies a NavDestination to use when the actual destination is not installed at navigation time.

This must be called before you call androidx.navigation.NavController.setGraph to ensure that all DynamicNavGraph instances have the correct progress destination installed in onRestoreState.

Parameters
@NonNull Function0<@NonNull NavDestination> progressDestinationSupplier

The default progress destination supplier.

public void navigate(
    @NonNull List<@NonNull NavBackStackEntry> entries,
    NavOptions navOptions,
    Navigator.Extras navigatorExtras
)

Navigate to a destination.

In case the destination module is installed the navigation will trigger directly. Otherwise the dynamic feature module is requested and navigation is postponed until the module has successfully been installed.

onRestoreState

public void onRestoreState(@NonNull Bundle savedState)

onSaveState

public Bundle onSaveState()