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

Commit ccab4f5c authored by Likai Ding's avatar Likai Ding
Browse files

Gallery: fix white screen after rapid scrolling

If edge is reached when velocity is high, distance may be a large
negative value, causing very long animation duration. Fix it by checking
absolute value.

Change-Id: I71039a9ddd76f25c75582da4098cb091148cafba
CRs-Fixed: 1022927
parent b7f0f7f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ public class OverScroller {
            float distance = mVelocity * mVelocity / (2.0f * Math.abs(mDeceleration));
            final float sign = Math.signum(mVelocity);

            if (distance > mOver) {
            if (Math.abs(distance) > mOver) {
                // Default deceleration is not sufficient to slow us down before boundary
                 mDeceleration = - sign * mVelocity * mVelocity / (2.0f * mOver);
                 distance = mOver;