Making sure overview mode can't get stuck (issue 11022017)
Change-Id: Iee2088f8781d375b0b83625023fb125a869a2868
This commit is contained in:
parent
edaaa30232
commit
7a9e58aa17
|
@ -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,17 +1559,8 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||
setEnableFreeScroll(false, snapPage);
|
||||
}
|
||||
|
||||
private void setEnableFreeScroll(boolean freeScroll, int snapPage) {
|
||||
mFreeScroll = freeScroll;
|
||||
|
||||
if (snapPage == -1) {
|
||||
snapPage = getPageNearestToCenterOfScreen();
|
||||
}
|
||||
|
||||
void updateFreescrollBounds() {
|
||||
getOverviewModePages(mTempVisiblePagesRange);
|
||||
if (!mFreeScroll) {
|
||||
snapToPage(snapPage);
|
||||
} else {
|
||||
if (isLayoutRtl()) {
|
||||
mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
|
||||
mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
|
||||
|
@ -1576,7 +1568,20 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||
mFreeScrollMinScrollX = getScrollForPage(mTempVisiblePagesRange[0]);
|
||||
mFreeScrollMaxScrollX = getScrollForPage(mTempVisiblePagesRange[1]);
|
||||
}
|
||||
}
|
||||
|
||||
private void setEnableFreeScroll(boolean freeScroll, int snapPage) {
|
||||
mFreeScroll = freeScroll;
|
||||
|
||||
if (snapPage == -1) {
|
||||
snapPage = getPageNearestToCenterOfScreen();
|
||||
}
|
||||
|
||||
if (!mFreeScroll) {
|
||||
snapToPage(snapPage);
|
||||
} else {
|
||||
updateFreescrollBounds();
|
||||
getOverviewModePages(mTempVisiblePagesRange);
|
||||
if (getCurrentPage() < mTempVisiblePagesRange[0]) {
|
||||
setCurrentPage(mTempVisiblePagesRange[0]);
|
||||
} else if (getCurrentPage() > mTempVisiblePagesRange[1]) {
|
||||
|
|
Loading…
Reference in New Issue