Anthony
09/14/2021, 7:44 PMRow(
Modifier
.height(IntrinsicSize.Max)
.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
Card(
Modifier
.weight(1f)
.fillMaxHeight()
) {
Text("Hello")
}
Card(
Modifier
.weight(1f)
.fillMaxHeight()
) {
Column() {
Text("hello", textAlign = TextAlign.Center)
Icon(
imageVector = Icons.Default.SafetyDivider,
contentDescription = null,
tint = iBibleYellow
)
}
}
}
Will Shelor
09/15/2021, 4:33 AMAnthony
09/15/2021, 3:23 PMChris Sinco [G]
09/16/2021, 1:51 AMfillMaxHeight
modifiers, and got this result:@Preview(
showBackground = true,
uiMode = Configuration.UI_MODE_NIGHT_YES
)
@Composable
fun Test(
value: String = "Hello"
) {
MyTheme {
Row(
Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
Card(
Modifier.weight(1f)
) {
Text("Hello")
}
Card(
Modifier.weight(1f)
) {
Column {
Text(value, textAlign = TextAlign.Center)
Icon(
imageVector = Icons.Default.SafetyDivider,
contentDescription = null,
)
}
}
}
}
}
value
param to the Composable to test it as a component in a List, which I assume is a use case for this so that the Row height always is set to the tallest content@Preview(
showBackground = true,
uiMode = Configuration.UI_MODE_NIGHT_YES
)
@Composable
fun ListTest() {
MyTheme {
Column(
Modifier.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(16.dp)
) {
Test()
Test("adfsda lkasdj flaskdjf lkasdjf laksdjf asdlkjf alskdjf alsdjf laskdjf aksdfj dsalkjf dsa")
Test()
Test()
Test("asldfjasldkfj lkj dalskfj lsdajf asldkjaf")
}
}
}
Anthony
09/16/2021, 3:47 PM@Preview
@Composable
fun PreviewIntrinsicSizeBlockRowText() {
IBible_TestTheme {
Row(
Modifier
.height(IntrinsicSize.Min)
.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(16.dp)
) {
Card(
Modifier
.weight(1f)
.fillMaxHeight()
) {
Text("Hello")
}
Card(
Modifier
.weight(1f)
.fillMaxHeight()) {
Column() {
repeat(10) {
Text("More content")
}
}
}
}
}
}
Chris Sinco [G]
09/16/2021, 6:11 PM