mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user