Reset RecentsView#mNextPage when swiping to home
This ensures that we don't inadvertently update mCurrentPage to be
mNextPage in computeScrollHelper(), which would in turn mess up
calculations such as RecentsView#getHorizontalOffsetSize().
Also removed resetNextPage parameter from forceFinishScroller(), as
resetNextPage was always passed as true anyway.
Test: Swipe up and to the right to home, ensure adjacent page goes all
the way off screen
Fixes: 199927699
Change-Id: Iee1ffac10e5195f0c3a124a23b06d5411ecd7ba2
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 108091c..a7198a8 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -254,7 +254,7 @@
}
mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition);
mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0);
- forceFinishScroller(true);
+ forceFinishScroller();
}
/**
@@ -276,14 +276,16 @@
}
}
- private void forceFinishScroller(boolean resetNextPage) {
+ /**
+ * Immediately finishes any in-progress scroll, maintaining the current position. Also sets
+ * mNextPage = INVALID_PAGE and calls pageEndTransition().
+ */
+ public void forceFinishScroller() {
mScroller.forceFinished(true);
// We need to clean up the next page here to avoid computeScrollHelper from
// updating current page on the pass.
- if (resetNextPage) {
- mNextPage = INVALID_PAGE;
- pageEndTransition();
- }
+ mNextPage = INVALID_PAGE;
+ pageEndTransition();
}
private int validateNewPage(int newPage) {