0.1.0
Update dependencies
Added
- New: Add optional
transitionAnimations
parameter toNavHost
@composable functions.
Animations can be overridden withNavHostDefaults.transitionAnimations
or disabled withNavHostTransitionAnimations.noAnimations
.
Default animations are the same as default animations in AndroidX'sNavHost
.
Changed
-
Breaking: Add a
Modifier
parameter tocontent
ofNavDestination
:@InternalNavigationApi public sealed interface ContentDestination<T : BaseRoute> : NavDestination { // other members... public val content: @Composable (route: T, modifier: Modifier) -> Unit }
This change effects
ScreenDestination
andOverlayDestination
as well.
Themodifier
parameter should be passed to thecontent
ofNavDestination
(a.k.a the root@Composable
of the destination), for example:@Immutable @Parcelize data class DetailScreenRoute(val id: String) : NavRoute @JvmField val DetailScreenDestination = ScreenDestination<DetailScreenRoute> { route, modifier -> DetailScreen(modifier = modifier, route = route) } @Composable internal fun DetailScreen(modifier: Modifier, route: DetailScreenRoute) { Scaffold( modifier = modifier, // <--- Pass the modifier to the root @Composable topBar = { /* ... */ }, ) { //* ... */ } }