Skip to content

Commit ae1a12d

Browse files
committed
Don't show paging indicators if only one QR code is available
1 parent 5b611a5 commit ae1a12d

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

app/src/main/java/com/xinto/mauth/ui/screen/export/ExportScreen.kt

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,25 +182,28 @@ private fun BatchExports(
182182
)
183183
}
184184
}
185-
Row(
186-
modifier = Modifier
187-
.fillMaxWidth()
188-
.height(24.dp),
189-
horizontalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterHorizontally),
190-
verticalAlignment = Alignment.CenterVertically
191-
) {
192-
repeat(state.data.size) {
193-
val selectedBackgroundColor = MaterialTheme.colorScheme.primary
194-
val unselectedBackgroundColor = MaterialTheme.colorScheme.secondary
195-
Box(
196-
modifier = Modifier
197-
.drawBehind {
198-
val color = if (pagerState.currentPage == it) selectedBackgroundColor else unselectedBackgroundColor
199-
drawCircle(color)
200-
}
201-
.animateContentSize()
202-
.size(if (pagerState.currentPage == it) 16.dp else 12.dp)
203-
)
185+
if (state.data.size > 1) {
186+
Row(
187+
modifier = Modifier
188+
.fillMaxWidth()
189+
.height(24.dp),
190+
horizontalArrangement = Arrangement.spacedBy(4.dp, Alignment.CenterHorizontally),
191+
verticalAlignment = Alignment.CenterVertically
192+
) {
193+
repeat(state.data.size) {
194+
val selectedBackgroundColor = MaterialTheme.colorScheme.primary
195+
val unselectedBackgroundColor = MaterialTheme.colorScheme.secondary
196+
Box(
197+
modifier = Modifier
198+
.drawBehind {
199+
val color =
200+
if (pagerState.currentPage == it) selectedBackgroundColor else unselectedBackgroundColor
201+
drawCircle(color)
202+
}
203+
.animateContentSize()
204+
.size(if (pagerState.currentPage == it) 16.dp else 12.dp)
205+
)
206+
}
204207
}
205208
}
206209
}

0 commit comments

Comments
 (0)