Update responsive grid spec cell size remainderSpace logic
Refactoring the cellSize spec of responsive grid to divide the remainder space in code instead of dividing by cols/rows in the spec definition. For example, instead of using 0.2 in the spec for 5x5 grid (1 / number of rows), it is going to use 1 (100% of the remainder space) and divide the percentage by the number of cols or rows in code.
Fix: 313621277
Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD
Test: NexusLauncherImageTests
Test: CalculatedWorkspaceSpecTest
Test: DeviceProfileDumpTest
Test: DeviceProfileAlternativeDisplaysDumpTest
Change-Id: Ifaec838ac9751562ecedc1fe39b966ee3d092de3
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 72d2213..20fb8cc 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -640,8 +640,8 @@
DimensionType.WIDTH, numShownAllAppsColumns, availableWidthPx,
mResponsiveWorkspaceWidthSpec);
mResponsiveAllAppsHeightSpec = allAppsSpecs.getCalculatedSpec(responsiveAspectRatio,
- DimensionType.HEIGHT, inv.numRows, heightPx - mInsets.top,
- mResponsiveWorkspaceHeightSpec);
+ DimensionType.HEIGHT, inv.numAllAppsRowsForCellHeightCalculation,
+ heightPx - mInsets.top, mResponsiveWorkspaceHeightSpec);
ResponsiveSpecsProvider folderSpecs = ResponsiveSpecsProvider.create(
new ResourceHelper(context,
@@ -1341,7 +1341,7 @@
if (allAppsCellHeightPx < cellContentDimensions.getCellContentHeight()) {
if (isVerticalBarLayout()) {
- if (allAppsCellHeightPx < iconSizePx) {
+ if (allAppsCellHeightPx < allAppsIconSizePx) {
cellContentDimensions.setIconSizePx(
mIconSizeSteps.getIconSmallerThan(allAppsCellHeightPx));
}