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

Commit 38bb3b0c authored by Sihua Ma's avatar Sihua Ma
Browse files

Aligning Hotseat and Workspace icons in vertical bar mode

Changing the padding of the Hotseat Bar to align the hotseat icons with the Workspace icons.

Test: Manual
Fix: 223553482
Change-Id: I7939c3a900dfe22d2ce3f71d408f1d2778a0af2a
parent f8137e5e
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -979,8 +979,17 @@ public class DeviceProfile {
     */
     */
    public Rect getHotseatLayoutPadding(Context context) {
    public Rect getHotseatLayoutPadding(Context context) {
        if (isVerticalBarLayout()) {
        if (isVerticalBarLayout()) {
            int paddingTop = Math.max(mInsets.top - cellLayoutPaddingPx.top, 0);
            // The hotseat icons will be placed in the middle of the hotseat cells.
            int paddingBottom = Math.max(mInsets.bottom - cellLayoutPaddingPx.bottom, 0);
            // Changing the hotseatCellHeightPx is not affecting hotseat icon positions
            // in vertical bar layout.
            // Workspace icons are moved up by a small factor. The variable diffOverlapFactor
            // is set to account for that difference.
            float diffOverlapFactor = iconSizePx * (ICON_OVERLAP_FACTOR - 1) / 2;
            int paddingTop = Math.max((int) (mInsets.top + cellLayoutPaddingPx.top
                    - diffOverlapFactor), 0);
            int paddingBottom = Math.max((int) (mInsets.bottom + cellLayoutPaddingPx.bottom
                    + diffOverlapFactor), 0);

            if (isSeascape()) {
            if (isSeascape()) {
                mHotseatPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
                mHotseatPadding.set(mInsets.left + hotseatBarSidePaddingStartPx, paddingTop,
                        hotseatBarSidePaddingEndPx, paddingBottom);
                        hotseatBarSidePaddingEndPx, paddingBottom);