diff options
-rw-r--r-- | res/layout/all_apps_icon.xml | 5 | ||||
-rw-r--r-- | res/layout/page_indicator.xml | 2 | ||||
-rw-r--r-- | res/layout/qsb_default_view.xml | 2 | ||||
-rw-r--r-- | res/values/dimens.xml | 11 | ||||
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 1 | ||||
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 24 | ||||
-rw-r--r-- | src/com/android/launcher3/IconCache.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 1 | ||||
-rw-r--r-- | src/com/android/launcher3/ShortcutAndWidgetContainer.java | 2 | ||||
-rw-r--r-- | src/com/android/launcher3/WidgetPreviewLoader.java | 2 |
10 files changed, 28 insertions, 24 deletions
diff --git a/res/layout/all_apps_icon.xml b/res/layout/all_apps_icon.xml index ca0cbcc4d..79fb6126a 100644 --- a/res/layout/all_apps_icon.xml +++ b/res/layout/all_apps_icon.xml @@ -23,7 +23,6 @@ android:stateListAnimator="@animator/all_apps_fastscroll_icon_anim" launcher:iconDisplay="all_apps" launcher:centerVertically="true" - android:paddingLeft="4dp" - android:paddingRight="4dp" - android:drawablePadding="@dimen/dynamic_grid_icon_drawable_padding" /> + android:paddingLeft="@dimen/dynamic_grid_cell_padding_x" + android:paddingRight="@dimen/dynamic_grid_cell_padding_x" /> diff --git a/res/layout/page_indicator.xml b/res/layout/page_indicator.xml index e29e5b162..c5ef6e0a8 100644 --- a/res/layout/page_indicator.xml +++ b/res/layout/page_indicator.xml @@ -23,6 +23,6 @@ android:id="@+id/all_apps_handle" android:layout_width="48dp" android:layout_height="match_parent" - android:layout_gravity="center" + android:layout_gravity="top|center" android:scaleType="centerInside"/> </com.android.launcher3.pageindicators.PageIndicatorLineCaret> diff --git a/res/layout/qsb_default_view.xml b/res/layout/qsb_default_view.xml index 3075f803f..04fe23608 100644 --- a/res/layout/qsb_default_view.xml +++ b/res/layout/qsb_default_view.xml @@ -21,7 +21,7 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="48dp" - android:layout_margin="16dp" + android:layout_margin="8dp" android:layout_gravity="center_vertical" android:background="@drawable/round_rect_primary" android:elevation="2dp" diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 57b4be4e2..8d6b501c2 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -16,8 +16,8 @@ <resources> <!-- Dynamic Grid --> - <dimen name="dynamic_grid_edge_margin">8dp</dimen> - <dimen name="dynamic_grid_page_indicator_height">28dp</dimen> + <dimen name="dynamic_grid_edge_margin">16dp</dimen> + <dimen name="dynamic_grid_page_indicator_height">32dp</dimen> <dimen name="dynamic_grid_page_indicator_line_height">1dp</dimen> <dimen name="dynamic_grid_page_indicator_gutter_width_left_nav_bar">38dp</dimen> <dimen name="dynamic_grid_page_indicator_gutter_width_right_nav_bar">48dp</dimen> @@ -26,14 +26,17 @@ <dimen name="dynamic_grid_overview_max_icon_zone_height">120dp</dimen> <dimen name="dynamic_grid_overview_bar_item_width">80dp</dimen> <dimen name="dynamic_grid_overview_bar_spacer_width">25dp</dimen> - <dimen name="dynamic_grid_workspace_top_padding">12dp</dimen> + <dimen name="dynamic_grid_workspace_top_padding">8dp</dimen> <dimen name="dynamic_grid_workspace_page_spacing">8dp</dimen> <!-- Minimum space between workspace and hotseat in spring loaded mode --> <dimen name="dynamic_grid_min_spring_loaded_space">8dp</dimen> + <!-- dynamic_grid_edge_margin / 2 --> + <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> + <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen> - <dimen name="dynamic_grid_hotseat_bottom_padding">0dp</dimen> + <dimen name="dynamic_grid_hotseat_bottom_padding">2dp</dimen> <dimen name="dynamic_grid_hotseat_height">80dp</dimen> <dimen name="dynamic_grid_hotseat_land_gutter_width">24dp</dimen> diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index b6e73287f..f8e87c57f 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -168,6 +168,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver { int defaultIconSize = grid.iconSizePx; if (display == DISPLAY_WORKSPACE) { setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.iconTextSizePx); + setCompoundDrawablePadding(grid.iconDrawablePaddingPx); } else if (display == DISPLAY_ALL_APPS) { setTextSize(TypedValue.COMPLEX_UNIT_PX, grid.allAppsIconTextSizePx); setCompoundDrawablePadding(grid.allAppsIconDrawablePaddingPx); diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 83ea067bc..0a346a6ea 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -32,6 +32,7 @@ import android.widget.FrameLayout; import com.android.launcher3.CellLayout.ContainerType; import com.android.launcher3.badge.BadgeRenderer; +import com.android.launcher3.config.FeatureFlags; import java.util.ArrayList; @@ -92,6 +93,7 @@ public class DeviceProfile { public int cellWidthPx; public int cellHeightPx; + public int cellPaddingXPx; // Folder public int folderBackgroundOffset; @@ -192,6 +194,8 @@ public class DeviceProfile { workspaceSpringLoadedBottomSpace = res.getDimensionPixelSize(R.dimen.dynamic_grid_min_spring_loaded_space); + cellPaddingXPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_padding_x); + hotseatBarTopPaddingPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_top_padding); hotseatBarBottomPaddingPx = @@ -264,36 +268,34 @@ public class DeviceProfile { } private void updateAvailableDimensions(DisplayMetrics dm, Resources res) { - updateIconSize(1f, iconDrawablePaddingOriginalPx, res, dm); + updateIconSize(1f, res, dm); // Check to see if the icons fit within the available height. If not, then scale down. float usedHeight = (cellHeightPx * inv.numRows); int maxHeight = (availableHeightPx - getTotalWorkspacePadding().y); if (usedHeight > maxHeight) { float scale = maxHeight / usedHeight; - updateIconSize(scale, 0, res, dm); + updateIconSize(scale, res, dm); } - updateAvailableFolderCellDimensions(dm, res); } - private void updateIconSize(float scale, int drawablePadding, Resources res, - DisplayMetrics dm) { + private void updateIconSize(float scale, Resources res, DisplayMetrics dm) { iconSizePx = (int) (Utilities.pxFromDp(inv.iconSize, dm) * scale); iconTextSizePx = (int) (Utilities.pxFromSp(inv.iconTextSize, dm) * scale); - iconDrawablePaddingPx = drawablePadding; + iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale); hotseatIconSizePx = (int) (Utilities.pxFromDp(inv.hotseatIconSize, dm) * scale); allAppsIconSizePx = iconSizePx; allAppsIconDrawablePaddingPx = iconDrawablePaddingPx; allAppsIconTextSizePx = iconTextSizePx; - cellWidthPx = iconSizePx; + cellWidthPx = iconSizePx + iconDrawablePaddingPx; cellHeightPx = iconSizePx + iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx); // Hotseat - hotseatCellWidthPx = iconSizePx; - hotseatCellHeightPx = iconSizePx; + hotseatCellWidthPx = cellWidthPx; + hotseatCellHeightPx = iconSizePx + iconDrawablePaddingPx; if (!isVerticalBarLayout()) { int expectedWorkspaceHeight = availableHeightPx - hotseatBarHeightPx @@ -308,7 +310,7 @@ public class DeviceProfile { } // Folder icon - folderBackgroundOffset = -edgeMarginPx; + folderBackgroundOffset = -iconDrawablePaddingPx; folderIconSizePx = iconSizePx + 2 * -folderBackgroundOffset; folderIconPreviewPadding = res.getDimensionPixelSize(R.dimen.folder_preview_padding); } @@ -522,7 +524,7 @@ public class DeviceProfile { lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); lp.width = searchBarBounds.x; lp.height = searchBarBounds.y; - lp.topMargin = mInsets.top + edgeMarginPx; + lp.topMargin = mInsets.top + edgeMarginPx / 2; searchBar.setLayoutParams(lp); // Layout the workspace diff --git a/src/com/android/launcher3/IconCache.java b/src/com/android/launcher3/IconCache.java index ad816afbc..09ca5c5cd 100644 --- a/src/com/android/launcher3/IconCache.java +++ b/src/com/android/launcher3/IconCache.java @@ -749,7 +749,7 @@ public class IconCache { } private static final class IconDB extends SQLiteCacheHelper { - private final static int DB_VERSION = 14; + private final static int DB_VERSION = 15; private final static int RELEASE_VERSION = DB_VERSION + (FeatureFlags.LAUNCHER3_DISABLE_ICON_NORMALIZATION ? 0 : 1); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index bd006c718..bb32a4563 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1413,7 +1413,6 @@ public class Launcher extends BaseActivity BubbleTextView favorite = (BubbleTextView) LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_icon, parent, false); favorite.applyFromShortcutInfo(info); - favorite.setCompoundDrawablePadding(mDeviceProfile.iconDrawablePaddingPx); favorite.setOnClickListener(this); favorite.setOnFocusChangeListener(mFocusHandler); return favorite; diff --git a/src/com/android/launcher3/ShortcutAndWidgetContainer.java b/src/com/android/launcher3/ShortcutAndWidgetContainer.java index f8742f895..3a3e13d22 100644 --- a/src/com/android/launcher3/ShortcutAndWidgetContainer.java +++ b/src/com/android/launcher3/ShortcutAndWidgetContainer.java @@ -120,7 +120,7 @@ public class ShortcutAndWidgetContainer extends ViewGroup { // Center the icon/folder int cHeight = getCellContentHeight(); int cellPaddingY = (int) Math.max(0, ((lp.height - cHeight) / 2f)); - int cellPaddingX = (int) (profile.edgeMarginPx / 2f); + int cellPaddingX = profile.cellPaddingXPx; child.setPadding(cellPaddingX, cellPaddingY, cellPaddingX, 0); } } else { diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java index f66995f70..d421a0e4c 100644 --- a/src/com/android/launcher3/WidgetPreviewLoader.java +++ b/src/com/android/launcher3/WidgetPreviewLoader.java @@ -111,7 +111,7 @@ public class WidgetPreviewLoader { * sizes (landscape vs portrait). */ private static class CacheDb extends SQLiteCacheHelper { - private static final int DB_VERSION = 6; + private static final int DB_VERSION = 7; private static final String TABLE_NAME = "shortcut_and_widget_previews"; private static final String COLUMN_COMPONENT = "componentName"; |