Automotive Design for Compose is an extension to Jetpack Compose that allows every screen, component, and overlay of your Android App to be defined in Figma, and lets you see the latest changes to your Figma design in your app, immediately!
While attempting to fix a bug in squoosh's animation support where the root frames of components were not considered for animation, I kept running into layout assertions, which ultimately were because the animation implementation performs destructive mutations on the base layout tree AND on the "transition layout tree".
This change means that all SquooshResolvedNode trees are now immutable after construction (except for layout and style values which can change after the tree was built).
Finally, because the source trees are immutable, we can run layout on the root and target root trees whenever layout needs to change. This means animations are uninterrupted by relayouts, and we can relayout as many times as we like without generating new trees.
While attempting to fix a bug in squoosh's animation support where the root frames of components were not considered for animation, I kept running into layout assertions, which ultimately were because the animation implementation performs destructive mutations on the base layout tree AND on the "transition layout tree".
This change means that all
SquooshResolvedNode
trees are now immutable after construction (except for layout and style values which can change after the tree was built).Finally, because the source trees are immutable, we can run layout on the root and target root trees whenever layout needs to change. This means animations are uninterrupted by relayouts, and we can relayout as many times as we like without generating new trees.