summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher3/PagedView.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 0a15ecd..6d75018 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -990,13 +990,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// in accordance with any scroll effects.
mForceScreenScrolled = true;
mRecomputePageSpacing = true;
-
+ updateFreescrollBounds();
invalidate();
}
@Override
public void onChildViewRemoved(View parent, View child) {
mForceScreenScrolled = true;
+ updateFreescrollBounds();
invalidate();
}
@@ -1558,6 +1559,17 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
setEnableFreeScroll(false, snapPage);
}
+ void updateFreescrollBounds() {
+ getOverviewModePages(mTempVisiblePagesRange);
+ if (isLayoutRtl()) {
+ mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
+ mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
+ } else {
+ mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
+ mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
+ }
+ }
+
private void setEnableFreeScroll(boolean freeScroll, int snapPage) {
mFreeScroll = freeScroll;
@@ -1565,18 +1577,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
snapPage = getPageNearestToCenterOfScreen();
}
- getOverviewModePages(mTempVisiblePagesRange);
if (!mFreeScroll) {
snapToPage(snapPage);
} else {
- if (isLayoutRtl()) {
- mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
- mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
- } else {
- mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
- mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
- }
-
+ updateFreescrollBounds();
+ getOverviewModePages(mTempVisiblePagesRange);
if (getCurrentPage() < mTempVisiblePagesRange[0]) {
setCurrentPage(mTempVisiblePagesRange[0]);
} else if (getCurrentPage() > mTempVisiblePagesRange[1]) {