summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewCellLayout.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-06-02 16:41:34 -0700
committerMichael Jurka <mikejurka@google.com>2011-06-03 17:56:20 -0700
commit9bfe2b2646f3849f5463c63876c184e820a7f03b (patch)
treecec0544001a8e82bb54c29e575a4c94f02fd04e8 /src/com/android/launcher2/PagedViewCellLayout.java
parentdcfc25ca5f5dd3f867e929e34605564162128b45 (diff)
downloadandroid_packages_apps_Trebuchet-9bfe2b2646f3849f5463c63876c184e820a7f03b.tar.gz
android_packages_apps_Trebuchet-9bfe2b2646f3849f5463c63876c184e820a7f03b.tar.bz2
android_packages_apps_Trebuchet-9bfe2b2646f3849f5463c63876c184e820a7f03b.zip
Fixing bug with layout of PagedViewCellLayoutChildren
Change-Id: I3fa34ad500632c4b257973aca9be0cb1bda5884a
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r--src/com/android/launcher2/PagedViewCellLayout.java19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java
index 0ae7a597c..901ac2680 100644
--- a/src/com/android/launcher2/PagedViewCellLayout.java
+++ b/src/com/android/launcher2/PagedViewCellLayout.java
@@ -211,8 +211,6 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
}
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- // TODO: currently ignoring padding
-
int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec);
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
@@ -255,10 +253,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
widthGap = heightGap = minGap;
}
- int newWidth = mPaddingLeft + mPaddingRight + (mCellCountX * cellWidth) +
- ((mCellCountX - 1) * widthGap);
- int newHeight = mPaddingTop + mPaddingBottom + (mCellCountY * cellHeight) +
- ((mCellCountY - 1) * heightGap);
+ int newWidth = (mCellCountX * cellWidth) + ((mCellCountX - 1) * widthGap);
+ int newHeight = (mCellCountY * cellHeight) + ((mCellCountY - 1) * heightGap);
final int count = getChildCount();
for (int i = 0; i < count; i++) {
@@ -270,7 +266,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
child.measure(childWidthMeasureSpec, childheightMeasureSpec);
}
- setMeasuredDimension(newWidth, newHeight);
+ setMeasuredDimension(newWidth + mPaddingLeft + mPaddingRight,
+ newHeight + mPaddingTop + mPaddingBottom);
}
int getContentWidth() {
@@ -304,12 +301,8 @@ public class PagedViewCellLayout extends ViewGroup implements Page {
int count = getChildCount();
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
- if (LauncherApplication.isScreenLarge()) {
- child.layout(0, 0, r - l, b - t);
- } else {
- child.layout(mPaddingLeft, mPaddingTop, getMeasuredWidth() - mPaddingRight,
- getMeasuredHeight() - mPaddingBottom);
- }
+ child.layout(mPaddingLeft, mPaddingTop,
+ r - l - mPaddingRight, b - t - mPaddingBottom);
}
}