Updated on 2026-08-14
This commit is contained in:
parent
16fd81429c
commit
a7f095c56d
10 changed files with 292 additions and 45 deletions
|
|
@ -127,6 +127,7 @@ fun TangemPagerIndicator(
|
|||
|
||||
Box(
|
||||
modifier = modifier
|
||||
.width(getSize(totalPages))
|
||||
.conditionalCompose(colors.overlay != null) {
|
||||
colors.overlay?.let { overlay ->
|
||||
background(
|
||||
|
|
@ -170,6 +171,19 @@ fun TangemPagerIndicator(
|
|||
}
|
||||
}
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
@Composable
|
||||
private fun getSize(pageCount: Int): Dp {
|
||||
return when (pageCount) {
|
||||
0 -> TangemTheme.dimens2.x0
|
||||
1 -> TangemTheme.dimens2.x8
|
||||
2 -> TangemTheme.dimens2.x12
|
||||
3 -> TangemTheme.dimens2.x16
|
||||
4 -> TangemTheme.dimens2.x20
|
||||
else -> TangemTheme.dimens2.x24
|
||||
}
|
||||
}
|
||||
|
||||
private fun getWindowBounds(totalPages: Int, currentIndex: Int): Pair<Int, Int> {
|
||||
if (totalPages <= MAX_VISIBLE_DOTS) {
|
||||
return 0 to totalPages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue