diff --git a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java index 35963cba..cdce4c2b 100644 --- a/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java +++ b/refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java @@ -1500,7 +1500,7 @@ public void run() { if (animationRunnable == this && !mState.isFinishing) { // mVelocity *= Math.pow(mDamping, ++mFrame); long now = AnimationUtils.currentAnimationTimeMillis(); - long span = now - mLastTime; + long span = Math.max(0, now - mLastTime); mVelocity *= Math.pow(mDamping, (now - mStartTime) / (1000f / mFrameDelay)); float velocity = (mVelocity * (1f * span / 1000)); if (Math.abs(velocity) > 1) { @@ -1554,7 +1554,7 @@ public void run() { mVelocity *= Math.pow(0.95f, ++mFrame * 2);//平滑滚动数度衰减 } long now = AnimationUtils.currentAnimationTimeMillis(); - float t = 1f * (now - mLastTime) / 1000; + float t = Math.max(0, 1f * (now - mLastTime) / 1000); float velocity = mVelocity * t; if (Math.abs(velocity) >= 1) { mLastTime = now;