diff --git a/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt b/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
index 3967f75..0303bc1 100644
--- a/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
+++ b/quickstep/tests/src/com/android/quickstep/HotseatWidthCalculationTest.kt
@@ -63,13 +63,13 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(558)
         assertThat(dp.numShownHotseatIcons).isEqualTo(4)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(76)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(50)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(122)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(112)
         assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(558)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1058)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1080)
     }
 
     /**
@@ -84,13 +84,13 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(744)
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(83)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(82)
 
         assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(106)
         assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(744)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1467)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1468)
     }
 
     /**
@@ -109,13 +109,13 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(705)
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(108)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(102)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(631)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(625)
         assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(705)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1227)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1233)
     }
 
     /**
@@ -132,11 +132,11 @@
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
         assertThat(dp.hotseatBorderSpace).isEqualTo(36)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(884)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(854)
         assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(705)
 
         assertThat(dp.isQsbInline).isTrue()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(559)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(531)
     }
 
     /**
@@ -152,9 +152,9 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(705)
         assertThat(dp.numShownHotseatIcons).isEqualTo(5)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(56)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(43)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(801)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(782)
         assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(705)
 
         assertThat(dp.isQsbInline).isTrue()
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index ce78fce..eb016b2 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -867,8 +867,8 @@
         float invIconSizeDp = inv.iconSize[mTypeIndex];
         float invIconTextSizeSp = inv.iconTextSize[mTypeIndex];
 
-        iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, iconScale));
-        iconTextSizePx = (int) (pxFromSp(invIconTextSizeSp, mMetrics) * iconScale);
+        iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics));
+        iconTextSizePx = pxFromSp(invIconTextSizeSp, mMetrics);
         iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * iconScale);
 
         cellLayoutBorderSpacePx = getCellLayoutBorderSpace(inv, scale);
@@ -876,8 +876,46 @@
         if (isScalableGrid) {
             cellWidthPx = pxFromDp(inv.minCellSize[mTypeIndex].x, mMetrics, scale);
             cellHeightPx = pxFromDp(inv.minCellSize[mTypeIndex].y, mMetrics, scale);
-            int cellContentHeight = iconSizePx + iconDrawablePaddingPx
-                    + Utilities.calculateTextHeight(iconTextSizePx);
+
+            if (cellWidthPx < iconSizePx) {
+                // If cellWidth no longer fit iconSize, reduce borderSpace to make cellWidth bigger.
+                int numColumns = getPanelCount() * inv.numColumns;
+                int numBorders = numColumns - 1;
+                int extraWidthRequired = (iconSizePx - cellWidthPx) * numColumns;
+                if (cellLayoutBorderSpacePx.x * numBorders >= extraWidthRequired) {
+                    cellWidthPx = iconSizePx;
+                    cellLayoutBorderSpacePx.x -= extraWidthRequired / numBorders;
+                } else {
+                    // If it still doesn't fit, set borderSpace to 0 and distribute the space for
+                    // cellWidth, and reduce iconSize.
+                    cellWidthPx = (cellWidthPx * numColumns
+                            + cellLayoutBorderSpacePx.x * numBorders) / numColumns;
+                    iconSizePx = Math.min(iconSizePx, cellWidthPx);
+                    cellLayoutBorderSpacePx.x = 0;
+                }
+            }
+
+            int cellTextAndPaddingHeight =
+                    iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx);
+            int cellContentHeight = iconSizePx + cellTextAndPaddingHeight;
+            if (cellHeightPx < cellContentHeight) {
+                // If cellHeight no longer fit iconSize, reduce borderSpace to make cellHeight
+                // bigger.
+                int numBorders = inv.numRows - 1;
+                int extraHeightRequired = (cellContentHeight - cellHeightPx) * inv.numRows;
+                if (cellLayoutBorderSpacePx.y * numBorders >= extraHeightRequired) {
+                    cellHeightPx = cellContentHeight;
+                    cellLayoutBorderSpacePx.y -= extraHeightRequired / numBorders;
+                } else {
+                    // If it still doesn't fit, set borderSpace to 0 and distribute the space for
+                    // cellHeight, and reduce iconSize.
+                    cellHeightPx = (cellHeightPx * inv.numRows
+                            + cellLayoutBorderSpacePx.y * numBorders) / inv.numRows;
+                    iconSizePx = Math.min(iconSizePx, cellHeightPx - cellTextAndPaddingHeight);
+                    cellLayoutBorderSpacePx.y = 0;
+                }
+                cellContentHeight = iconSizePx + cellTextAndPaddingHeight;
+            }
             cellYPaddingPx = Math.max(0, cellHeightPx - cellContentHeight) / 2;
             desiredWorkspaceHorizontalMarginPx =
                     (int) (desiredWorkspaceHorizontalMarginOriginalPx * scale);
@@ -929,17 +967,41 @@
                 pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics, scale));
         // AllApps cells don't have real space between cells,
         // so we add the border space to the cell height
-        allAppsCellHeightPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].y, mMetrics, scale)
+        allAppsCellHeightPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].y, mMetrics)
                 + allAppsBorderSpacePx.y;
         // but width is just the cell,
         // the border is added in #updateAllAppsContainerWidth
         if (isScalableGrid) {
-            allAppsIconSizePx =
-                    pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics, scale);
-            allAppsIconTextSizePx =
-                    pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics, scale);
+            allAppsIconSizePx = pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics);
+            allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics);
             allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx;
             allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale);
+
+            if (allAppsCellWidthPx < allAppsIconSizePx) {
+                // If allAppsCellWidth no longer fit allAppsIconSize, reduce allAppsBorderSpace to
+                // make allAppsCellWidth bigger.
+                int numBorders = inv.numAllAppsColumns - 1;
+                int extraWidthRequired =
+                        (allAppsIconSizePx - allAppsCellWidthPx) * inv.numAllAppsColumns;
+                if (allAppsBorderSpacePx.x * numBorders >= extraWidthRequired) {
+                    allAppsCellWidthPx = allAppsIconSizePx;
+                    allAppsBorderSpacePx.x -= extraWidthRequired / numBorders;
+                } else {
+                    // If it still doesn't fit, set allAppsBorderSpace to 0 and distribute the space
+                    // for allAppsCellWidth, and reduce allAppsIconSize.
+                    allAppsCellWidthPx = (allAppsCellWidthPx * inv.numAllAppsColumns
+                            + allAppsBorderSpacePx.x * numBorders) / inv.numAllAppsColumns;
+                    allAppsIconSizePx = Math.min(allAppsIconSizePx, allAppsCellWidthPx);
+                    allAppsBorderSpacePx.x = 0;
+                }
+            }
+
+            int cellContentHeight = allAppsIconSizePx
+                    + Utilities.calculateTextHeight(allAppsIconTextSizePx) + allAppsBorderSpacePx.y;
+            if (allAppsCellHeightPx < cellContentHeight) {
+                // Increase allAppsCellHeight to fit its content.
+                allAppsCellHeightPx = cellContentHeight;
+            }
         } else {
             float invIconSizeDp = inv.allAppsIconSize[mTypeIndex];
             float invIconTextSizeSp = inv.allAppsIconTextSize[mTypeIndex];
diff --git a/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt b/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt
index 55520e8..c99ad76 100644
--- a/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt
+++ b/tests/src/com/android/launcher3/nonquickstep/HotseatWidthCalculationTest.kt
@@ -63,13 +63,13 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(94)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(72)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(121)
-        assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(121)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(110)
+        assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(110)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1058)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1080)
     }
 
     /**
@@ -84,13 +84,13 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(105)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(104)
 
         assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(370)
         assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(370)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1467)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1468)
     }
 
     /**
@@ -130,13 +130,13 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(96)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(91)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(643)
-        assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(643)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(640)
+        assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(640)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1174)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1179)
     }
 
     /**
@@ -152,12 +152,12 @@
 
         assertThat(dp.hotseatBarEndOffset).isEqualTo(0)
         assertThat(dp.numShownHotseatIcons).isEqualTo(6)
-        assertThat(dp.hotseatBorderSpace).isEqualTo(89)
+        assertThat(dp.hotseatBorderSpace).isEqualTo(75)
 
-        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(589)
-        assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(589)
+        assertThat(dp.getHotseatLayoutPadding(context).left).isEqualTo(582)
+        assertThat(dp.getHotseatLayoutPadding(context).right).isEqualTo(582)
 
         assertThat(dp.isQsbInline).isFalse()
-        assertThat(dp.hotseatQsbWidth).isEqualTo(1081)
+        assertThat(dp.hotseatQsbWidth).isEqualTo(1095)
     }
 }
