diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-05-23 16:15:09 -0700 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2011-05-23 17:30:17 -0700 |
commit | 4a5ad095303ca1b6b745263269333bd087168d3c (patch) | |
tree | 8e4b206b5ea42d2ff52fac70a86aee1a8e139652 /src/com/android/launcher2/PagedViewCellLayout.java | |
parent | 4c5ac591f4c88203749a051cc9b7bce92e90abee (diff) | |
download | android_packages_apps_Trebuchet-4a5ad095303ca1b6b745263269333bd087168d3c.tar.gz android_packages_apps_Trebuchet-4a5ad095303ca1b6b745263269333bd087168d3c.tar.bz2 android_packages_apps_Trebuchet-4a5ad095303ca1b6b745263269333bd087168d3c.zip |
Dynamically determine size of customize tray.
Change-Id: I13235bbd01df8c31eb9bdfe88913db55624d8b9b
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewCellLayout.java | 10 |
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 |