DynamicIncludeGraphNavigator


@Navigator.Name(value = "include-dynamic")
class DynamicIncludeGraphNavigator : Navigator


Navigator for include-dynamic.

Use it for navigating to NavGraphs contained within a dynamic feature module.

Summary

Nested types

The graph for dynamic-include.

Public constructors

DynamicIncludeGraphNavigator(
    context: Context,
    navigatorProvider: NavigatorProvider,
    navInflater: NavInflater,
    installManager: DynamicInstallManager
)

Public functions

open DynamicIncludeGraphNavigator.DynamicIncludeNavGraph

Construct a new NavDestination associated with this Navigator.

open Unit
navigate(
    entries: List<NavBackStackEntry>,
    navOptions: NavOptions?,
    navigatorExtras: Navigator.Extras?
)

Navigates to a dynamically included graph from a com.android.dynamic-feature module.

open Unit
onRestoreState(savedState: Bundle)

Restore any state previously saved in onSaveState.

open Bundle?

Called to ask for a Bundle representing the Navigator's state.

Inherited functions

From androidx.navigation.Navigator
open NavDestination?
navigate(
    destination: DynamicIncludeGraphNavigator.DynamicIncludeNavGraph,
    args: Bundle?,
    navOptions: NavOptions?,
    navigatorExtras: Navigator.Extras?
)

Navigate to a destination.

open Unit

Indicator that this Navigator is actively being used by a NavController.

open Unit

Informational callback indicating that the given backStackEntry has been affected by a NavOptions.shouldLaunchSingleTop operation.

open Boolean

Attempt to pop this navigator's back stack, performing the appropriate navigation.

open Unit
popBackStack(popUpTo: NavBackStackEntry, savedState: Boolean)

Attempt to pop this navigator's back stack, performing the appropriate navigation.

Inherited properties

From androidx.navigation.Navigator
Boolean

Whether this Navigator is actively being used by a NavController.

NavigatorState

The state of the Navigator is the communication conduit between the Navigator and the NavController that has called onAttach.

Public constructors

DynamicIncludeGraphNavigator

Added in 2.3.0
DynamicIncludeGraphNavigator(
    context: Context,
    navigatorProvider: NavigatorProvider,
    navInflater: NavInflater,
    installManager: DynamicInstallManager
)

Public functions

createDestination

Added in 2.3.0
open fun createDestination(): DynamicIncludeGraphNavigator.DynamicIncludeNavGraph

Construct a new NavDestination associated with this Navigator.

Any initialization of the destination should be done in the destination's constructor as it is not guaranteed that every destination will be created through this method.

open fun navigate(
    entries: List<NavBackStackEntry>,
    navOptions: NavOptions?,
    navigatorExtras: Navigator.Extras?
): Unit

Navigates to a dynamically included graph from a com.android.dynamic-feature module.

Parameters
entries: List<NavBackStackEntry>

destination(s) to navigate to

navOptions: NavOptions?

additional options for navigation

navigatorExtras: Navigator.Extras?

extras unique to your Navigator.

Throws
android.content.res.Resources.NotFoundException

if one of the entries does not have a valid graphResourceName and graphPackage.

kotlin.IllegalStateException

if one of the entries does not have a parent.

See also
navigate

onRestoreState

open fun onRestoreState(savedState: Bundle): Unit

Restore any state previously saved in onSaveState. This will be called before any calls to navigate or popBackStack.

Calls to createDestination should not be dependent on any state restored here as createDestination can be called before the state is restored.

Parameters
savedState: Bundle

The state previously saved

onSaveState

open fun onSaveState(): Bundle?

Called to ask for a Bundle representing the Navigator's state. This will be restored in onRestoreState.