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

Commit 98d33cdf authored by Alex Chau's avatar Alex Chau Committed by Android (Google) Code Review
Browse files

Merge "Set iconsSizePx of Taskbar's DeviceProfile directly" into tm-qpr-dev

parents 346ca5ab a68164d8
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -270,14 +270,13 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
    }

    private void updateIconSize(Resources resources) {
        float taskbarIconSize = resources.getDimension(DisplayController.isTransientTaskbar(this)
        mDeviceProfile.iconSizePx = resources.getDimensionPixelSize(
                DisplayController.isTransientTaskbar(this)
                    ? mDeviceProfile.isTwoPanels
                            ? R.dimen.transient_taskbar_two_panels_icon_size
                            : R.dimen.transient_taskbar_icon_size
                    : R.dimen.taskbar_icon_size);
        mDeviceProfile.updateIconSize(1, resources);
        float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx;
        mDeviceProfile.updateIconSize(iconScale, resources);
        mDeviceProfile.updateIconSize(1f, resources);
    }

    /**
+5 −6
Original line number Diff line number Diff line
@@ -817,6 +817,11 @@ public class DeviceProfile {
     * Returns the amount of extra (or unused) vertical space.
     */
    private int updateAvailableDimensions(Resources res) {
        float invIconSizeDp = inv.iconSize[mTypeIndex];
        float invIconTextSizeSp = inv.iconTextSize[mTypeIndex];
        iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics));
        iconTextSizePx = pxFromSp(invIconTextSizeSp, mMetrics);

        updateIconSize(1f, res);

        updateWorkspacePadding();
@@ -873,13 +878,7 @@ public class DeviceProfile {

        // Workspace
        final boolean isVerticalLayout = isVerticalBarLayout();
        float invIconSizeDp = inv.iconSize[mTypeIndex];
        float invIconTextSizeSp = inv.iconTextSize[mTypeIndex];

        iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics));
        iconTextSizePx = pxFromSp(invIconTextSizeSp, mMetrics);
        iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * iconScale);

        cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv, scale);

        if (isScalableGrid) {