Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30211835 authored by Omar Miatello's avatar Omar Miatello
Browse files

feat(MM): Make MotionSpec declarative and state-driven (2/3)

This change refactors `MotionValue` to make its `MotionSpec` (animation
physics) derived from a reactive lambda, replacing the previous
imperative approach.

Previously, `MotionValue` had a mutable `spec` property that consumers
would update directly. This required imperative logic within consumers
(`motionValue.spec = ...`) which did not align well with Compose's
declarative, state-driven architecture.

The `MotionValue` constructor now accepts a `spec: () -> MotionSpec`
lambda. The value now automatically reacts to changes in any state read
within this lambda, making its behavior inherently declarative.

Test: Tested on the previous MotionValueTests
Bug: 428886057
Flag: com.android.systemui.scene_container
Change-Id: I8f1b29da698d6599edcd61d36108f005d21e706e
parent b9eba49b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment