accompanist
accompanist copied to clipboard
[Navigation Material] Unexpected transition animation when navigating between BottomSheetNavigator.Destinations
Description When navigating to from one BottomSheetNavigator.Destination to another BottomSheetNavigator.Destination, the current sheet slides down vertically, and the new sheet slides vertically up.
Steps to reproduce
val bottomSheetNavigator = rememberBottomSheetNavigator()
val navController = rememberAnimatedNavController(bottomSheetNavigator)
val scaffoldState = rememberScaffoldState()
ModalBottomSheetLayout(bottomSheetNavigator = bottomSheetNavigator) {
Scaffold(
scaffoldState = scaffoldState,
snackbarHost = { scaffoldState.snackbarHostState }
) {
AnimatedNavHost(navController = navController, startDestination = "home") {
composable("home") {
Button(onClick = {
navController.navigate("firstSheet")
}) {
Text(text = "Show sheet")
}
}
bottomSheet("firstSheet") {
Button(onClick = {
navController.navigate("secondSheet")
}) {
Text(text = "Show second sheet")
}
}
bottomSheet("secondSheet") {
Button(onClick = {
navController.navigate("firstSheet")
}) {
Text(text = "Show first sheet")
}
}
}
}
}
Expected behavior
The documentation for BottomSheetNavigator:
The sheetContent will always host the latest entry of the back stack. When navigating from a BottomSheetNavigator.Destination to another BottomSheetNavigator.Destination, the content of the sheet will be replaced instead of a new bottom sheet being shown.
The way I interprete the documentation, I would expect the content for ModalBottomSheetLayout to be replaced, and not dismissing the sheet and showing a new one whenever I navigate from one BottomSheetNavigator.Destination to another BottomSheetNavigator.Destination.
If this is just the default and only behaviour for showing bottomsheets, I would suggest the NavGraphBuilder.bottomSheet
to support the params enterTransition, exitTransition, (maybe popEnterTransition and popExitTransition) as NavGraphBuilder.composable
@jbw0033 This sounds like a reasonable request to me. It's still blocked by upstream Swipeable work but would be nice to support in the future. WDYT?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
@jossiwolf I agree, that this would be a nice - also as stated in #1176, designers/UX designers are really keen on requesting more fin-grained handling of bottomsheet size/transitions. 🙌
@jossiwolf @jbw0033 I Agree with @MarcLFJ . Please help us by helping satisfy our designers 🥹
@jossiwolf Any news on this issue/request? :)
Hi! Not yet, we are working on more stability improvements for the time being :)
@jossiwolf Is this actually still waiting on dependency
(Potentially the swipeable issue which was fixed not long ago?) or should the label be changed to something else? :)
@jossiwolf any updates on this?
@jossiwolf Any info or timeline for this issue? :)
@jossiwolf Since the https://issuetracker.google.com/issues/167966118 has been fixed, can we expect this to be looked into anytime in the near future?
Apologies, while the main blocker has been fixed, this is not high on our overall list of priorities. We are happy accept design suggestions or contributions though!
With the release of Compose Material 1.7.0-alpha04, the Material team has added a new artifact: androidx.compose.material:material-navigation
, which fully replaces Accompanist Navigation Material.
As such, we are closing all issues here on Accompanist and will be fully deprecating Accompanist Navigation Material in an upcoming release.
A number of issues were fixed as part of the migration, but if you're still seeing an issue, please file an issue with a sample project that reproduces your issue and the Material team will take a look.