-
- All Implemented Interfaces:
-
com.ramcosta.composedestinations.spec.RouteOrDirection,com.ramcosta.composedestinations.spec.TypedRoute
public interface TypedDestinationSpec<T extends Object> implements TypedRoute<T>
Defines what a Destination needs to have to be able to be added to a navigation graph and composed on the screen when the user navigates to it.
T is the type of the class that holds all navigation arguments for of this Destination.
-
-
Method Summary
Modifier and Type Method Description abstract UnitContent(DestinationScope<T> $self)Composable function that will be called to compose the destination content in the screen, when the user navigates to it. abstract TargsFrom(Bundle bundle)Method that returns the navigation arguments class of this Composable for the bundle when the destination gets navigated to. abstract TargsFrom(SavedStateHandle savedStateHandle)Method that returns the navigation arguments class of this Composable for the savedStateHandle. TargsFrom(NavBackStackEntry navBackStackEntry)Method that returns the navigation arguments class of this Composable for the navBackStackEntry when the destination gets navigated to. DestinationStylegetStyle()CharSequencegetLabel()abstract StringgetRoute()Full route pattern that will be added to the navigation graph. abstract StringgetBaseRoute()Prefix of the route - basically route without argument info. List<NamedNavArgument>getArguments()List<NavDeepLink>getDeepLinks()-
-
Method Detail
-
Content
@Composable() abstract Unit Content(DestinationScope<T> $self)
Composable function that will be called to compose the destination content in the screen, when the user navigates to it.
-
argsFrom
abstract T argsFrom(Bundle bundle)
Method that returns the navigation arguments class of this Composable for the bundle when the destination gets navigated to.
-
argsFrom
abstract T 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.
-
argsFrom
T argsFrom(NavBackStackEntry navBackStackEntry)
Method that returns the navigation arguments class of this Composable for the navBackStackEntry when the destination gets navigated to.
-
getStyle
DestinationStyle getStyle()
-
getLabel
CharSequence getLabel()
-
getRoute
abstract String getRoute()
Full route pattern that will be added to the navigation graph. Navigation arguments are not filled in.
-
getBaseRoute
abstract String getBaseRoute()
Prefix of the route - basically route without argument info.
-
getArguments
List<NamedNavArgument> getArguments()
-
getDeepLinks
List<NavDeepLink> getDeepLinks()
-
-
-
-