Layouts should be side effect free, right? How do ...
# compose
z
Layouts should be side effect free, right? How do I then derive state from stuff I calculate in my layout? Do I just use SubcomposeLayout?
My goal is to create a Column like layout that adds spacers between the items, kind of like Arrangement.spacedBy(x) where x is animated.
e
You dont need a custom layout for that do you? Custom arrangement subclass is fine to animate
x
(of which animating x directly in composition is also good enough)
z
I eventually landed on the same conclusion, but I'm not sure how I'd actually do that! Do I launch a coroutine that animates the spacer size from my arrangement? Do I have a callback and store state in compose for the spacers? Feels like I'm on the right track but I'm scared of breaking everything by introducing side effects into the arrangement!