ComposableFragmentNavigator

@Navigator.Name(value = "composable")
class ComposableFragmentNavigator : Navigator


This Navigator intercepts the inflation of navigation destinations in a Navigation with Fragment XML file, reusing the android:name field as the fully qualified name of the composable function to use as the contents of the inflated destination.

Internally, this uses a ComposableFragment to implement the reflection call.

Summary

Public constructors

Construct a ComposableFragmentNavigator by retrieving the associated FragmentNavigator from provider.

Public functions

open FragmentNavigator.Destination

Construct a new NavDestination associated with this Navigator.

Inherited functions

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

Navigate to a destination.

open NavDestination?
navigate(
    destination: FragmentNavigator.Destination,
    args: SavedState?,
    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 Unit

Restore any state previously saved in onSaveState.

open SavedState?

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

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

ComposableFragmentNavigator

Added in 2.8.0
ComposableFragmentNavigator(fragmentNavigator: FragmentNavigator)

ComposableFragmentNavigator

Added in 2.8.0
ComposableFragmentNavigator(provider: NavigatorProvider)

Construct a ComposableFragmentNavigator by retrieving the associated FragmentNavigator from provider.

Public functions

createDestination

Added in 2.8.0
open fun createDestination(): FragmentNavigator.Destination

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.

Returns
FragmentNavigator.Destination

a new NavDestination