From 9c0565fe9385f92b7b2608d6506e4e5a7c500c2d Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 19 Jul 2013 13:49:06 -0700 Subject: [PATCH] Fixing regression causing PagedView not to load subsequent widget pages. Change-Id: I1da1bd0ec5e4b964dd43cdba98d36ef30655a4a3 --- src/com/android/launcher3/PagedView.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index cb75f2a70f..aaff588869 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -181,6 +181,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc // If true, the subclass should directly update scrollX itself in its computeScroll method // (SmoothPagedView does this) protected boolean mDeferScrollUpdate = false; + protected boolean mDeferLoadAssociatedPagesUntilScrollCompletes = false; protected boolean mIsPageMoving = false; @@ -618,6 +619,12 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc mNextPage = INVALID_PAGE; notifyPageSwitchListener(); + // Load the associated pages if necessary + if (mDeferLoadAssociatedPagesUntilScrollCompletes) { + loadAssociatedPages(mCurrentPage); + mDeferLoadAssociatedPagesUntilScrollCompletes = false; + } + // We don't want to trigger a page end moving unless the page has settled // and the user has stopped scrolling if (mTouchState == TOUCH_STATE_REST) { @@ -2007,6 +2014,9 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc computeScroll(); } + // Defer loading associated pages until the scroll settles + mDeferLoadAssociatedPagesUntilScrollCompletes = true; + mForceScreenScrolled = true; invalidate(); }