summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Miranda <jonmiranda@google.com>2018-08-02 22:16:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-08-02 22:16:06 +0000
commitf42df37951d7548037a42672b648429240c6c698 (patch)
tree43796d286ef4208c6eac9c6f858cd9c12205f3f9
parent37ff8be69258b0f0b3c30d5e4cebca43a009b561 (diff)
parent5eacbb7fc11d9e58c8674e9fcb8c991b93a8167c (diff)
downloadandroid_packages_apps_Trebuchet-f42df37951d7548037a42672b648429240c6c698.tar.gz
android_packages_apps_Trebuchet-f42df37951d7548037a42672b648429240c6c698.tar.bz2
android_packages_apps_Trebuchet-f42df37951d7548037a42672b648429240c6c698.zip
Merge "Update launcher grid for tablet devices." into ub-launcher3-edmonton-polish
-rw-r--r--res/xml/device_profiles.xml8
-rw-r--r--src/com/android/launcher3/DeviceProfile.java7
2 files changed, 10 insertions, 5 deletions
diff --git a/res/xml/device_profiles.xml b/res/xml/device_profiles.xml
index a34f22515..ef6e14506 100644
--- a/res/xml/device_profiles.xml
+++ b/res/xml/device_profiles.xml
@@ -133,13 +133,13 @@
launcher:name="Nexus 7"
launcher:minWidthDps="575"
launcher:minHeightDps="904"
- launcher:numRows="5"
+ launcher:numRows="6"
launcher:numColumns="6"
launcher:numFolderRows="4"
launcher:numFolderColumns="5"
launcher:iconSize="64"
launcher:iconTextSize="14.4"
- launcher:numHotseatIcons="7"
+ launcher:numHotseatIcons="6"
launcher:defaultLayoutId="@xml/default_workspace_5x6"
/>
@@ -147,8 +147,8 @@
launcher:name="Nexus 10"
launcher:minWidthDps="727"
launcher:minHeightDps="1207"
- launcher:numRows="5"
- launcher:numColumns="6"
+ launcher:numRows="6"
+ launcher:numColumns="7"
launcher:numFolderRows="4"
launcher:numFolderColumns="5"
launcher:iconSize="76"
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);