Sebastian Höbarth
10/08/2022, 5:58 PMAnimatedNavHost
. Navigating from overview to detail screen, the overview has this as exitTransition set. So the current screen should just slide out, although when the transition starts, the UI jumps up and then slides out. I can’t figure out where this Jump originates. Does someone have a similar problem and can pinpoint me in the direction what I’m doing wrong? (Attached a video in the thread)
exitTransition = {
when (targetState.destination.route) {
DetailDestination.route -> slideOutOfContainer(
AnimatedContentScope.SlideDirection.Left,
animationSpec = tween(600)
)
else -> null
}
},
Sebastian Höbarth
10/08/2022, 5:59 PMOleksandr Balan
10/09/2022, 6:00 AMnlindberg
10/09/2022, 8:46 AM@Composable
fun BottomMenu(selectedScreen: ContentScreen, navigationActions: NavigationActions) {
val show = selectedScreen in ContentScreen.bottomMenuScreens
val size by animateDpAsState(if (show) 60.dp else 0.dp, animationSpec = tween(300, 300))
Column (
Modifier
.height(size)
Maybe it can be helpfull for you.Sebastian Höbarth
10/09/2022, 9:16 AMAnimateVisibility
of the BottomBar
in the Scaffold
, the BottomBar
is stuck at the top of the screen when navigating back with Compose Version 1.3.0-beta03
(@nlindberg thanks, the delay does the trick for the recompose screen jump)
bottomBar = {
AnimatedVisibility(
appState.shouldShowBottomBar,
enter = fadeIn(tween(300, 300)) + expandIn(tween(300, 300)),
exit = shrinkOut(tween(300, 300)) + fadeOut(tween(300, 300))
) {
BottomBar(
destinations = appState.topLevelDestinations,
onNavigateToDestination = appState::navigate,
currentDestination = appState.currentDestination
)
}
},
nlindberg
10/09/2022, 9:20 AMSebastian Höbarth
10/09/2022, 9:27 AMenter = slideInVertically(tween(300, 300), initialOffsetY = { it }),
exit = slideOutVertically(tween(300, 300), targetOffsetY = { it })
nlindberg
10/09/2022, 9:55 AMSebastian Höbarth
10/09/2022, 10:10 AMPaddingValues
that Scaffold
supply’s added to the NavHost
If I remove .padding(padding) it works. But now I have to make sure in the screens if the BottomBar
is shown that the content of that screen has enough padding to reach above it.
AnimatedNavHost(
navController = appState.navController,
bottomSheetNavigator = appState.bottomSheetNavigator,
showListAndDetail = appState.showListAndDetail,
onNavigateToDestination = appState::navigate,
onBackClick = appState::onBackClick,
onListAndDetailShown = { showNavRailFab = !it },
modifier = Modifier
.padding(padding)
.consumedWindowInsets(padding),
)