forceFinishScroller();
}
- private void abortScrollerAnimation() {
+ private void abortScrollerAnimation(boolean resetNextPage) {
mScroller.abortAnimation();
// We need to clean up the next page here to avoid computeScrollHelper from
// updating current page on the pass.
- mNextPage = INVALID_PAGE;
+ if (resetNextPage) {
+ mNextPage = INVALID_PAGE;
+ }
}
private void forceFinishScroller() {
*/
void setCurrentPage(int currentPage) {
if (!mScroller.isFinished()) {
- abortScrollerAnimation();
+ abortScrollerAnimation(true);
}
// don't introduce any checks like mCurrentPage == currentPage here-- if we change the
// the default
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop);
if (finishedScrolling) {
mTouchState = TOUCH_STATE_REST;
- abortScrollerAnimation();
+ abortScrollerAnimation(false);
} else {
if (isTouchPointInViewportWithBuffer((int) mDownMotionX, (int) mDownMotionY)) {
mTouchState = TOUCH_STATE_SCROLLING;
* will be false if being flinged.
*/
if (!mScroller.isFinished()) {
- abortScrollerAnimation();
+ abortScrollerAnimation(false);
}
// Remember where the motion event started
}
} else {
if (!mScroller.isFinished()) {
- abortScrollerAnimation();
+ abortScrollerAnimation(true);
}
float scaleX = getScaleX();