https://kotlinlang.org logo
#compose
Title
# compose
r

Roar Gronmo

12/09/2019, 2:37 PM
Simple, but still problematic. Before we had
crossAxisAlignment
(and
mainAxisAlignment
) which we could sett to
CrossAxisAlignement.End
( or
MainAxisAlignment.End
) I want to align thos two texts below to the right, how is that done in dev03 ?
Copy code
Column(modifier = Spacing(right = 4.dp) )
{
    Surface(color = Color.Blue) {
        Text(text = "2019.12.09 12:00")
    }
    Surface(color = Color.Red) {
        
        Text(text = "14d 16h 00min")
    }
}
m

matvei

12/09/2019, 3:04 PM
in dev03 the recommended way to set many layout behaviors is to use modifiers
Copy code
Surface(color = Color.Blue, modifier = Gravity.End) {
        Text(text = "2019.12.09 12:00")
    }
This should do the trick
r

Roar Gronmo

12/09/2019, 8:39 PM
l

Louis Pullen-Freilich [G]

12/09/2019, 11:07 PM
Yeah, it's a separate object: https://developer.android.com/reference/kotlin/androidx/ui/layout/Gravity.html Although we should probably link to it from the Row / Column docs