Skip to content

Instantly share code, notes, and snippets.

@fvilarino
Created March 5, 2023 00:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fvilarino/550ffb21cd20e98431aaa04bebecd4da to your computer and use it in GitHub Desktop.
Save fvilarino/550ffb21cd20e98431aaa04bebecd4da to your computer and use it in GitHub Desktop.
Ticker - Ticker Row
@Composable
fun TickerRow(
// 1
text: String,
// 2
numCells: Int,
modifier: Modifier = Modifier,
textColor: Color = Color.White,
backgroundColor: Color = Color.Black,
fontSize: TextUnit = 96.sp,
horizontalArrangement: Arrangement.Horizontal = Arrangement.spacedBy(8.dp),
) {
// 3
Row(
modifier = modifier,
horizontalArrangement = horizontalArrangement
) {
// 4
repeat(numCells) { index ->
// 5
Ticker(
letter = text.getOrNull(index) ?: ' ',
textColor = textColor,
backgroundColor = backgroundColor,
fontSize = fontSize
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment