summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewCellLayout.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r--src/com/android/launcher2/PagedViewCellLayout.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 15b155fd9..0ae7a597c 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -286,11 +286,17 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
}
int getContentHeight() {
- return mCellCountY * mCellHeight + (mCellCountY - 1) * Math.max(0, mHeightGap);
+ if (mCellCountY > 0) {
+ return mCellCountY * mCellHeight + (mCellCountY - 1) * Math.max(0, mHeightGap);
+ }
+ return 0;
}
int getWidthBeforeFirstLayout() {
- return mCellCountX * mCellWidth + (mCellCountX - 1) * Math.max(0, mWidthGap);
+ if (mCellCountX > 0) {
+ return mCellCountX * mCellWidth + (mCellCountX - 1) * Math.max(0, mWidthGap);
+ }
+ return 0;
}
@Override