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

Commit 0161aa2a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Limit overscroll stretch for animation" into sc-dev am: b42f19e2

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

Change-Id: I9fa60ede298eebe915ec8334d5b27af674ff136e
parents 69fd8063 b42f19e2
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -365,6 +365,10 @@ public class EdgeEffect {
        mDuration = PULL_TIME;
        mDuration = PULL_TIME;


        mPullDistance += deltaDistance;
        mPullDistance += deltaDistance;
        if (edgeEffectBehavior == TYPE_STRETCH) {
            // Don't allow stretch beyond 1
            mPullDistance = Math.min(1f, mPullDistance);
        }
        mDistance = Math.max(0f, mPullDistance);
        mDistance = Math.max(0f, mPullDistance);
        mVelocity = 0;
        mVelocity = 0;


@@ -783,6 +787,10 @@ public class EdgeEffect {
                + mDampedFreq * sinCoeff * Math.cos(mDampedFreq * deltaT));
                + mDampedFreq * sinCoeff * Math.cos(mDampedFreq * deltaT));
        mDistance = (float) distance / mHeight;
        mDistance = (float) distance / mHeight;
        mVelocity = (float) velocity;
        mVelocity = (float) velocity;
        if (mDistance > 1f) {
            mDistance = 1f;
            mVelocity = 0f;
        }
        if (isAtEquilibrium()) {
        if (isAtEquilibrium()) {
            mDistance = 0;
            mDistance = 0;
            mVelocity = 0;
            mVelocity = 0;