Guy Bieber
10/01/2020, 6:55 PMRudolf Tammekivi
10/01/2020, 7:01 PMwith(ColumnScope) { Modifier.weight(1f) }
Guy Bieber
10/01/2020, 7:06 PMRudolf Tammekivi
10/01/2020, 7:11 PMZach Klippenstein (he/him) [MOD]
10/01/2020, 7:16 PMModifier.weight
doesn’t have any effect outside of `Column`/`Row` composables, so this change is probably intended to help prevent using it where it’s pointless.Modifier
parameters, and pass the weight modifier in from wherever the `Column`/`Row` is.Guy Bieber
10/01/2020, 8:11 PMColumn(with(ColumnScope) {Modifier.weight(.15f) }) {}
This does not:
Column(Modifier.weight(.15f)) {}
Zach Klippenstein (he/him) [MOD]
10/01/2020, 9:01 PMColumn(with(ColumnScope) {Modifier.weight(.15f) }) {}
Here the weight
modifier only does something if the parent of this Column
is also a column or row. It doesn’t matter which composable you apply the modifier too, it matters what its parent is.Row {
Column(Modifier.weight(.5f)) { … }
Column(Modifier.weight(.5f)) { … }
}
This gives you two columns which are stacked on top of each other, with whatever size they want to be (that is, the weight modifier has no effect:
Box {
Column(with(ColumnScope) { Modifier.weight(.5f) }) { … }
Column(with(RowScope) { Modifier.weight(.5f) }) { … }
}