Open fachridantm opened 1 year ago
I faced the same problem, I just created my own Indicator
@Composable
fun Indicator(
dotCount: Int,
currentPage: Int,
modifier: Modifier = Modifier,
dotSpacing: Dp = 8.dp,
dotSize: Dp = 12.dp,
) {
Row(
horizontalArrangement = Arrangement.spacedBy(dotSpacing),
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
) {
for (i in 0 until dotCount) {
val isActive = currentPage == i
val color by animateColorAsState(targetValue = if (isActive) Purple else DotIndicatorDefault,
label = ""
)
val width by animateDpAsState(targetValue = if (isActive) dotSize * 3 else dotSize,
label = ""
)
Box(
modifier = Modifier
.width(width)
.height(dotSize)
.clip(CircleShape)
.background(color)
)
}
}
}
this is how we can produce the dots indicator in jetpack compose using ShiftIndicatorType, but why we can't customize the selected dots (e.g for its color, shape, size) like XML did on ShfitIndicatoryType?