Fixing regression causing PagedView not to load subsequent widget pages.

Change-Id: I1da1bd0ec5e4b964dd43cdba98d36ef30655a4a3
This commit is contained in:
Winson Chung
2013-07-19 13:49:06 -07:00
parent bc902ad603
commit 9c0565fe93

View File

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