Skip to content
New issue

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

Set color for selected dots for ShiftIndicatorType in Jetpack Compose #181

Open
fachridantm opened this issue Jul 28, 2023 · 0 comments
Open

Comments

@fachridantm
Copy link

Column {
    var pageCount by remember { mutableStateOf(5) }
    val pagerState = rememberPagerState()
    HorizontalPager(
        modifier = Modifier.padding(top = 24.dp),
        pageCount = pageCount,
        contentPadding = PaddingValues(horizontal = 64.dp),
        pageSpacing = 24.dp,
        state = pagerState
    ) {
        PagePlaceholderItem()
    }
    DotsIndicator(
        dotCount = pageCount,
        type = ShiftIndicatorType(dotsGraphic = DotGraphic(color = MaterialTheme.colorScheme.primary)),
        pagerState = pagerState
    )
}

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant