+32
−22
mechanics/compose/src/com/android/mechanics/compose/modifier/VerticalTactileSurfaceRevealModifier.kt
+35
−28
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
This change refactors VerticalFadeContentRevealModifier and VerticalTactileSurfaceRevealModifier to improve clarity, performance, and state management. Key changes: - **Deferred MotionValue Creation:** The `ManagedMotionValue` that drives the animation is now created lazily during the first lookahead layout pass. This ensures it's only instantiated after its dependencies (`lookAheadHeight` and `layoutOffsetY`) are calculated and ready, leading to more robust animation setup. - **Reduced Compose State:** The `deltaY` parameter is now an immutable `val` within the node, removing a `MutableState` dependency. This simplifies the state logic, prevents unsupported updates, and reduces the number of state reads. - **Improved Documentation:** Added detailed comments and KDocs to clarify the lifecycle of the node's internal properties. This makes it easier to understand when each property is initialized, when it can be used safely, and how the overall animation is orchestrated. Test: Manually tested in the demo app Bug: 392535471 Flag: com.android.systemui.scene_container Change-Id: I18d1d38d933261e9a07601fa4bf10626d8fec106