summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2010-11-19 12:02:18 -0800
committerAdam Cohen <adamcohen@google.com>2010-11-19 13:08:37 -0800
commitfaa28305134b0d391d2baf1bff5bff4710fe819f (patch)
treed233af4f0258306e78d7befad6b420922394ef67
parent2dc162f41b7ffc6e804cecf9cfde6d962305890c (diff)
downloadandroid_packages_apps_Trebuchet-faa28305134b0d391d2baf1bff5bff4710fe819f.tar.gz
android_packages_apps_Trebuchet-faa28305134b0d391d2baf1bff5bff4710fe819f.tar.bz2
android_packages_apps_Trebuchet-faa28305134b0d391d2baf1bff5bff4710fe819f.zip
Fix issue 3214208
-Doing an index check to avoid NPE Change-Id: I53e4f4377f0e725e57ed9d0835b6f69af4f83a64
-rw-r--r--src/com/android/launcher2/PagedView.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index a2ed9858a..264e83907 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -417,8 +417,12 @@ public abstract class PagedView extends ViewGroup {
if (heightMode == MeasureSpec.AT_MOST) {
heightSize = maxChildHeight + verticalPadding;
}
+ if (childCount > 0) {
+ mMaxScrollX = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1);
+ } else {
+ mMaxScrollX = 0;
+ }
- mMaxScrollX = getChildOffset(childCount - 1) - getRelativeChildOffset(childCount - 1);
setMeasuredDimension(widthSize, heightSize);
}