summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewCellLayout.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-04-05 16:52:32 -0700
committerMichael Jurka <mikejurka@google.com>2011-04-05 16:52:32 -0700
commit0413dfa01b822e349092636774dc948b9230adea (patch)
treedd8c1e512457adfe2dbd203a2e248c352236bf16 /src/com/android/launcher2/PagedViewCellLayout.java
parent3f272c6665090a006859892f441b058deb3d6fab (diff)
downloadandroid_packages_apps_Trebuchet-0413dfa01b822e349092636774dc948b9230adea.tar.gz
android_packages_apps_Trebuchet-0413dfa01b822e349092636774dc948b9230adea.tar.bz2
android_packages_apps_Trebuchet-0413dfa01b822e349092636774dc948b9230adea.zip
Setting min width of content in customize tray automatically
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r--src/com/android/launcher2/PagedViewCellLayout.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 53657e5cb..b94be4d6f 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -247,9 +247,12 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
// Return the distance from the left edge of the content of the leftmost icon to
// the right edge of the content of the rightmost icon
- // icons are centered within cells, find out how much offset that accounts for
- int iconHorizontalOffset = (mCellWidth - Utilities.getIconContentSize());
- return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap - iconHorizontalOffset;
+ // icons are centered within cells, find out how much padding that accounts for
+ return getWidthBeforeLayout() - (mCellWidth - Utilities.getIconContentSize());
+ }
+
+ int getWidthBeforeLayout() {
+ return mCellCountX * mCellWidth + (mCellCountX - 1) * mWidthGap;
}
@Override