-
- All Implemented Interfaces:
-
com.ramcosta.composedestinations.spec.Direction,com.ramcosta.composedestinations.spec.RouteOrDirection,com.ramcosta.composedestinations.spec.TypedNavGraphSpec,com.ramcosta.composedestinations.spec.TypedNavHostGraphSpec,com.ramcosta.composedestinations.spec.TypedRoute
public interface DirectionNavHostGraphSpec implements TypedNavHostGraphSpec<Unit>, Direction
-
-
Method Summary
Modifier and Type Method Description Directioninvoke(Unit navArgs)Function to get a Direction you can then pass to com.ramcosta.composedestinations.navigation.DestinationsNavigator or to NavController.navigateTo() to safely navigate to this Destination. Directioninvoke()UnitargsFrom(Bundle bundle)Method that returns the navigation arguments class of this Composable for the bundle when the destination gets navigated to. UnitargsFrom(SavedStateHandle savedStateHandle)Method that returns the navigation arguments class of this Composable for the savedStateHandle. UnitgetDefaultStartArgs()StringgetBaseRoute()abstract NavHostAnimatedDestinationStylegetDefaultTransitions()Like TypedNavGraphSpec.defaultTransitions but not nullable since NavHost level graphs must have animations defined (even if they are defined as "No animations") abstract DirectiongetDefaultStartDirection()abstract TypedRoute<Unit>getStartRoute()Start Route of this navigation graph. abstract List<TypedDestinationSpec<?>>getDestinations()All destinations which belong to this navigation graph List<TypedNavGraphSpec<?, ?>>getNestedNavGraphs()abstract StringgetRoute()Full route pattern that will be added to the navigation graph. List<NamedNavArgument>getArguments()List<NavDeepLink>getDeepLinks()-
Methods inherited from class com.ramcosta.composedestinations.spec.TypedNavGraphSpec
argsFrom -
Methods inherited from class com.ramcosta.composedestinations.spec.TypedNavHostGraphSpec
requireGraphArgs, requireGraphArgs, requireGraphArgs -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
invoke
Direction invoke(Unit navArgs)
Function to get a Direction you can then pass to com.ramcosta.composedestinations.navigation.DestinationsNavigator or to NavController.navigateTo() to safely navigate to this Destination.
-
argsFrom
Unit argsFrom(Bundle bundle)
Method that returns the navigation arguments class of this Composable for the bundle when the destination gets navigated to.
-
argsFrom
Unit argsFrom(SavedStateHandle savedStateHandle)
Method that returns the navigation arguments class of this Composable for the savedStateHandle. This is useful when the SavedStateHandle is created with the navigation arguments, for example, inside the ViewModel.
If you're manually creating the ViewModel, use the
AbstractSavedStateViewModelFactoryand pass the NavBackStackEntry.arguments as the second constructor parameter. If you're using something like Hilt, then that is done for you out of the box.
-
getDefaultStartArgs
Unit getDefaultStartArgs()
-
getBaseRoute
String getBaseRoute()
-
getDefaultTransitions
abstract NavHostAnimatedDestinationStyle getDefaultTransitions()
Like TypedNavGraphSpec.defaultTransitions but not nullable since NavHost level graphs must have animations defined (even if they are defined as "No animations")
-
getDefaultStartDirection
abstract Direction getDefaultStartDirection()
-
getStartRoute
abstract TypedRoute<Unit> getStartRoute()
Start Route of this navigation graph.
-
getDestinations
abstract List<TypedDestinationSpec<?>> getDestinations()
All destinations which belong to this navigation graph
-
getNestedNavGraphs
List<TypedNavGraphSpec<?, ?>> getNestedNavGraphs()
-
getRoute
abstract String getRoute()
Full route pattern that will be added to the navigation graph. Navigation arguments are not filled in.
-
getArguments
List<NamedNavArgument> getArguments()
-
getDeepLinks
List<NavDeepLink> getDeepLinks()
-
-
-
-