diff options
author | Winson Chung <winsonc@google.com> | 2010-10-20 17:49:27 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2010-10-20 18:39:54 -0700 |
commit | df4b83dd9d6380ab963c62d1f9d1312efc87cb0f (patch) | |
tree | e8fd6a182f7af67fc7779207b4e2fed696f56ce5 /src/com/android/launcher2/PagedViewCellLayout.java | |
parent | bae3d061cc16ad005302b5eec404c4c0bc3a7421 (diff) | |
download | android_packages_apps_Trebuchet-df4b83dd9d6380ab963c62d1f9d1312efc87cb0f.tar.gz android_packages_apps_Trebuchet-df4b83dd9d6380ab963c62d1f9d1312efc87cb0f.tar.bz2 android_packages_apps_Trebuchet-df4b83dd9d6380ab963c62d1f9d1312efc87cb0f.zip |
More spacing changes for AllApps.
- Also testing a simple scale of existing icons in lieu of high res icons.
Change-Id: Ib9758064536cd1b1704344ea885bccdc93dd3466
Diffstat (limited to 'src/com/android/launcher2/PagedViewCellLayout.java')
-rw-r--r-- | src/com/android/launcher2/PagedViewCellLayout.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/com/android/launcher2/PagedViewCellLayout.java b/src/com/android/launcher2/PagedViewCellLayout.java index b247a065f..0a5a2ec29 100644 --- a/src/com/android/launcher2/PagedViewCellLayout.java +++ b/src/com/android/launcher2/PagedViewCellLayout.java @@ -46,6 +46,8 @@ public class PagedViewCellLayout extends ViewGroup { private int mCellCountY; private int mCellWidth; private int mCellHeight; + private int mWidthGap; + private int mHeightGap; private static int sDefaultCellDimensions = 96; public PagedViewCellLayout(Context context) { @@ -66,6 +68,7 @@ public class PagedViewCellLayout extends ViewGroup { mCellCountX = LauncherModel.getCellCountX(); mCellCountY = LauncherModel.getCellCountY(); mHolographicAlpha = 0.0f; + mWidthGap = mHeightGap = -1; } @Override @@ -168,12 +171,17 @@ public class PagedViewCellLayout extends ViewGroup { paddingLeft += ((widthGap - minGap) * (mCellCountX - 1)) / 2; } */ - widthGap = heightGap = minGap; + if (mWidthGap > -1 && mHeightGap > -1) { + widthGap = mWidthGap; + heightGap = mHeightGap; + } else { + widthGap = heightGap = minGap; + } int newWidth = mPaddingLeft + mPaddingRight + (mCellCountX * cellWidth) + - ((mCellCountX - 1) * minGap); + ((mCellCountX - 1) * widthGap); int newHeight = mPaddingTop + mPaddingBottom + (mCellCountY * cellHeight) + - ((mCellCountY - 1) * minGap); + ((mCellCountY - 1) * heightGap); final int count = getChildCount(); for (int i = 0; i < count; i++) { @@ -252,6 +260,11 @@ public class PagedViewCellLayout extends ViewGroup { requestLayout(); } + public void setGap(int widthGap, int heightGap) { + mWidthGap = widthGap; + mHeightGap = heightGap; + } + public void setCellDimensions(int width, int height) { mCellWidth = width; mCellHeight = height; |