diff options
author | Winson Chung <winsonc@google.com> | 2013-09-20 17:52:56 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-09-20 17:52:56 +0000 |
commit | 2873ecd1ab2433f6124d8c9c27e2c3b37520a3a5 (patch) | |
tree | 16001c25fde223f0c404fe059303dfc367bf50fb /src/com | |
parent | d7dc681290d52a00cf8dd6664a8105cb1374a681 (diff) | |
parent | cdef04403695872db8be6342b8dacd437ee02d52 (diff) | |
download | android_packages_apps_Trebuchet-2873ecd1ab2433f6124d8c9c27e2c3b37520a3a5.tar.gz android_packages_apps_Trebuchet-2873ecd1ab2433f6124d8c9c27e2c3b37520a3a5.tar.bz2 android_packages_apps_Trebuchet-2873ecd1ab2433f6124d8c9c27e2c3b37520a3a5.zip |
Merge "Fixing some grid spacing issues. (Bug 10754537, 10754538)" into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/DynamicGrid.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/ShortcutAndWidgetContainer.java | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index bb6903d43..7a7a3b61f 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -102,10 +102,13 @@ public class BubbleTextView extends TextView { public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache) { Bitmap b = info.getIcon(iconCache); + LauncherAppState app = LauncherAppState.getInstance(); + DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); setCompoundDrawablesWithIntrinsicBounds(null, new FastBitmapDrawable(b), null, null); + setCompoundDrawablePadding((int) ((grid.folderIconSizePx - grid.iconSizePx) / 2f)); setText(info.title); setTag(info); } diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java index 70f000053..6e101750f 100644 --- a/src/com/android/launcher3/DynamicGrid.java +++ b/src/com/android/launcher3/DynamicGrid.java @@ -207,7 +207,7 @@ class DeviceProfile { // Folder folderCellWidthPx = cellWidthPx + 3 * edgeMarginPx; - folderCellHeightPx = cellHeightPx + edgeMarginPx; + folderCellHeightPx = cellHeightPx + (int) ((3f/2f) * edgeMarginPx); folderBackgroundOffset = -edgeMarginPx; folderIconSizePx = iconSizePx + 2 * -folderBackgroundOffset; } diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index 5ce557192..b9511005e 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -137,7 +137,8 @@ public class ShortcutAndWidgetContainer extends ViewGroup { // Otherwise, center the icon int cHeight = mIsHotseatLayout ? grid.hotseatCellHeightPx : Math.min(getMeasuredHeight(), grid.cellHeightPx); int cellPaddingY = (int) Math.max(0, ((lp.height - cHeight) / 2f)); - child.setPadding(0, cellPaddingY, 0, 0); + int cellPaddingX = (int) (grid.edgeMarginPx / 2f); + child.setPadding(cellPaddingX, cellPaddingY, cellPaddingX, 0); } } else { lp.x = 0; |