when we want the component to take up as much space as is available (it is the only component of the parent)?
➕ 1
s
Sean McQuillan [G]
05/10/2021, 4:46 PM
I don't know the specific perf between those specific APIs, but reading between the lines you might be alluding to the perf penalty for weights on LinearLayout.
Compose layout never does re-layout to apply weights, so you don't have to worry about similar problems in the Compose system.
👍 1
❤️ 2
a
Adam Powell
05/10/2021, 5:47 PM
+1 to the above,
Modifier.weight
reorders the child element to be measured after any unweighted elements, it is not measured multiple times like LinearLayout can do.
Adam Powell
05/10/2021, 5:49 PM
weight instructs Row/Column to divide remaining space proportionally among weighted child elements after unweighted child elements have been measured. fillMaxSize modifies incoming constraints for a child to set min = max for both width and height.