Код: Выделить всё
Scaffold (
topBar = {
CenterAlignedTopAppBar(
title = {
Text(text = appName)
}
)
},
bottomBar = {
NavigationBar {
BottomNavigationItem().bottomNavigationItems().forEachIndexed { index,
navigationItem ->
NavigationBarItem(
selected = index == navigationSelectedItem,
label = {Text(navigationItem.label)},
icon = {
if (index == navigationSelectedItem) {
Icon(
navigationItem.filledIcon,
contentDescription = navigationItem.label
)
} else {
Icon(
navigationItem.outlinedIcon,
contentDescription = navigationItem.label
)
}
},
onClick = {
navigationSelectedItem = index
navController.navigate(navigationItem.route) {
popUpTo(navController.graph.findStartDestination().id) {
saveState = true
}
launchSingleTop = true
restoreState = true
}
},
)
}
}
},
modifier = Modifier
.windowInsetsPadding(WindowInsets.statusBars)
) {
NavHost(
navController = navController,
startDestination = Screens.Home.route,
modifier = Modifier.padding(paddingValues = it)
) {
composable(
Screens.History.route,
) {
navigationSelectedItem = 0
HistoryScreen(state)
}
composable(
Screens.Home.route,
) {
navigationSelectedItem = 1
HomeScreen(state)
}
composable(
Screens.Reminders.route,
) {
navigationSelectedItem = 2
RemindersScreen(state)
}
}
}
https://imgur.com/LcbwCO7
Я пытался установить выход и вход переходы как составных элементов, так и самого навигационного хоста, но анимация остается. Есть ли у вас какие-либо предложения, как это исправить? Любая помощь будет принята с благодарностью!
Подробнее здесь: https://stackoverflow.com/questions/785 ... transition
Мобильная версия