Skip to content

Commit f330ba6

Browse files
committed
chore: remove slide page and update test tag
1 parent 03f27fe commit f330ba6

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

app/src/main/java/to/bitkit/ui/onboarding/OnboardingSlidesScreen.kt

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import to.bitkit.ui.shared.util.screen
4949
import to.bitkit.ui.theme.AppThemeSurface
5050
import to.bitkit.ui.theme.Colors
5151
import to.bitkit.ui.utils.withAccent
52-
52+
private const val LAST_PAGE_INDEX = 3
5353
@Composable
5454
fun OnboardingSlidesScreen(
5555
currentTab: Int = 0,
@@ -90,31 +90,23 @@ fun OnboardingSlidesScreen(
9090
)
9191

9292
2 -> OnboardingTab(
93-
imageResId = R.drawable.spark,
94-
title = stringResource(R.string.onboarding__slide2_header),
95-
titleAccentColor = Colors.Yellow,
96-
text = stringResource(R.string.onboarding__slide2_text),
97-
modifier = Modifier.testTag("Slide2")
98-
)
99-
100-
3 -> OnboardingTab(
10193
imageResId = R.drawable.shield,
10294
title = stringResource(R.string.onboarding__slide3_header),
10395
titleAccentColor = Colors.Green,
10496
text = stringResource(R.string.onboarding__slide3_text),
105-
modifier = Modifier.testTag("Slide3")
97+
modifier = Modifier.testTag("Slide2")
10698
)
10799

108-
4 -> CreateWalletScreen(
100+
LAST_PAGE_INDEX -> CreateWalletScreen(
109101
onCreateClick = onCreateClick,
110102
onRestoreClick = onRestoreClick,
111-
modifier = Modifier.testTag("Slide4")
103+
modifier = Modifier.testTag("Slide$LAST_PAGE_INDEX")
112104
)
113105
}
114106
}
115107

116108
// Dots indicator
117-
val isIndicatorVisible = pagerState.currentPage != 4
109+
val isIndicatorVisible = pagerState.currentPage != LAST_PAGE_INDEX
118110
val yOffset by animateDpAsState(
119111
targetValue = if (isIndicatorVisible) 0.dp else 20.dp,
120112
animationSpec = tween(durationMillis = 300),
@@ -157,7 +149,7 @@ fun OnboardingSlidesScreen(
157149
onBackClick = null,
158150
titleText = null,
159151
actions = {
160-
if (pagerState.currentPage == 4) {
152+
if (pagerState.currentPage == LAST_PAGE_INDEX) {
161153
TextButton(
162154
onClick = onAdvancedSetupClick,
163155
modifier = Modifier.testTag("Passphrase")
@@ -276,7 +268,7 @@ private fun OnboardingViewPreview3() {
276268
private fun OnboardingViewPreview4() {
277269
AppThemeSurface {
278270
OnboardingSlidesScreen(
279-
currentTab = 4,
271+
currentTab = LAST_PAGE_INDEX,
280272
onAdvancedSetupClick = {},
281273
onCreateClick = {},
282274
onRestoreClick = {},

0 commit comments

Comments
 (0)