Archie
05/08/2021, 6:06 PMsubcompose(...)
inside SubcomposeLayout(…)
? Is there a good source that dives deep into SubcomposeLayout
? Thanks in advance.Zach Klippenstein (he/him) [MOD]
05/10/2021, 3:44 PMArchie
05/10/2021, 4:21 PMmeasurable.measure(constraint)
the one doing that? or am i completely misunderstanding it? 🤔Zach Klippenstein (he/him) [MOD]
05/10/2021, 4:25 PMmeasure
does the measuring. Compose UI has a number of stages:
1. Composition
2. Measuring
3. Layout (placement)
4. Drawing
Typically, each of these stages happens, in order, completely, before the next stage begins. I.e. your entire UI is composed, which generates the tree of layout nodes. Then, all the layout nodes are measured. Then, all the nodes are placed/layed out. Then finally all the nodes are drawn in the correct places.
SubcomposeLayout
lets you bend the rules a bit, and reorder the first three steps for parts of your subtree.Zach Klippenstein (he/him) [MOD]
05/10/2021, 4:26 PMMeasurable
, the code that created that Measurable
has already been composed – it has to have been, you have to execute composable functions to generate `Measurable`s.Archie
05/10/2021, 5:29 PMsubcompose(..)
the composable function I passed to it gets to be ahead and do, step 1, 2, and 3… ahead of the other composable functions? where normally, all composable function have to go through the steps at the same time? (Really appreciate the explanation, thank you very much)Zach Klippenstein (he/him) [MOD]
05/10/2021, 5:36 PMsubcompose
lets you perform step 1 for some subtree after measuring or even placing other layout nodes (which themselves may have been `subcompose`d later than usual)Zach Klippenstein (he/him) [MOD]
05/10/2021, 5:36 PMArchie
05/11/2021, 5:39 AMBoxWithConstraint
have its constraints available to the content... hmm... last thing I am confuse is how:
it also lets you conditionally compose part of your tree – this is how `LazyList`s workIs it becuase since I know how my parent's size, I could limit how much of the children must be composed, measured and layout?
Zach Klippenstein (he/him) [MOD]
05/11/2021, 1:14 PMLayout
lets you decide not to call place
on certain nodes, which hides their content, but they are still being composed. With subcompose layout you can change what you actually compose on each pass (based on parent size or something else)Archie
05/11/2021, 2:58 PMste
05/12/2021, 8:17 AM