Now, I have Scaffold wrapping content like this:
@Composable
fun NavWrapper(content: @Composable (PaddingValues) -> Unit = {}) {
Scaffold(
modifier = Modifier,
topBar = {
// ......
},
bottomBar = {
// ......
},
) {
content(it)
}
}
Now I have the following scenes
- HomeScene
- UserScene
- DetailScene
For the first two, NavWrapper needs to be used for wrapping, and the expected effect is that only the middle content will have a switching animation, while the top and bottom do not require animation. For the third one, there is no need for the top and bottom content.
I tried using the following method
NavHost(
navigator = GlobalStore.navigator,
initialRoute = Route.Home,
navTransition = NavFadeTransition()
) {
NavWrapper {
scene(
route = Route.Home,
) {
HomeScene(it)
}
scene(
route = Route.User,
) {
UserScene(it)
}
}
scene(
route = Route.User,
) {
DetailScene()
}
}
But it doesn't work. Is there any support for this? How do I add wrapping content to a scene?
Thanks!
Now, I have
Scaffoldwrapping content like this:Now I have the following scenes
For the first two,
NavWrapperneeds to be used for wrapping, and the expected effect is that only the middle content will have a switching animation, while the top and bottom do not require animation. For the third one, there is no need for the top and bottom content.I tried using the following method
But it doesn't work. Is there any support for this? How do I add wrapping content to a scene?
Thanks!