diff options
author | Jon Miranda <jonmiranda@google.com> | 2018-07-31 11:14:46 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2018-07-31 11:15:01 -0700 |
commit | 5eacbb7fc11d9e58c8674e9fcb8c991b93a8167c (patch) | |
tree | 0a17d46265d6e39f943a62e9f8cf301e9ed4faf7 /src | |
parent | fc254baf881f50abf9bcdf78a30fc175762385d4 (diff) | |
download | android_packages_apps_Trebuchet-5eacbb7fc11d9e58c8674e9fcb8c991b93a8167c.tar.gz android_packages_apps_Trebuchet-5eacbb7fc11d9e58c8674e9fcb8c991b93a8167c.tar.bz2 android_packages_apps_Trebuchet-5eacbb7fc11d9e58c8674e9fcb8c991b93a8167c.zip |
Update launcher grid for tablet devices.
* Number of hotseat icons matches number of workspace columns.
* Evenly space out the workspace icons.
Bug: 111617973
Change-Id: Ia80e6354c8d449f2a397db5fd432cebc9f23027f
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 820c125e1..9839c12dc 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -59,6 +59,9 @@ public class DeviceProfile { private static final float TALL_DEVICE_ASPECT_RATIO_THRESHOLD = 2.0f; + // To evenly space the icons, increase the left/right margins for tablets in portrait mode. + private static final int PORTRAIT_TABLET_LEFT_RIGHT_PADDING_MULTIPLIER = 4; + // Workspace public final int desiredWorkspaceLeftRightMarginPx; public final int cellLayoutPaddingLeftRightPx; @@ -172,7 +175,9 @@ public class DeviceProfile { defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null); edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx; - cellLayoutPaddingLeftRightPx = + int cellLayoutPaddingLeftRightMultiplier = !isVerticalBarLayout() && isTablet + ? PORTRAIT_TABLET_LEFT_RIGHT_PADDING_MULTIPLIER : 1; + cellLayoutPaddingLeftRightPx = cellLayoutPaddingLeftRightMultiplier * res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); cellLayoutBottomPaddingPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_bottom_padding); |