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(); }