@@ -52,10 +52,10 @@ fun NavGraph(
52
52
) {
53
53
composable<NavDestinations .Setup >(
54
54
enterTransition = {
55
- materialSharedAxisXIn(forward = true , slideDistance = slideDistance)
55
+ materialSharedAxisXIn(forward = false , slideDistance = slideDistance)
56
56
},
57
57
exitTransition = {
58
- materialSharedAxisXOut(forward = false , slideDistance = slideDistance)
58
+ materialSharedAxisXOut(forward = true , slideDistance = slideDistance)
59
59
}
60
60
) {
61
61
SetupScreen (
@@ -82,11 +82,19 @@ fun NavGraph(
82
82
) {
83
83
materialSharedAxisXIn(forward = true , slideDistance = slideDistance)
84
84
} else {
85
- materialSharedAxisZIn(forward = true )
85
+ materialSharedAxisZIn(forward = false )
86
86
}
87
87
},
88
88
exitTransition = {
89
- materialSharedAxisZOut(forward = false )
89
+ if (initialState
90
+ .destination
91
+ .route
92
+ ?.endsWith(NavDestinations .Setup .toString()) == true
93
+ ) {
94
+ materialSharedAxisXOut(forward = false , slideDistance = slideDistance)
95
+ } else {
96
+ materialSharedAxisZOut(forward = true )
97
+ }
90
98
}
91
99
) {
92
100
ControlScreen (
@@ -97,7 +105,14 @@ fun NavGraph(
97
105
navController.navigate(NavDestinations .Settings )
98
106
},
99
107
onNavigateToSetup = {
100
- navController.navigate(NavDestinations .Setup )
108
+ navController.navigate(
109
+ route = NavDestinations .Setup ,
110
+ navOptions = navOptions {
111
+ popUpTo(route = NavDestinations .Control ) {
112
+ inclusive = true
113
+ }
114
+ }
115
+ )
101
116
}
102
117
)
103
118
}
0 commit comments