Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down