Disable exit transition for a single navigation action in Navigation Compose


PROBLEM DESCRIPTION

I’m trying to add a force update screen to my app that imitates a bottom sheet. The force update flow has a separate NavGraphBuilder, so I show it like this:

LaunchedEffect(uiState.isNewUpdateRequired, uiState.showState) { Timber.tag("ForceUpdate").d("uiState changed to: $uiState") if (uiState.isNewUpdateRequired && uiState.showState == NewUpdateSheetState.Show) { navigate(Graph.ForceUpdate) { popUpTo(0) { inclusive = true } launchSingleTop = true } } }

This displays my ForceUpdateScreen correctly, but while the new screen is sliding up with slideInVertically, I can still see the exitTransition of the previous screen, which does not fit this behavior at all.

What I want is for the new screen to slide over the previous one.

ATTEMPTS TO SOLVE

I found that solution but I'm looking for something a bit cleaner:

composable<Route.LoginAuth>( exitTransition = { if(forceUpdateManager.isForceUpdateVisible){ ExitTransition.None } else { exitTransition() }},
0
May 22 at 1:33 PM
User AvatarStanisław Olszak
#android#kotlin#android-jetpack-compose#android-jetpack-navigation

No answer found for this question yet.