Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ import androidx.compose.animation.slideOutHorizontally
import androidx.compose.animation.togetherWith
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.navigation3.runtime.NavKey
import androidx.navigation3.scene.OverlayScene
import androidx.navigation3.scene.Scene
import androidx.navigation3.scene.SinglePaneSceneStrategy
import com.flipcash.app.core.AppRoute
import com.flipcash.app.core.navigation.DeeplinkAction
import com.flipcash.app.core.navigation.asNavBarTab
import com.flipcash.app.core.navigation.LocalTabBarPadding
import com.flipcash.app.internal.ui.AppNavigationBar
import com.flipcash.app.internal.ui.navigation.decorators.rememberNavBlockingOverlayEntryDecorator
Expand Down Expand Up @@ -153,27 +156,38 @@ internal fun NewAppContent(
},
SinglePaneSceneStrategy(),
),
// v2 is tab-centric: switching tabs (replaceAll) crossfades. Sheets/overlays keep
// their own (no) transition; everything else fades too.
// v2 is tab-centric: a forward move that LANDS on a tab home is a tab switch
// (replaceAll between tab homes) and crossfades; any other forward move is a push
// into a detail screen and slides in. Pops always slide back out (a pop is always
// leaving a detail). Sheets/overlays keep their own (no) transition.
transitionSpec = {
if (targetState is OverlayScene<*> || initialState is OverlayScene<*>) {
EnterTransition.None togetherWith ExitTransition.None
} else {
fadeIn(tween(300)) togetherWith fadeOut(tween(300))
val landsOnTab = (codeNavigator.currentRouteKey as? AppRoute)?.asNavBarTab() != null
when {
targetState is OverlayScene<*> || initialState is OverlayScene<*> ->
EnterTransition.None togetherWith ExitTransition.None
landsOnTab ->
fadeIn(tween(300)) togetherWith fadeOut(tween(300))
else ->
slideInHorizontally(initialOffsetX = { it }) togetherWith
slideOutHorizontally(targetOffsetX = { -it })
}
},
popTransitionSpec = {
if (targetState is OverlayScene<*> || initialState is OverlayScene<*>) {
EnterTransition.None togetherWith ExitTransition.None
} else {
fadeIn(tween(300)) togetherWith fadeOut(tween(300))
when {
targetState is OverlayScene<*> || initialState is OverlayScene<*> ->
EnterTransition.None togetherWith ExitTransition.None
else ->
slideInHorizontally(initialOffsetX = { -it }) togetherWith
slideOutHorizontally(targetOffsetX = { it })
}
},
predictivePopTransitionSpec = {
if (targetState is OverlayScene<*> || initialState is OverlayScene<*>) {
EnterTransition.None togetherWith ExitTransition.None
} else {
fadeIn(tween(300)) togetherWith fadeOut(tween(300))
when {
targetState is OverlayScene<*> || initialState is OverlayScene<*> ->
EnterTransition.None togetherWith ExitTransition.None
else ->
slideInHorizontally(initialOffsetX = { -it }) togetherWith
slideOutHorizontally(targetOffsetX = { it })
}
},
onBack = { codeNavigator.navigateBack() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fun WalletScreen() {
viewModel.eventFlow
.filterIsInstance<WalletViewModel.Event.OpenScreen>()
.map { it.screen }
.onEach { navigator.openAsSheet(it) }
.onEach { navigator.push(it) }
.launchIn(this)
}
}
Expand Down
Loading