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

Commit 9b2b607a authored by Tony Wickham's avatar Tony Wickham
Browse files

Fix taskbar hotseat alignment

- Use hotseatBorderSpace instead of cellLayoutBorderSpace
- Also divide by 2f instead of 2 because AS was complaining. May or may not potentially address off by 1 pixel issues.

Test: locally set alignment = 1, ensure perfectly aligned
Fixes: 218880076
Change-Id: Ifec30e6727f62985427b65b6c0b0810e7f7cd695
parent 31a4c539
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -211,7 +211,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
        PendingAnimation setter = new PendingAnimation(100);
        PendingAnimation setter = new PendingAnimation(100);
        Rect hotseatPadding = launcherDp.getHotseatLayoutPadding(mActivity);
        Rect hotseatPadding = launcherDp.getHotseatLayoutPadding(mActivity);
        float scaleUp = ((float) launcherDp.iconSizePx) / mActivity.getDeviceProfile().iconSizePx;
        float scaleUp = ((float) launcherDp.iconSizePx) / mActivity.getDeviceProfile().iconSizePx;
        int borderSpacing = launcherDp.cellLayoutBorderSpacePx.x;
        int borderSpacing = launcherDp.hotseatBorderSpace;
        int hotseatCellSize = DeviceProfile.calculateCellWidth(
        int hotseatCellSize = DeviceProfile.calculateCellWidth(
                launcherDp.availableWidthPx - hotseatPadding.left - hotseatPadding.right,
                launcherDp.availableWidthPx - hotseatPadding.left - hotseatPadding.right,
                borderSpacing,
                borderSpacing,
@@ -247,9 +247,9 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar


            float hotseatIconCenter = hotseatPadding.left
            float hotseatIconCenter = hotseatPadding.left
                    + (hotseatCellSize + borderSpacing) * positionInHotseat
                    + (hotseatCellSize + borderSpacing) * positionInHotseat
                    + hotseatCellSize / 2;
                    + hotseatCellSize / 2f;


            float childCenter = (child.getLeft() + child.getRight()) / 2;
            float childCenter = (child.getLeft() + child.getRight()) / 2f;
            setter.setFloat(child, ICON_TRANSLATE_X, hotseatIconCenter - childCenter, LINEAR);
            setter.setFloat(child, ICON_TRANSLATE_X, hotseatIconCenter - childCenter, LINEAR);


            setter.setFloat(child, SCALE_PROPERTY, scaleUp, LINEAR);
            setter.setFloat(child, SCALE_PROPERTY, scaleUp, LINEAR);