summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-06-12 15:01:15 -0700
committerTony Wickham <twickham@google.com>2018-06-13 12:37:47 -0700
commit1eeffbee0128cac1bc64c948008bb28788c06c0f (patch)
tree2b60451c0d630d919e3a1d4dc5e0d7965dd28c83 /src/com/android/launcher3/DeviceProfile.java
parent59ffaf035d2f9a1273072483004d9a4a0abbb5b9 (diff)
downloadandroid_packages_apps_Trebuchet-1eeffbee0128cac1bc64c948008bb28788c06c0f.tar.gz
android_packages_apps_Trebuchet-1eeffbee0128cac1bc64c948008bb28788c06c0f.tar.bz2
android_packages_apps_Trebuchet-1eeffbee0128cac1bc64c948008bb28788c06c0f.zip
Add padding between hotseat and insets in multiwindow landscape
Right now there's almost no room between the hotseat icons and the nav bar in this mode, and it looks kind of bad. It also causes b/109946631 which is fixed by this change. Also fix placement of popup in RTL landscape (was incorrectly inset) Bug: 109946631 Change-Id: I324485da0048b907776b16b719b631c5314e5696
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 2f4772806..20c4a5fdf 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -102,7 +102,9 @@ public class DeviceProfile {
public int hotseatBarSizePx;
public final int hotseatBarTopPaddingPx;
public final int hotseatBarBottomPaddingPx;
- public final int hotseatBarSidePaddingPx;
+ // Start is the side next to the nav bar, end is the side next to the workspace
+ public final int hotseatBarSidePaddingStartPx;
+ public final int hotseatBarSidePaddingEndPx;
// All apps
public int allAppsCellHeightPx;
@@ -178,10 +180,14 @@ public class DeviceProfile {
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_top_padding);
hotseatBarBottomPaddingPx =
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_bottom_padding);
- hotseatBarSidePaddingPx =
+ hotseatBarSidePaddingEndPx =
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_side_padding);
+ // Add a bit of space between nav bar and hotseat in multi-window vertical bar layout.
+ hotseatBarSidePaddingStartPx = isMultiWindowMode && isVerticalBarLayout()
+ ? edgeMarginPx : 0;
hotseatBarSizePx = isVerticalBarLayout()
- ? Utilities.pxFromDp(inv.iconSize, dm)
+ ? Utilities.pxFromDp(inv.iconSize, dm) + hotseatBarSidePaddingStartPx
+ + hotseatBarSidePaddingEndPx
: res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_size)
+ hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx;
@@ -326,7 +332,8 @@ public class DeviceProfile {
// Hotseat
if (isVerticalLayout) {
- hotseatBarSizePx = iconSizePx;
+ hotseatBarSizePx = iconSizePx + hotseatBarSidePaddingStartPx
+ + hotseatBarSidePaddingEndPx;
}
hotseatCellHeightPx = iconSizePx;
@@ -425,14 +432,12 @@ public class DeviceProfile {
if (isVerticalBarLayout()) {
padding.top = 0;
padding.bottom = edgeMarginPx;
- padding.left = hotseatBarSidePaddingPx;
- padding.right = hotseatBarSidePaddingPx;
if (isSeascape()) {
- padding.left += hotseatBarSizePx;
- padding.right += verticalDragHandleSizePx;
+ padding.left = hotseatBarSizePx;
+ padding.right = verticalDragHandleSizePx;
} else {
- padding.left += verticalDragHandleSizePx;
- padding.right += hotseatBarSizePx;
+ padding.left = verticalDragHandleSizePx;
+ padding.right = hotseatBarSizePx;
}
} else {
int paddingBottom = hotseatBarSizePx + verticalDragHandleSizePx;
@@ -462,11 +467,11 @@ public class DeviceProfile {
public Rect getHotseatLayoutPadding() {
if (isVerticalBarLayout()) {
if (isSeascape()) {
- mHotseatPadding.set(
- mInsets.left, mInsets.top, hotseatBarSidePaddingPx, mInsets.bottom);
+ mHotseatPadding.set(mInsets.left + hotseatBarSidePaddingStartPx,
+ mInsets.top, hotseatBarSidePaddingEndPx, mInsets.bottom);
} else {
- mHotseatPadding.set(
- hotseatBarSidePaddingPx, mInsets.top, mInsets.right, mInsets.bottom);
+ mHotseatPadding.set(hotseatBarSidePaddingEndPx, mInsets.top,
+ mInsets.right + hotseatBarSidePaddingStartPx, mInsets.bottom);
}
} else {