From 4d3e997b9ea6fa9ec54df4b8cb59ecaaf155a0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9B=84?= Date: Thu, 28 May 2026 21:46:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8E=89=E5=B8=A7?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF=E5=9C=BA=E6=99=AF=E4=B8=8B=E5=90=91=E4=B8=8B?= =?UTF-8?q?=E5=9B=9E=E5=BC=B9=E8=AF=AF=E8=A7=A6=E5=8F=91=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E6=97=B6?= =?UTF-8?q?=E9=92=9F=E5=9F=9F=E9=80=86=E6=B5=81=E9=98=B2=E5=BE=A1=E6=80=A7?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/scwang/smart/refresh/layout/SmartRefreshLayout.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;