Roar Gronmo
12/13/2019, 10:41 PMMaxIntrinsicHeight
and a Column
with ExpandedHeight
wrapping a Container
modifying Gravity.End wraps ExpandedHeight
to achieve "Center End" alignment in the remaining space !!
@Composable
fun CardGravityTest2()
{
Card(
modifier = Spacing(all = 4.dp),
color = Color.LightGray,
shape = RoundedCornerShape(
size = 5.dp
)
){
Column {
MaxIntrinsicHeight {
Row {
Surface(
color = Color.Red,
modifier = Spacing(all = 4.dp)
) {
Text(text = "1 Surface")
}
Column(
modifier = Flexible(
flex = 1f
) wraps Spacing(
all = 4.dp
)
) {
Surface(
color = Color.Green
) {
Text(text = "2 Column mod Flexible wraps Spacing," +
"Surface no mod ")
}
Surface(
color = Color.Magenta
){
Text(text = "3 Surface no mod ")
}
}
Column (modifier = ExpandedHeight) {
Surface(
modifier = Gravity.End,
color = Color.DarkGray
){
Text(text = "4. Col no mod, Srf Gr.end")
}
Container(modifier = Gravity.End wraps ExpandedHeight) {
Surface(
color = Color.Yellow
){
Text(text = "5. Center End !! ")
}
}
}
}
}
}
}
}