Skip to content

Instantly share code, notes, and snippets.

@akwasiio
Created December 13, 2023 13:44
Show Gist options
  • Save akwasiio/77d8d56a089cf4c3fe257e97a31fe790 to your computer and use it in GitHub Desktop.
Save akwasiio/77d8d56a089cf4c3fe257e97a31fe790 to your computer and use it in GitHub Desktop.
A random box I was asked to build lol
@Composable
fun RandomBox() {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier
.height(IntrinsicSize.Min)
.padding(100.dp)
.border(width = 1.dp, shape = RoundedCornerShape(6.dp), color = Color.Gray)
) {
for (i in 1..4) {
Column(
modifier = Modifier.weight(1f),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(text = "q$i")
Divider()
Text(text = if (i % 2 == 0) "35" else "25")
}
if (i < 4) {
Divider(
modifier = Modifier
.fillMaxHeight()
.width(1.dp)
)
}
}
}
}
@Preview(showBackground = true)
@Composable
fun RandomBoxPreview() {
ScreenshotDetectionSandboxTheme {
RandomBox()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment