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?
Zoltan Demant
04/16/2025, 9:22 AM
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
efemoney
04/16/2025, 6:37 PM
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
Zoltan Demant
04/16/2025, 6:47 PM
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!