Show side pages when exiting spring-loaded mode

Bug: 6132598
Change-Id: I2bf9025b7ac66d020522448b003905cb37c87587
This commit is contained in:
Michael Jurka
2012-04-02 03:46:50 -07:00
parent 0ba38df8a4
commit 4ff7d79ddc
2 changed files with 7 additions and 4 deletions

View File

@@ -721,20 +721,21 @@ public abstract class PagedView extends ViewGroup {
protected void getVisiblePages(int[] range) {
final int pageCount = getChildCount();
if (pageCount > 0) {
final int screenWidth = getMeasuredWidth();
int leftScreen = 0;
int rightScreen = 0;
View currPage = getPageAt(leftScreen);
while (leftScreen < pageCount - 1 &&
currPage.getRight() - currPage.getPaddingRight() < mScrollX) {
currPage.getX() + currPage.getWidth() - currPage.getPaddingRight() < mScrollX) {
leftScreen++;
currPage = getPageAt(leftScreen);
}
rightScreen = leftScreen;
currPage = getPageAt(rightScreen + 1);
while (rightScreen < pageCount - 1 &&
currPage.getLeft() + currPage.getPaddingLeft() < mScrollX + screenWidth) {
currPage.getX() - currPage.getPaddingLeft() < mScrollX + screenWidth) {
rightScreen++;
currPage = getPageAt(rightScreen + 1);
}