Fixing onPageBeginTransition not being called when scrolling overlay
Bug: 33693546
Change-Id: If212a196648fbb2c725ca4800a157ec24f278ca8
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 7aed155..76e2073 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -563,7 +563,7 @@
protected boolean computeScrollHelper(boolean shouldInvalidate) {
if (mScroller.computeScrollOffset()) {
// Don't bother scrolling if the page does not need to be moved
- if (getScrollX() != mScroller.getCurrX()
+ if (getUnboundedScrollX() != mScroller.getCurrX()
|| getScrollY() != mScroller.getCurrY()) {
float scaleX = mFreeScroll ? getScaleX() : 1f;
int scrollX = (int) (mScroller.getCurrX() * (1 / scaleX));
@@ -1945,6 +1945,7 @@
// Trigger a compute() to finish switching pages if necessary
if (immediate) {
computeScroll();
+ pageEndTransition();
}
invalidate();
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index fccff6c..cf6b025 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1386,12 +1386,10 @@
// it's own settling, and every gesture to the overlay should be self-contained and start
// from 0, so we zero it out here.
if (isScrollingOverlay()) {
- int finalScroll = mIsRtl ? mMaxScrollX : 0;
-
// We reset mWasInOverscroll so that PagedView doesn't zero out the overscroll
- // interaction when we call scrollTo.
+ // interaction when we call snapToPageImmediately.
mWasInOverscroll = false;
- scrollTo(finalScroll, getScrollY());
+ snapToPageImmediately(0);
} else {
super.snapToDestination();
}