Loading core/java/android/widget/EdgeEffect.java +9 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading Loading
core/java/android/widget/EdgeEffect.java +9 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading