Move NavButtons to end of taskbar

* Layout hotseat icons from the end instead of the start
* IME down and system back arrow are now separate views

Bug: 191399224
Test: Tested w/ RTL + LTR in gesture
and 3 button nav w/ and w/o IME

Change-Id: I4d0ecd0bee0c519892c63eeefef45055b26d349b
This commit is contained in:
Vinit Nayak
2021-07-19 12:53:28 -07:00
parent 5bd217414c
commit 8dcbde87c0
6 changed files with 65 additions and 44 deletions

View File

@@ -777,7 +777,7 @@ public class DeviceProfile {
int taskbarOffset = getTaskbarOffsetY();
int hotseatTopDiff = hotseatHeight - taskbarSize - taskbarOffset;
int startOffset = ApiWrapper.getHotseatStartOffset(context);
int endOffset = ApiWrapper.getHotseatEndOffset(context);
int requiredWidth = iconSizePx * numShownHotseatIcons;
Resources res = context.getResources();
@@ -785,16 +785,16 @@ public class DeviceProfile {
float taskbarIconSpacing = 2 * res.getDimension(R.dimen.taskbar_icon_spacing);
int maxSize = (int) (requiredWidth
* (taskbarIconSize + taskbarIconSpacing) / taskbarIconSize);
int hotseatSize = Math.min(maxSize, availableWidthPx - startOffset);
int hotseatSize = Math.min(maxSize, availableWidthPx - endOffset);
int sideSpacing = (availableWidthPx - hotseatSize) / 2;
mHotseatPadding.set(sideSpacing, hotseatTopDiff, sideSpacing, taskbarOffset);
if (startOffset > sideSpacing) {
if (endOffset > sideSpacing) {
int diff = Utilities.isRtl(context.getResources())
? sideSpacing - startOffset
: startOffset - sideSpacing;
mHotseatPadding.left += diff;
mHotseatPadding.right -= diff;
? sideSpacing - endOffset
: endOffset - sideSpacing;
mHotseatPadding.left -= diff;
mHotseatPadding.right += diff;
}
} else {
// We want the edges of the hotseat to line up with the edges of the workspace, but the