This is something that always made struggle also with XML design.
I tried with something like
Scaffold(topBar = ..., bottomBar = ..., ...) {
when (currentScreen) {
...
}
}
Problem is that some screen have fab, some have search bar in topBar, which has actions, etc.
So I change that as
val content @Composable () -> Unit = {
when (currentScreen) {
...
}
}
if (currentScreen.isHomeDestination) {
Scaffold(...) { content() }
else
content()
and it was still looking nice on the UI prospective, but ugly on the code, because some screens will be wrapped in Scaffold, while some will be wrapped somewhere else ( 👆 ),
So I created a custom Scaffold and moved into my screens
@Composable
fun SearchMovie(...) {
HomeScaffold {
...
}
}
But now it looks ugly on the UI, because I open my drawer, but when I select an item it replaces the whole screen, so my drawer disappear without the animation.
What would be the best way to deal with that?