Created
March 5, 2023 00:26
-
-
Save fvilarino/550ffb21cd20e98431aaa04bebecd4da to your computer and use it in GitHub Desktop.
Ticker - Ticker Row
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
@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