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

Commit d38edc36 authored by Mike Schneider's avatar Mike Schneider
Browse files

Predefined constants for stable threshold

- For spatial values, cut off at 1px
- For effect springs, keep 0.01

Bug: 392534646
Test: Existing unit tests
Flag: com.android.systemui.scene_container
Change-Id: I14f3b83e1bde3622431ca7c82148041aa72293c4
parent aa821005
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ class MotionValue(
    private val gestureContext: GestureContext,
    initialSpec: MotionSpec = MotionSpec.Empty,
    val label: String? = null,
    private val stableThreshold: Float = 0.01f,
    private val stableThreshold: Float = StableThresholdEffect,
) : FloatState {

    /** The [MotionSpec] describing the mapping of this [MotionValue]'s input to the output. */
@@ -270,6 +270,9 @@ class MotionValue(
            )
        }

        const val StableThresholdEffect = 0.01f
        const val StableThresholdSpatial = 1f

        internal const val TAG = "MotionValue"
    }