Skip to content

Commit 8d167a8

Browse files
committed
fix: page count
1 parent 3ddb028 commit 8d167a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import to.bitkit.ui.theme.Colors
5151
import to.bitkit.ui.utils.withAccent
5252

5353
private const val LAST_PAGE_INDEX = 3
54+
private const val PAGE_COUNT = LAST_PAGE_INDEX + 1
5455

5556
@Composable
5657
fun OnboardingSlidesScreen(
@@ -61,7 +62,7 @@ fun OnboardingSlidesScreen(
6162
onRestoreClick: () -> Unit,
6263
) {
6364
val scope = rememberCoroutineScope()
64-
val pagerState = rememberPagerState(initialPage = currentTab, pageCount = { 5 })
65+
val pagerState = rememberPagerState(initialPage = currentTab, pageCount = { PAGE_COUNT })
6566

6667
Box(
6768
modifier = Modifier
@@ -129,7 +130,7 @@ fun OnboardingSlidesScreen(
129130
.offset { IntOffset(0, yOffset.roundToPx()) }
130131
.alpha(alpha)
131132
) {
132-
repeat(LAST_PAGE_INDEX + 1) { index ->
133+
repeat(PAGE_COUNT) { index ->
133134
val size by animateDpAsState(
134135
targetValue = if (index == pagerState.currentPage) 10.dp else 7.dp,
135136
animationSpec = tween(durationMillis = 300),

0 commit comments

Comments
 (0)