Lukasz Kalnik
02/19/2025, 10:09 AMColumn
where the two components overlap a bit. When I use offset on the second component, the Column size doesn't wrap the children's height anymore. Is it possible to fix it?Filip Wiesner
02/19/2025, 10:13 AMLukasz Kalnik
02/19/2025, 10:15 AMConstraintLayout
(instead of a Column
). I wonder if the custom layout is more code/more complex code.Filip Wiesner
02/19/2025, 10:21 AMFilip Wiesner
02/19/2025, 10:21 AMLukasz Kalnik
02/19/2025, 10:27 AMLukasz Kalnik
02/19/2025, 10:27 AMFilip Wiesner
02/19/2025, 10:35 AMIn the View system,I don't have any specific argument for why that is; I just always thought that and actually never used it. It's possible that the Google devs didn't want people to default to using Constraint Layout just because that's what they used in the View system. I'm not sure; it just feels more expensive to me, but I don't have any proof or argument against it, if that makes sense. ๐was the recommended way to create large and complex layouts, as a flat view hierarchy was better for performance than nested views are. However, this is not a concern in Compose, which is able to efficiently handle deep layout hierarchies.ConstraintLayout
Lukasz Kalnik
02/19/2025, 10:37 AMLukasz Kalnik
02/19/2025, 10:38 AMAlbert Chang
02/19/2025, 10:39 AMStylianos Gakis
02/19/2025, 10:56 AMColumn {
Whatever()
Whatever()
Column(verticalArrangement = Arrangement.spacedBy(-8.dp)) {
FirstOverlappingThing()
SecondOverlappingThing()
}
Whatever()
}
Lukasz Kalnik
02/19/2025, 10:58 AMFilip Wiesner
02/19/2025, 10:58 AMArrangement
exists ๐
I just use spacers everywhereStylianos Gakis
02/19/2025, 11:06 AMColumn(arrangement..) {
FirstItem()
if (someCondition) {
SecondItem()
}
ThirdItem()
}
Instead of this:
Column(arrangement..) {
if (someCondition) {
FirstItem()
}
if (someCondition2) {
SecondItem()
}
if (someCondition3) {
ThirdItem()
}
}
where you need to do a bunch of if checks left and right to see which permutation of the 3 conditions is true to know when to put or not put a spacer so that you don't add double spaces, or no spaces in the right spotsLukasz Kalnik
02/19/2025, 11:07 AMdividedBy
for dividers.