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

* commit 'da5d3b7f6e4c411cfc216547da49de45e809237d':
  Fix ArrayIndexOutOfBoundsException, (issue 11038649)
This commit is contained in:
Adam Cohen
2013-10-03 10:37:10 -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];