diff --git a/quickstep/res/values-sw600dp/config.xml b/quickstep/res/values-sw600dp/config.xml new file mode 100644 index 0000000000..e1e442f0a9 --- /dev/null +++ b/quickstep/res/values-sw600dp/config.xml @@ -0,0 +1,21 @@ + + + + + + + true + \ No newline at end of file diff --git a/quickstep/res/values-sw720dp-land/config.xml b/quickstep/res/values-sw720dp-land/config.xml new file mode 100644 index 0000000000..bf0f9adea8 --- /dev/null +++ b/quickstep/res/values-sw720dp-land/config.xml @@ -0,0 +1,21 @@ + + + + + + + false + \ No newline at end of file diff --git a/quickstep/res/values-sw720dp/config.xml b/quickstep/res/values-sw720dp/config.xml new file mode 100644 index 0000000000..e1e442f0a9 --- /dev/null +++ b/quickstep/res/values-sw720dp/config.xml @@ -0,0 +1,21 @@ + + + + + + + true + \ No newline at end of file diff --git a/quickstep/res/values/config.xml b/quickstep/res/values/config.xml index d58158207d..b61bdfbc20 100644 --- a/quickstep/res/values/config.xml +++ b/quickstep/res/values/config.xml @@ -51,4 +51,8 @@ + + + + false diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index 3d5089fc07..7ff988ccdd 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -91,6 +91,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar private float mTransientTaskbarAllAppsButtonTranslationXOffset; + private final boolean mStartAlignTaskbar; + public TaskbarView(@NonNull Context context) { this(context, null); } @@ -118,6 +120,8 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar resources.getDimension(isTransientTaskbar ? R.dimen.transient_taskbar_all_apps_button_translation_x_offset : R.dimen.taskbar_all_apps_button_translation_x_offset); + mStartAlignTaskbar = mActivityContext.isThreeButtonNav() + && resources.getBoolean(R.bool.start_align_taskbar); int actualMargin = resources.getDimensionPixelSize(R.dimen.taskbar_icon_spacing); int actualIconSize = mActivityContext.getDeviceProfile().iconSizePx; @@ -343,10 +347,22 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar boolean needMoreSpaceForNav = layoutRtl ? navSpaceNeeded > (iconEnd - spaceNeeded) : iconEnd > (right - navSpaceNeeded); - if (needMoreSpaceForNav) { - int offset = layoutRtl ? - navSpaceNeeded - (iconEnd - spaceNeeded) : - (right - navSpaceNeeded) - iconEnd; + + if (mStartAlignTaskbar) { + // Taskbar is aligned to the start + int startSpacingPx = deviceProfile.inlineNavButtonsEndSpacingPx; + + if (layoutRtl) { + iconEnd = right - startSpacingPx; + } else { + iconEnd = startSpacingPx + spaceNeeded; + } + } else if (needMoreSpaceForNav) { + // Add offset to account for nav bar when taskbar is centered + int offset = layoutRtl + ? navSpaceNeeded - (iconEnd - spaceNeeded) + : (right - navSpaceNeeded) - iconEnd; + iconEnd += offset; } diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 87ee4f65ec..d992ee0085 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -193,7 +193,7 @@ public class DeviceProfile { private final int mMinHotseatIconSpacePx; private final int mMinHotseatQsbWidthPx; private final int mMaxHotseatIconSpacePx; - private final int mInlineNavButtonsEndSpacingPx; + public final int inlineNavButtonsEndSpacingPx; // Bottom sheets public int bottomSheetTopPadding; @@ -490,7 +490,7 @@ public class DeviceProfile { hotseatBarSidePaddingStartPx = isVerticalBarLayout() ? workspacePageIndicatorHeight : 0; updateHotseatSizes(pxFromDp(inv.iconSize[INDEX_DEFAULT], mMetrics)); if (areNavButtonsInline && !isPhone) { - mInlineNavButtonsEndSpacingPx = + inlineNavButtonsEndSpacingPx = res.getDimensionPixelSize(inv.inlineNavButtonsEndSpacing); /* * 3 nav buttons + @@ -499,9 +499,9 @@ public class DeviceProfile { */ hotseatBarEndOffset = 3 * res.getDimensionPixelSize(R.dimen.taskbar_nav_buttons_size) + 2 * res.getDimensionPixelSize(R.dimen.taskbar_button_space_inbetween) - + mInlineNavButtonsEndSpacingPx; + + inlineNavButtonsEndSpacingPx; } else { - mInlineNavButtonsEndSpacingPx = 0; + inlineNavButtonsEndSpacingPx = 0; hotseatBarEndOffset = 0; } @@ -662,7 +662,7 @@ public class DeviceProfile { } // The side space with inline buttons should be what is defined in InvariantDeviceProfile - int sideSpacePx = mInlineNavButtonsEndSpacingPx; + int sideSpacePx = inlineNavButtonsEndSpacingPx; int maxHotseatWidthPx = availableWidthPx - sideSpacePx - hotseatBarEndOffset; int maxHotseatIconsWidthPx = maxHotseatWidthPx - (isQsbInline ? hotseatQsbWidth : 0); hotseatBorderSpace = calculateHotseatBorderSpace(maxHotseatIconsWidthPx, @@ -1320,7 +1320,7 @@ public class DeviceProfile { int endSpacing; // Hotseat aligns to the left with nav buttons if (hotseatBarEndOffset > 0) { - startSpacing = mInlineNavButtonsEndSpacingPx; + startSpacing = inlineNavButtonsEndSpacingPx; endSpacing = availableWidthPx - hotseatWidth - startSpacing + hotseatBorderSpace; } else { startSpacing = (availableWidthPx - hotseatWidth) / 2;