We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In ShiftIndicatorType, How can I change selected item indicator color
The text was updated successfully, but these errors were encountered:
I also faced this problem, and the solution is by creating my own Indicator, maybe you can use mine as a reference:
@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) ) } } }
Usage:
Indicator( dotCount = pagerState.pageCount, currentPage = pagerState.currentPage, dotSpacing = 4.dp, modifier = Modifier .align(Alignment.BottomCenter) .padding(bottom = 8.dp) .height(12.dp) )
Sorry, something went wrong.
No branches or pull requests
In ShiftIndicatorType, How can I change selected item indicator color
The text was updated successfully, but these errors were encountered: