am 40d6264a: Merge "Fix ArrayIndexOutOfBoundsException, (issue 11038649)" into jb-ub-now-indigo-rose

* commit '40d6264a8e1a29b0f11a03fff39db1dc7f967088':
  Fix ArrayIndexOutOfBoundsException, (issue 11038649)
This commit is contained in:
Adam Cohen
2013-10-03 10:34:16 -07:00
committed by Android Git Automerger
+2 -2
View File
@@ -1051,7 +1051,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected void getOverviewModePages(int[] range) {
range[0] = 0;
range[1] = getChildCount() - 1;
range[1] = Math.max(0, getChildCount() - 1);
}
protected void getVisiblePages(int[] range) {
@@ -1476,7 +1476,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
}
public int getScrollForPage(int index) {
if (mPageScrolls == null || index >= mPageScrolls.length) {
if (mPageScrolls == null || index >= mPageScrolls.length || index < 0) {
return 0;
} else {
return mPageScrolls[index];