diff options
author | Adam Cohen <adamcohen@google.com> | 2010-11-19 12:02:18 -0800 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2010-11-19 13:08:37 -0800 |
commit | faa28305134b0d391d2baf1bff5bff4710fe819f (patch) | |
tree | d233af4f0258306e78d7befad6b420922394ef67 /src/com/android/launcher2/PagedView.java | |
parent | 2dc162f41b7ffc6e804cecf9cfde6d962305890c (diff) | |
download | android_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
Diffstat (limited to 'src/com/android/launcher2/PagedView.java')
-rw-r--r-- | src/com/android/launcher2/PagedView.java | 6 |
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); } |