Is there a resource out there to understand how th...
# compose
o
Is there a resource out there to understand how the layout, measurable, placeable, etc stuff work ? I find these things hard to reason about right now
z
Probably the easiest way is to just look at how existing layouts are implemented. The basic algorithm is also pretty much the same as in classic Android views, so the same high-level concepts apply if you've written custom container views before.
k
I'm learning this stuff too, I look at the source of the existing ones. IMO the best one to start is
Spacer
it's the simplest layout out there. and the next one is I think the
Surface
In the earlier versions there was
Container
layout, it's source code was really helpful I learned a lot from that.
1
z
It’s a kinda weird and API and seems complicated at first, but once you get the hang of it, it really maps very cleanly to the underlying concepts and it’s super powerful.
k
Yeah, specially when there is a Layout modifier in the tree it became more complicated.