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

Commit 206ede9c authored by Alex Chau's avatar Alex Chau
Browse files

Adjust height of tablet AllApps base on row height

- Also used hotseatQsbHeight for AllApps QSB height as they have to match to transform between each other

Fix: 232907846
Test: manual on different tablets
Test: atest DeviceProfileTest
Change-Id: I001d0e129db2a5de6c8ace4c3302381110da03f1
parent 7db37b3d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -314,10 +314,10 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
                int qsbEnd;
                int qsbEnd;
                if (layoutRtl) {
                if (layoutRtl) {
                    qsbStart = iconEnd + mItemMarginLeftRight;
                    qsbStart = iconEnd + mItemMarginLeftRight;
                    qsbEnd = qsbStart + deviceProfile.qsbWidth;
                    qsbEnd = qsbStart + deviceProfile.hotseatQsbWidth;
                } else {
                } else {
                    qsbEnd = iconEnd - mItemMarginLeftRight;
                    qsbEnd = iconEnd - mItemMarginLeftRight;
                    qsbStart = qsbEnd - deviceProfile.qsbWidth;
                    qsbStart = qsbEnd - deviceProfile.hotseatQsbWidth;
                }
                }
                int qsbTop = (bottom - top - deviceProfile.hotseatQsbHeight) / 2;
                int qsbTop = (bottom - top - deviceProfile.hotseatQsbHeight) / 2;
                int qsbBottom = qsbTop + deviceProfile.hotseatQsbHeight;
                int qsbBottom = qsbTop + deviceProfile.hotseatQsbHeight;
+5 −4
Original line number Original line Diff line number Diff line
@@ -295,10 +295,11 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
                boolean isRtl = Utilities.isRtl(child.getResources());
                boolean isRtl = Utilities.isRtl(child.getResources());
                float hotseatIconCenter = isRtl
                float hotseatIconCenter = isRtl
                        ? launcherDp.widthPx - hotseatPadding.right + borderSpacing
                        ? launcherDp.widthPx - hotseatPadding.right + borderSpacing
                        + launcherDp.qsbWidth / 2f
                        + launcherDp.hotseatQsbWidth / 2f
                        : hotseatPadding.left - borderSpacing - launcherDp.qsbWidth / 2f;
                        : hotseatPadding.left - borderSpacing - launcherDp.hotseatQsbWidth / 2f;
                float childCenter = (child.getLeft() + child.getRight()) / 2f;
                float childCenter = (child.getLeft() + child.getRight()) / 2f;
                float halfQsbIconWidthDiff = (launcherDp.qsbWidth - taskbarDp.iconSizePx) / 2f;
                float halfQsbIconWidthDiff =
                        (launcherDp.hotseatQsbWidth - taskbarDp.iconSizePx) / 2f;
                setter.addFloat(child, ICON_TRANSLATE_X,
                setter.addFloat(child, ICON_TRANSLATE_X,
                        isRtl ? -halfQsbIconWidthDiff : halfQsbIconWidthDiff,
                        isRtl ? -halfQsbIconWidthDiff : halfQsbIconWidthDiff,
                        hotseatIconCenter - childCenter, LINEAR);
                        hotseatIconCenter - childCenter, LINEAR);
@@ -312,7 +313,7 @@ public class TaskbarViewController implements TaskbarControllers.LoggableTaskbar
                                : Interpolators.clampToProgress(LINEAR, 0.84f, 1f));
                                : Interpolators.clampToProgress(LINEAR, 0.84f, 1f));
                setter.addOnFrameListener(animator -> AlphaUpdateListener.updateVisibility(child));
                setter.addOnFrameListener(animator -> AlphaUpdateListener.updateVisibility(child));


                float qsbInsetFraction = halfQsbIconWidthDiff / launcherDp.qsbWidth;
                float qsbInsetFraction = halfQsbIconWidthDiff / launcherDp.hotseatQsbWidth;
                if (child instanceof  HorizontalInsettableView) {
                if (child instanceof  HorizontalInsettableView) {
                    setter.addFloat((HorizontalInsettableView) child,
                    setter.addFloat((HorizontalInsettableView) child,
                            HorizontalInsettableView.HORIZONTAL_INSETS, qsbInsetFraction, 0,
                            HorizontalInsettableView.HORIZONTAL_INSETS, qsbInsetFraction, 0,
+16 −16
Original line number Original line Diff line number Diff line
@@ -110,7 +110,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 4\n" +
                "\tnumShownHotseatIcons: 4\n" +
                "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
                "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 913.0px (347.8095dp)\n" +
                "\thotseatQsbWidth: 913.0px (347.8095dp)\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
@@ -229,7 +229,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 4\n" +
                "\tnumShownHotseatIcons: 4\n" +
                "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
                "\thotseatBorderSpace: 95.0px (36.190475dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 913.0px (347.8095dp)\n" +
                "\thotseatQsbWidth: 913.0px (347.8095dp)\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
@@ -349,7 +349,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 5\n" +
                "\tnumShownHotseatIcons: 5\n" +
                "\thotseatBorderSpace: 101.0px (50.5dp)\n" +
                "\thotseatBorderSpace: 101.0px (50.5dp)\n" +
                "\tisQsbInline: true\n" +
                "\tisQsbInline: true\n" +
                "\tqsbWidth: 855.0px (427.5dp)\n" +
                "\thotseatQsbWidth: 855.0px (427.5dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
@@ -469,7 +469,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 6\n" +
                "\tnumShownHotseatIcons: 6\n" +
                "\thotseatBorderSpace: 100.0px (50.0dp)\n" +
                "\thotseatBorderSpace: 100.0px (50.0dp)\n" +
                "\tisQsbInline: true\n" +
                "\tisQsbInline: true\n" +
                "\tqsbWidth: 640.0px (320.0dp)\n" +
                "\thotseatQsbWidth: 640.0px (320.0dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
@@ -560,8 +560,8 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
                "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
                "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
                "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
                "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
                "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
                "\tallAppsShiftRange: 1856.0px (928.0dp)\n" +
                "\tallAppsShiftRange: 1936.0px (968.0dp)\n" +
                "\tallAppsTopPadding: 704.0px (352.0dp)\n" +
                "\tallAppsTopPadding: 624.0px (312.0dp)\n" +
                "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
                "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
                "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
                "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
                "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
                "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
@@ -589,7 +589,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 5\n" +
                "\tnumShownHotseatIcons: 5\n" +
                "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
                "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1300.0px (650.0dp)\n" +
                "\thotseatQsbWidth: 1300.0px (650.0dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
@@ -680,8 +680,8 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
                "\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
                "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
                "\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
                "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
                "\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
                "\tallAppsShiftRange: 1856.0px (928.0dp)\n" +
                "\tallAppsShiftRange: 1936.0px (968.0dp)\n" +
                "\tallAppsTopPadding: 704.0px (352.0dp)\n" +
                "\tallAppsTopPadding: 624.0px (312.0dp)\n" +
                "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
                "\tallAppsIconSizePx: 120.0px (60.0dp)\n" +
                "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
                "\tallAppsIconTextSizePx: 28.0px (14.0dp)\n" +
                "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
                "\tallAppsIconDrawablePaddingPx: 14.0px (7.0dp)\n" +
@@ -709,7 +709,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 6\n" +
                "\tnumShownHotseatIcons: 6\n" +
                "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
                "\thotseatBorderSpace: 116.0px (58.0dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1300.0px (650.0dp)\n" +
                "\thotseatQsbWidth: 1300.0px (650.0dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
                "\ttaskbarSize: 120.0px (60.0dp)\n" +
@@ -829,7 +829,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 6\n" +
                "\tnumShownHotseatIcons: 6\n" +
                "\thotseatBorderSpace: 61.0px (23.238094dp)\n" +
                "\thotseatBorderSpace: 61.0px (23.238094dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1467.0px (558.8571dp)\n" +
                "\thotseatQsbWidth: 1467.0px (558.8571dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
@@ -949,7 +949,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 6\n" +
                "\tnumShownHotseatIcons: 6\n" +
                "\thotseatBorderSpace: 105.0px (40.0dp)\n" +
                "\thotseatBorderSpace: 105.0px (40.0dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1467.0px (558.8571dp)\n" +
                "\thotseatQsbWidth: 1467.0px (558.8571dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
@@ -1069,7 +1069,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 6\n" +
                "\tnumShownHotseatIcons: 6\n" +
                "\thotseatBorderSpace: 47.0px (17.904762dp)\n" +
                "\thotseatBorderSpace: 47.0px (17.904762dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1236.0px (470.85715dp)\n" +
                "\thotseatQsbWidth: 1236.0px (470.85715dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
@@ -1189,7 +1189,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 6\n" +
                "\tnumShownHotseatIcons: 6\n" +
                "\thotseatBorderSpace: 84.0px (32.0dp)\n" +
                "\thotseatBorderSpace: 84.0px (32.0dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1236.0px (470.85715dp)\n" +
                "\thotseatQsbWidth: 1236.0px (470.85715dp)\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresent:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\tisTaskbarPresentInApps:true\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
                "\ttaskbarSize: 158.0px (60.190475dp)\n" +
@@ -1308,7 +1308,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 4\n" +
                "\tnumShownHotseatIcons: 4\n" +
                "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
                "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1525.0px (580.9524dp)\n" +
                "\thotseatQsbWidth: 1525.0px (580.9524dp)\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
@@ -1427,7 +1427,7 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
                "\tnumShownHotseatIcons: 4\n" +
                "\tnumShownHotseatIcons: 4\n" +
                "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
                "\thotseatBorderSpace: 0.0px (0.0dp)\n" +
                "\tisQsbInline: false\n" +
                "\tisQsbInline: false\n" +
                "\tqsbWidth: 1621.0px (617.5238dp)\n" +
                "\thotseatQsbWidth: 1621.0px (617.5238dp)\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresent:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\tisTaskbarPresentInApps:false\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
                "\ttaskbarSize: 0.0px (0.0dp)\n" +
+21 −11
Original line number Original line Diff line number Diff line
@@ -38,7 +38,6 @@ import android.view.Surface;


import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.CellLayout.ContainerType;
import com.android.launcher3.DevicePaddings.DevicePadding;
import com.android.launcher3.DevicePaddings.DevicePadding;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.icons.DotRenderer;
import com.android.launcher3.icons.GraphicsUtils;
import com.android.launcher3.icons.GraphicsUtils;
import com.android.launcher3.icons.IconNormalizer;
import com.android.launcher3.icons.IconNormalizer;
@@ -54,6 +53,8 @@ import java.util.List;
public class DeviceProfile {
public class DeviceProfile {


    private static final int DEFAULT_DOT_SIZE = 100;
    private static final int DEFAULT_DOT_SIZE = 100;
    private static final float ALL_APPS_TABLET_MAX_ROWS = 5.5f;

    // Ratio of empty space, qsb should take up to appear visually centered.
    // Ratio of empty space, qsb should take up to appear visually centered.
    private final float mQsbCenterFactor;
    private final float mQsbCenterFactor;


@@ -167,13 +168,12 @@ public class DeviceProfile {
    // Start is the side next to the nav bar, end is the side next to the workspace
    // Start is the side next to the nav bar, end is the side next to the workspace
    public final int hotseatBarSidePaddingStartPx;
    public final int hotseatBarSidePaddingStartPx;
    public final int hotseatBarSidePaddingEndPx;
    public final int hotseatBarSidePaddingEndPx;
    public int hotseatQsbWidth; // only used when isQsbInline
    public final int hotseatQsbHeight;
    public final int hotseatQsbHeight;
    public final int hotseatQsbVisualHeight;
    public final int hotseatQsbVisualHeight;
    private final int hotseatQsbShadowHeight;
    private final int hotseatQsbShadowHeight;
    public int hotseatBorderSpace;
    public int hotseatBorderSpace;


    public int qsbWidth; // only used when isQsbInline

    // All apps
    // All apps
    public Point allAppsBorderSpacePx;
    public Point allAppsBorderSpacePx;
    public int allAppsShiftRange;
    public int allAppsShiftRange;
@@ -309,10 +309,6 @@ public class DeviceProfile {
                + res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
                + res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
                + (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding
                + (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding


        allAppsTopPadding = isTablet ? bottomSheetTopPadding : 0;
        allAppsShiftRange = isTablet
                ? heightPx - allAppsTopPadding
                : res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);
        folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale);
        folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale);
        folderContentPaddingLeftRight =
        folderContentPaddingLeftRight =
                res.getDimensionPixelSize(R.dimen.folder_content_padding_left_right);
                res.getDimensionPixelSize(R.dimen.folder_content_padding_left_right);
@@ -463,7 +459,21 @@ public class DeviceProfile {


        // Hotseat and QSB width depends on updated cellSize and workspace padding
        // Hotseat and QSB width depends on updated cellSize and workspace padding
        hotseatBorderSpace = calculateHotseatBorderSpace();
        hotseatBorderSpace = calculateHotseatBorderSpace();
        qsbWidth = calculateQsbWidth();
        hotseatQsbWidth = calculateQsbWidth();

        // AllApps height calculation depends on updated cellSize
        if (isTablet) {
            int collapseHandleHeight =
                    res.getDimensionPixelOffset(R.dimen.bottom_sheet_handle_area_height);
            int contentHeight = heightPx - collapseHandleHeight - hotseatQsbHeight;
            int targetContentHeight = (int) (allAppsCellHeightPx * ALL_APPS_TABLET_MAX_ROWS);
            allAppsTopPadding = Math.max(mInsets.top, contentHeight - targetContentHeight);
            allAppsShiftRange = heightPx - allAppsTopPadding;
        } else {
            allAppsTopPadding = 0;
            allAppsShiftRange =
                    res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);
        }


        flingToDeleteThresholdVelocity = res.getDimensionPixelSize(
        flingToDeleteThresholdVelocity = res.getDimensionPixelSize(
                R.dimen.drag_flingToDeleteMinVelocity);
                R.dimen.drag_flingToDeleteMinVelocity);
@@ -1052,7 +1062,7 @@ public class DeviceProfile {
                    hotseatBarSizePx - hotseatBarBottomPadding - hotseatCellHeightPx;
                    hotseatBarSizePx - hotseatBarBottomPadding - hotseatCellHeightPx;


            // Push icons to the side
            // Push icons to the side
            int additionalQsbSpace = isQsbInline ? qsbWidth + hotseatBorderSpace : 0;
            int additionalQsbSpace = isQsbInline ? hotseatQsbWidth + hotseatBorderSpace : 0;
            int requiredWidth = iconSizePx * numShownHotseatIcons
            int requiredWidth = iconSizePx * numShownHotseatIcons
                    + hotseatBorderSpace * (numShownHotseatIcons - 1)
                    + hotseatBorderSpace * (numShownHotseatIcons - 1)
                    + additionalQsbSpace;
                    + additionalQsbSpace;
@@ -1077,7 +1087,7 @@ public class DeviceProfile {
                hotseatBarPadding.right += diff;
                hotseatBarPadding.right += diff;
            }
            }
        } else if (isScalableGrid) {
        } else if (isScalableGrid) {
            int sideSpacing = (availableWidthPx - qsbWidth) / 2;
            int sideSpacing = (availableWidthPx - hotseatQsbWidth) / 2;
            hotseatBarPadding.set(sideSpacing,
            hotseatBarPadding.set(sideSpacing,
                    0,
                    0,
                    sideSpacing,
                    sideSpacing,
@@ -1350,7 +1360,7 @@ public class DeviceProfile {
        writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons);
        writer.println(prefix + "\tnumShownHotseatIcons: " + numShownHotseatIcons);
        writer.println(prefix + pxToDpStr("hotseatBorderSpace", hotseatBorderSpace));
        writer.println(prefix + pxToDpStr("hotseatBorderSpace", hotseatBorderSpace));
        writer.println(prefix + "\tisQsbInline: " + isQsbInline);
        writer.println(prefix + "\tisQsbInline: " + isQsbInline);
        writer.println(prefix + pxToDpStr("qsbWidth", qsbWidth));
        writer.println(prefix + pxToDpStr("hotseatQsbWidth", hotseatQsbWidth));


        writer.println(prefix + "\tisTaskbarPresent:" + isTaskbarPresent);
        writer.println(prefix + "\tisTaskbarPresent:" + isTaskbarPresent);
        writer.println(prefix + "\tisTaskbarPresentInApps:" + isTaskbarPresentInApps);
        writer.println(prefix + "\tisTaskbarPresentInApps:" + isTaskbarPresentInApps);
+12 −15
Original line number Original line Diff line number Diff line
@@ -47,7 +47,6 @@ public class Hotseat extends CellLayout implements Insettable {
    private Consumer<Boolean> mOnVisibilityAggregatedCallback;
    private Consumer<Boolean> mOnVisibilityAggregatedCallback;


    private final View mQsb;
    private final View mQsb;
    private final int mQsbHeight;


    public Hotseat(Context context) {
    public Hotseat(Context context) {
        this(context, null);
        this(context, null);
@@ -62,8 +61,6 @@ public class Hotseat extends CellLayout implements Insettable {


        mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
        mQsb = LayoutInflater.from(context).inflate(R.layout.search_container_hotseat, this, false);
        addView(mQsb);
        addView(mQsb);

        mQsbHeight = getResources().getDimensionPixelSize(R.dimen.qsb_widget_height);
    }
    }


    /**
    /**
@@ -171,29 +168,29 @@ public class Hotseat extends CellLayout implements Insettable {
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);


        int qsbWidth = mActivity.getDeviceProfile().qsbWidth;
        DeviceProfile dp = mActivity.getDeviceProfile();

        mQsb.measure(MeasureSpec.makeMeasureSpec(dp.hotseatQsbWidth, MeasureSpec.EXACTLY),
        mQsb.measure(MeasureSpec.makeMeasureSpec(qsbWidth, MeasureSpec.EXACTLY),
                MeasureSpec.makeMeasureSpec(dp.hotseatQsbHeight, MeasureSpec.EXACTLY));
                MeasureSpec.makeMeasureSpec(mQsbHeight, MeasureSpec.EXACTLY));
    }
    }


    @Override
    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        super.onLayout(changed, l, t, r, b);


        int qsbWidth = mQsb.getMeasuredWidth();
        int qsbMeasuredWidth = mQsb.getMeasuredWidth();
        int left;
        int left;
        if (mActivity.getDeviceProfile().isQsbInline) {
        DeviceProfile dp = mActivity.getDeviceProfile();
            int qsbSpace = mActivity.getDeviceProfile().hotseatBorderSpace;
        if (dp.isQsbInline) {
            int qsbSpace = dp.hotseatBorderSpace;
            left = Utilities.isRtl(getResources()) ? r - getPaddingRight() + qsbSpace
            left = Utilities.isRtl(getResources()) ? r - getPaddingRight() + qsbSpace
                    : l + getPaddingLeft() - qsbWidth - qsbSpace;
                    : l + getPaddingLeft() - qsbMeasuredWidth - qsbSpace;
        } else {
        } else {
            left = (r - l - qsbWidth) / 2;
            left = (r - l - qsbMeasuredWidth) / 2;
        }
        }
        int right = left + qsbWidth;
        int right = left + qsbMeasuredWidth;


        int bottom = b - t - mActivity.getDeviceProfile().getQsbOffsetY();
        int bottom = b - t - dp.getQsbOffsetY();
        int top = bottom - mQsbHeight;
        int top = bottom - dp.hotseatQsbHeight;
        mQsb.layout(left, top, right, bottom);
        mQsb.layout(left, top, right, bottom);
    }
    }


Loading