Is there a way to go through one measure pass in a...
# compose
c
Is there a way to go through one measure pass in a custom layout and then before laying out children, re-measure with a different set of constraints calculated from the first measurement? Essentially I think I'm trying to use
Intrinsics
in a custom layout because I want all my children to be the height of the largest child. Is there an easier way to solve this? I could potentially just use out of the box Layouts + Intrinsics but I'd like to try and solve it with a custom layout.
d
BoxWithConstraints?
m
f
You can use intrinsics to measure how wide your children want to be, then place them based on the width of your largest child. You would offset each child horizontally based on its width and the width of the largest child
c
SubcomposeLayout might be what I need! •
You want to use the size of one child during the composition of the second child.
Perfect.
f
I don't know if it still applies, but
SubcomposeLayout
comes (came) with some performance caveats
👍 1
c
It probably does. I assume it's doing some re-measurement under the hood to achieve that functionality. Thankfully my screen is static and doesn't have any crazy animations with it 🙂