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

Commit 22ee34b0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fixed EdgeEffect drawn on non-RecordingCanvas" into sc-dev am: caab1b26

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13932725

Change-Id: Ia58780e40d6325602de86ec7ba45b5ebc6c43d0d
parents 36f30dcc caab1b26
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -640,6 +640,12 @@ public class EdgeEffect {
                    mWidth,
                    mHeight
            );
        } else {
            // This is TYPE_STRETCH and drawing into a Canvas that isn't a Recording Canvas,
            // so no effect can be shown. Just end the effect.
            mState = STATE_IDLE;
            mDistance = 0;
            mVelocity = 0;
        }

        boolean oneLastFrame = false;
@@ -771,8 +777,9 @@ public class EdgeEffect {
     * considered at rest or false if it is still animating.
     */
    private boolean isAtEquilibrium() {
        double displacement = mDistance * mHeight; // in pixels
        return Math.abs(mVelocity) < VELOCITY_THRESHOLD
        double displacement = mDistance * mHeight * LINEAR_STRETCH_INTENSITY; // in pixels
        double velocity = mVelocity * LINEAR_STRETCH_INTENSITY;
        return Math.abs(velocity) < VELOCITY_THRESHOLD
                && Math.abs(displacement) < VALUE_THRESHOLD;
    }