@@ -6,6 +6,10 @@ import androidx.activity.compose.setContent
66import androidx.activity.enableEdgeToEdge
77import androidx.compose.animation.ExperimentalSharedTransitionApi
88import androidx.compose.animation.SharedTransitionLayout
9+ import androidx.compose.animation.fadeIn
10+ import androidx.compose.animation.fadeOut
11+ import androidx.compose.animation.slideInHorizontally
12+ import androidx.compose.animation.slideOutHorizontally
913import androidx.compose.runtime.Composable
1014import androidx.compose.runtime.getValue
1115import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
@@ -56,7 +60,14 @@ fun TicTacProNav(
5660
5761 SharedTransitionLayout {
5862 NavHost (navController = navController, startDestination = startDest) {
59- composable<Route .AuthScreen > {
63+ composable<Route .AuthScreen >(
64+ enterTransition = {
65+ slideInHorizontally(initialOffsetX = { it })
66+ },
67+ exitTransition = {
68+ slideOutHorizontally(targetOffsetX = { - it })
69+ }
70+ ) {
6071 val viewModel = viewModel<AuthViewModel > {
6172 AuthViewModel (
6273 TicTacProApp .appModule.userPrefs,
@@ -74,7 +85,7 @@ fun TicTacProNav(
7485 )
7586 }
7687
77- composable<Route .HomeScreen > {
88+ composable<Route .HomeScreen >{
7889 val viewModel = viewModel<HomeViewModel >{
7990 HomeViewModel (
8091 TicTacProApp .appModule.userPrefs,
@@ -126,7 +137,15 @@ fun TicTacProNav(
126137 )
127138 }
128139
129- composable<Route .Game >(typeMap = mapOf (typeOf<Player ?>() to PlayerNavType )) {
140+ composable<Route .Game >(
141+ typeMap = mapOf (typeOf<Player ?>() to PlayerNavType ),
142+ enterTransition = {
143+ slideInHorizontally(initialOffsetX = { it })
144+ },
145+ exitTransition = {
146+ slideOutHorizontally(targetOffsetX = { it })
147+ }
148+ ) {
130149 val args = it.toRoute<Route .Game >()
131150 val viewModel = viewModel<GameViewModel > {
132151 GameViewModel (
@@ -141,6 +160,7 @@ fun TicTacProNav(
141160 gameState = gameState,
142161 onEvent = viewModel::onEvent,
143162 onNavigateBack = { navController.navigateUp() },
163+ isOnlineGame = args.isOnlineGame,
144164 myTurn = args.myTurn
145165 )
146166 }
0 commit comments