IsaacMart
10/23/2023, 12:55 PMvide
10/23/2023, 1:27 PMColumn
and a Row
?Column {
Text("text1")
Row(horizontalArrangement = Arrangement.SpaceBetween) {
Text("text2")
Text("text3")
}
Text("text4")
Row(horizontalArrangement = Arrangement.End) {
Text("text6")
}
}
to achieve a similar layoutIsaacMart
10/23/2023, 6:20 PMOleksandr Balan
10/24/2023, 12:25 AMBox
with a background color of the status, which will fill the Card
height. The content height should be set to IntrinsicSize.Min
, so that card is not expanded to the max available height, see intrinsic measurements.
So something like this could do the trick:
@Composable
private fun StatusCard(
statusColor: Color,
modifier: Modifier = Modifier,
content: @Composable () -> Unit
) {
Card(modifier) {
Row(Modifier.height(IntrinsicSize.Min)) {
content()
Box(
modifier = Modifier
.fillMaxHeight()
.width(8.dp)
.background(statusColor)
)
}
}
}
And usage:
StatusCard(Color.Red) {
Text(
text = "Lorem ipsum",
modifier = Modifier.padding(8.dp)
)
}