Created
March 10, 2023 18:43
-
-
Save gabrielbmoro/15926159def87b9d0f81501fe1e89286 to your computer and use it in GitHub Desktop.
AccessibilityArticle5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Círculo com suporte pra selecionado e não selecionado | |
@Composable | |
fun Dot(isSelected: Boolean) { | |
Canvas( | |
modifier = Modifier | |
.size(24.dp) | |
.padding(end = 4.dp), | |
onDraw = { | |
val color = if (isSelected) LightBlue else Gray | |
drawCircle(color) | |
} | |
) | |
} | |
// Indicador de páginas | |
@Composable | |
fun PageIndicator(modifier: Modifier = Modifier, amountOfIndicators: Int, step: Int) { | |
Row(modifier = modifier) { | |
repeat(amountOfIndicators) { | |
val isSelected = it <= step | |
Dot(isSelected) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment