Raed Ghazal
01/04/2025, 11:47 AMNavGraphBuilder.navigation
and each one contains multiple inner screens, and I can navigate between `navigation`s using a bottom sheet,
the issue is, when ever I have a sub screen open in one of the tabs, and i move to another tab and go back to the first tab, the enterTransition of the screen runs again instead of the enterTransition of the parent tab
I noticed a similar behavior in now in Android
project, check the video to understand the issue betterRaed Ghazal
01/04/2025, 11:49 AMNavHost(
modifier = Modifier.fillMaxSize(),
navController = navController,
startDestination = MainScreenRoute.HomeNavHost,
enterTransition = { fadeIn(animationSpec = tween(200)) },
exitTransition = { fadeOut(animationSpec = tween(200)) },
) {
// todo find a solution for the sliding animation when we're back to the tab
navigation<MainScreenRoute.HomeNavHost>(startDestination = MainScreenRoute.Home) {
composable<MainScreenRoute.Home> {
HomeScreen()
}
composable<MainScreenRoute.ReceiptDetails>(
enterTransition = { slideIntoContainer(AnimatedContentTransitionScope.SlideDirection.Start, tween()) },
popExitTransition = { slideOutOfContainer(AnimatedContentTransitionScope.SlideDirection.End, tween()) },
popEnterTransition = { EnterTransition.None },
exitTransition = { ExitTransition.None },
) {
ReceiptDetailsScreen()
}
}
}
Raed Ghazal
01/04/2025, 11:50 AMReceiptDetails
screen is open, I expect the parent NavHost transitions to run and not the inner composable
transitionRaed Ghazal
01/08/2025, 3:44 PMcalidion
01/08/2025, 4:13 PMRaed Ghazal
01/08/2025, 4:13 PMcalidion
01/08/2025, 4:13 PMenum class PageType(i: Int) {
ChatMain(0x10),
ContactMain(0x20),
AppMain(0x30),
MineMain(0x40),
MineProfile(0x41),
MineKey(0x42),
MineServerIP(0x43),
MineServerPort (0x44)
}
calidion
01/08/2025, 4:14 PMcalidion
01/08/2025, 4:17 PMvar selectedTab by remember { mutableStateOf(TabType.Chats) }
var stacked by remember { mutableStateOf(ContentType.NonStacked) }
var page by remember { mutableStateOf(PageType.MineMain) }
Column(modifier = Modifier.fillMaxSize()) {
TopBar(
selectedTab = selectedTab,
stacked = stacked,
page = page,
updater = { vPage, vStacked ->
stacked = vStacked
page = vPage
}
)
Tabs(
selectedTab = selectedTab,
modifier = Modifier.weight(1f),
page = page,
updater = { vPage, vStacked ->
stacked = vStacked
page = vPage
}
)
BottomBar(
selectedTab = selectedTab,
onClickTab = {
selectedTab = it
stacked = ContentType.NonStacked
page = when(selectedTab) {
TabType.Mine -> PageType.MineMain
TabType.Chats -> PageType.ChatMain
TabType.Contacts -> PageType.ContactMain
TabType.Apps -> PageType.AppMain
}
},
)
}
calidion
01/08/2025, 4:17 PMRaed Ghazal
01/08/2025, 4:18 PMcalidion
01/08/2025, 4:19 PMcalidion
01/08/2025, 4:19 PMcalidion
01/08/2025, 4:20 PMB Kidiga
01/09/2025, 2:06 PMcalidion
01/10/2025, 8:22 AM