fix: improve dots indicator layout and enhance image counter visibility in ImageViewerScreen

This commit is contained in:
k1ngsterr1
2026-01-31 19:23:07 +05:00
parent 2c3b34783c
commit 196cc9c4a2

View File

@@ -242,35 +242,39 @@ fun ImageViewerScreen(
.padding(bottom = 32.dp) .padding(bottom = 32.dp)
.navigationBarsPadding() .navigationBarsPadding()
) { ) {
// Dots indicator Column(
Row( horizontalAlignment = Alignment.CenterHorizontally
modifier = Modifier
.background(
Color.Black.copy(alpha = 0.5f),
RoundedCornerShape(16.dp)
)
.padding(horizontal = 12.dp, vertical = 8.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp)
) { ) {
repeat(images.size.coerceAtMost(10)) { index -> // Dots indicator
val isSelected = pagerState.currentPage == index Row(
Box( modifier = Modifier
modifier = Modifier .background(
.size(if (isSelected) 8.dp else 6.dp) Color.Black.copy(alpha = 0.5f),
.clip(CircleShape) RoundedCornerShape(16.dp)
.background( )
if (isSelected) Color.White .padding(horizontal = 12.dp, vertical = 8.dp),
else Color.White.copy(alpha = 0.4f) horizontalArrangement = Arrangement.spacedBy(6.dp)
) ) {
) repeat(images.size.coerceAtMost(10)) { index ->
val isSelected = pagerState.currentPage == index
Box(
modifier = Modifier
.size(if (isSelected) 8.dp else 6.dp)
.clip(CircleShape)
.background(
if (isSelected) Color.White
else Color.White.copy(alpha = 0.4f)
)
)
}
} }
// Показываем счетчик если больше 10 фото // Показываем счетчик под точками если больше 10 фото
if (images.size > 10) { if (images.size > 10) {
Spacer(modifier = Modifier.height(6.dp))
Text( Text(
text = "${pagerState.currentPage + 1}/${images.size}", text = "${pagerState.currentPage + 1}/${images.size}",
color = Color.White, color = Color.White.copy(alpha = 0.8f),
fontSize = 12.sp, fontSize = 12.sp
modifier = Modifier.padding(start = 4.dp)
) )
} }
} }