Skip to content

Commit dca7e78

Browse files
committed
feat: Add slide transitions to onboarding screens
1 parent 8e67ccc commit dca7e78

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

app/src/main/java/to/bitkit/ui/MainActivity.kt

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import to.bitkit.ui.screens.SplashScreen
2323
import to.bitkit.ui.screens.wallets.sheets.NewTransactionSheet
2424
import to.bitkit.ui.theme.AppThemeSurface
2525
import to.bitkit.ui.utils.enableAppEdgeToEdge
26+
import to.bitkit.ui.utils.screenScaleIn
27+
import to.bitkit.ui.utils.screenScaleOut
28+
import to.bitkit.ui.utils.screenSlideIn
29+
import to.bitkit.ui.utils.screenSlideOut
2630
import to.bitkit.viewmodels.ActivityListViewModel
2731
import to.bitkit.viewmodels.AppViewModel
2832
import to.bitkit.viewmodels.BlocktankViewModel
@@ -61,7 +65,12 @@ class MainActivity : ComponentActivity() {
6165
}
6266
)
6367
}
64-
composable<StartupRoutes.Intro> {
68+
composable<StartupRoutes.Intro>(
69+
enterTransition = { screenSlideIn },
70+
exitTransition = { screenScaleOut },
71+
popEnterTransition = { screenScaleIn },
72+
popExitTransition = { screenSlideOut },
73+
) {
6574
IntroScreen(
6675
onStartClick = {
6776
startupNavController.navigate(StartupRoutes.Slides())
@@ -71,7 +80,12 @@ class MainActivity : ComponentActivity() {
7180
},
7281
)
7382
}
74-
composable<StartupRoutes.Slides> { navBackEntry ->
83+
composable<StartupRoutes.Slides>(
84+
enterTransition = { screenSlideIn },
85+
exitTransition = { screenScaleOut },
86+
popEnterTransition = { screenScaleIn },
87+
popExitTransition = { screenSlideOut },
88+
) { navBackEntry ->
7589
val route = navBackEntry.toRoute<StartupRoutes.Slides>()
7690
OnboardingSlidesScreen(
7791
currentTab = route.tab,
@@ -91,7 +105,12 @@ class MainActivity : ComponentActivity() {
91105
onRestoreClick = { startupNavController.navigate(StartupRoutes.Restore) },
92106
)
93107
}
94-
composable<StartupRoutes.Restore> {
108+
composable<StartupRoutes.Restore>(
109+
enterTransition = { screenSlideIn },
110+
exitTransition = { screenScaleOut },
111+
popEnterTransition = { screenScaleIn },
112+
popExitTransition = { screenSlideOut },
113+
) {
95114
RestoreWalletView(
96115
onBackClick = { startupNavController.popBackStack() },
97116
onRestoreClick = { mnemonic, passphrase ->
@@ -109,7 +128,12 @@ class MainActivity : ComponentActivity() {
109128
}
110129
)
111130
}
112-
composable<StartupRoutes.Advanced> {
131+
composable<StartupRoutes.Advanced>(
132+
enterTransition = { screenSlideIn },
133+
exitTransition = { screenScaleOut },
134+
popEnterTransition = { screenScaleIn },
135+
popExitTransition = { screenSlideOut },
136+
) {
113137
CreateWalletWithPassphraseScreen(
114138
onBackClick = { startupNavController.popBackStack() },
115139
onCreateClick = { passphrase ->

app/src/main/java/to/bitkit/ui/screens/SplashScreen.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import androidx.compose.animation.fadeIn
77
import androidx.compose.animation.fadeOut
88
import androidx.compose.foundation.Image
99
import androidx.compose.foundation.background
10-
import androidx.compose.foundation.layout.*
10+
import androidx.compose.foundation.layout.Box
11+
import androidx.compose.foundation.layout.fillMaxSize
12+
import androidx.compose.foundation.layout.wrapContentSize
1113
import androidx.compose.runtime.Composable
1214
import androidx.compose.ui.Alignment
1315
import androidx.compose.ui.Modifier
@@ -22,10 +24,11 @@ fun SplashScreen(isVisible: Boolean = true) {
2224
AnimatedVisibility(
2325
visible = isVisible,
2426
enter = fadeIn(),
25-
exit = fadeOut(animationSpec = tween(
26-
durationMillis = 300,
27-
easing = EaseOut,
28-
)
27+
exit = fadeOut(
28+
animationSpec = tween(
29+
durationMillis = 300,
30+
easing = EaseOut,
31+
)
2932
)
3033
) {
3134
Box(

0 commit comments

Comments
 (0)