diff options
author | Vladislav Kaznacheev <kaznacheev@google.com> | 2015-08-05 19:34:38 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-08-05 19:34:38 +0000 |
commit | 8cc00243423e22a36c518cd5ece97b45271ae5e8 (patch) | |
tree | 75708833da3f56527efe0f2c2b2d7fcacc2bbe01 /core | |
parent | db221acce269245d630e8eb456501c5c6241447b (diff) | |
parent | 84ad7e9ee2a2f1927fc54dcf94852a764d39bf64 (diff) | |
download | frameworks_base-8cc00243423e22a36c518cd5ece97b45271ae5e8.zip frameworks_base-8cc00243423e22a36c518cd5ece97b45271ae5e8.tar.gz frameworks_base-8cc00243423e22a36c518cd5ece97b45271ae5e8.tar.bz2 |
Merge "Keep OverScroller.SplineOverScroller state consistent." into mnc-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/widget/OverScroller.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/widget/OverScroller.java b/core/java/android/widget/OverScroller.java index 98bfd7d..50569d7 100644 --- a/core/java/android/widget/OverScroller.java +++ b/core/java/android/widget/OverScroller.java @@ -678,7 +678,7 @@ public class OverScroller { void startScroll(int start, int distance, int duration) { mFinished = false; - mStart = start; + mCurrentPosition = mStart = start; mFinal = start + distance; mStartTime = AnimationUtils.currentAnimationTimeMillis(); @@ -712,7 +712,7 @@ public class OverScroller { boolean springback(int start, int min, int max) { mFinished = true; - mStart = mFinal = start; + mCurrentPosition = mStart = mFinal = start; mVelocity = 0; mStartTime = AnimationUtils.currentAnimationTimeMillis(); @@ -804,7 +804,7 @@ public class OverScroller { final float totalDuration = (float) Math.sqrt( 2.0 * (distanceToApex + distanceToEdge) / Math.abs(mDeceleration)); mStartTime -= (int) (1000.0f * (totalDuration - durationToApex)); - mStart = end; + mCurrentPosition = mStart = end; mVelocity = (int) (- mDeceleration * totalDuration); } @@ -873,7 +873,7 @@ public class OverScroller { // Duration from start to null velocity if (mDuration < mSplineDuration) { // If the animation was clamped, we reached the edge - mStart = mFinal; + mCurrentPosition = mStart = mFinal; // TODO Better compute speed when edge was reached mVelocity = (int) mCurrVelocity; mDeceleration = getDeceleration(mVelocity); |