fix: improve dots indicator layout and enhance image counter visibility in ImageViewerScreen
This commit is contained in:
@@ -242,35 +242,39 @@ fun ImageViewerScreen(
|
||||
.padding(bottom = 32.dp)
|
||||
.navigationBarsPadding()
|
||||
) {
|
||||
// Dots indicator
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.background(
|
||||
Color.Black.copy(alpha = 0.5f),
|
||||
RoundedCornerShape(16.dp)
|
||||
)
|
||||
.padding(horizontal = 12.dp, vertical = 8.dp),
|
||||
horizontalArrangement = Arrangement.spacedBy(6.dp)
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
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)
|
||||
)
|
||||
)
|
||||
// Dots indicator
|
||||
Row(
|
||||
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 ->
|
||||
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) {
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = "${pagerState.currentPage + 1}/${images.size}",
|
||||
color = Color.White,
|
||||
fontSize = 12.sp,
|
||||
modifier = Modifier.padding(start = 4.dp)
|
||||
color = Color.White.copy(alpha = 0.8f),
|
||||
fontSize = 12.sp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user