Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fa475a0 authored by Kshitij's avatar Kshitij
Browse files

fix: Improve dock paddings in VerticalBarLayout

parent c958bd89
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -1365,6 +1365,7 @@ public class DeviceProfile {
        // Make sure to update all relevant sizes for cutout and orientation
        updateHotseatSizes(pxFromDp(inv.iconSize[INDEX_DEFAULT], mMetrics));
        Rect hotseatBarPadding = new Rect();
        boolean isFullyGesture = mInfo.navigationMode == NavigationMode.NO_BUTTON;
        if (isVerticalBarLayout()) {
            // The hotseat icons will be placed in the middle of the hotseat cells.
            // Changing the hotseatCellHeightPx is not affecting hotseat icon positions
@@ -1376,12 +1377,17 @@ public class DeviceProfile {
                    - diffOverlapFactor), 0);
            int paddingBottom = Math.max((int) (mInsets.bottom + cellLayoutPaddingPx.bottom
                    + diffOverlapFactor), 0);
            int remainingSpace = (hotseatBarSizePx - hotseatCellHeightPx);
            int horizontalMargin = remainingSpace / 2;
            int navigationPadding;
            if (isSeascape()) {
                hotseatBarPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
                        hotseatBarSidePaddingEndPx, paddingBottom);
                navigationPadding = isFullyGesture ? 0 : mInsets.left;
                hotseatBarPadding.set(horizontalMargin + navigationPadding, paddingTop,
                        horizontalMargin, paddingBottom);
            } else {
                hotseatBarPadding.set(hotseatBarSidePaddingEndPx, paddingTop,
                        mInsets.right + hotseatBarSidePaddingStartPx, paddingBottom);
                navigationPadding = isFullyGesture ? 0 : mInsets.right;
                hotseatBarPadding.set(horizontalMargin, paddingTop,
                        horizontalMargin + navigationPadding, paddingBottom);
            }
        } else if (isTaskbarPresent) {
            // Center the QSB vertically with hotseat
@@ -1425,7 +1431,6 @@ public class DeviceProfile {
            float hotseatCellWidth = (float) widthPx / numShownHotseatIcons;
            int hotseatAdjustment = Math.round((workspaceCellWidth - hotseatCellWidth) / 2);
            int hotseatIconMargin = Math.abs(hotseatCellHeightPx - iconSizePx);
            boolean isFullyGesture = mInfo.navigationMode == NavigationMode.NO_BUTTON;
            boolean noHint = isFullyGesture && LineageSettings.System.getInt(
                    context.getContentResolver(), LineageSettings.System.NAVIGATION_BAR_HINT, 0) != 1;
            // Values obtained by manual validation, independent of dpi and display scale