Skip to content

Instantly share code, notes, and snippets.

@gabrielbmoro
Created March 10, 2023 18:43
Show Gist options
  • Save gabrielbmoro/15926159def87b9d0f81501fe1e89286 to your computer and use it in GitHub Desktop.
Save gabrielbmoro/15926159def87b9d0f81501fe1e89286 to your computer and use it in GitHub Desktop.
AccessibilityArticle5
// 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