Revert "Make numFolderRows/numFolderColumns accept more values"
Revert submission 25438456-5x5_folder
Reason for revert: http://b/313567919
Reverted changes: /q/submissionid:25438456-5x5_folder
Revert "Use DeviceProfile numFolderRows and numFolderColumns"
Revert submission 25313018-numFolder
Reason for revert: http://b/313567919
Reverted changes: /q/submissionid:25313018-numFolder
Change-Id: I4890016e310c0a2122861f36fcdbf33e98e727c0
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index bb94d4a..1451b98 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -182,8 +182,6 @@
public int cellYPaddingPx = -1;
// Folder
- public final int numFolderRows;
- public final int numFolderColumns;
public final float folderLabelTextScale;
public int folderLabelTextSizePx;
public int folderFooterHeightPx;
@@ -441,8 +439,6 @@
}
folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale);
- numFolderRows = inv.numFolderRows[mTypeIndex];
- numFolderColumns = inv.numFolderColumns[mTypeIndex];
if (mIsScalableGrid && inv.folderStyle != INVALID_RESOURCE_HANDLE) {
TypedArray folderStyle = context.obtainStyledAttributes(inv.folderStyle,
@@ -649,11 +645,11 @@
isTwoPanels ? inv.folderSpecsTwoPanelId : inv.folderSpecsId),
ResponsiveSpecType.Folder);
mResponsiveFolderWidthSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio,
- DimensionType.WIDTH, numFolderColumns,
+ DimensionType.WIDTH, inv.numFolderColumns,
mResponsiveWorkspaceWidthSpec.getAvailableSpace(),
mResponsiveWorkspaceWidthSpec);
mResponsiveFolderHeightSpec = folderSpecs.getCalculatedSpec(responsiveAspectRatio,
- DimensionType.HEIGHT, numFolderRows,
+ DimensionType.HEIGHT, inv.numFolderRows,
mResponsiveWorkspaceHeightSpec.getAvailableSpace(),
mResponsiveWorkspaceHeightSpec);
@@ -1410,16 +1406,16 @@
Point totalWorkspacePadding = getTotalWorkspacePadding();
// Check if the folder fit within the available height.
- float contentUsedHeight = folderCellHeightPx * numFolderRows
- + ((numFolderRows - 1) * folderCellLayoutBorderSpacePx.y)
+ float contentUsedHeight = folderCellHeightPx * inv.numFolderRows
+ + ((inv.numFolderRows - 1) * folderCellLayoutBorderSpacePx.y)
+ folderFooterHeightPx
+ folderContentPaddingTop;
int contentMaxHeight = availableHeightPx - totalWorkspacePadding.y;
float scaleY = contentMaxHeight / contentUsedHeight;
// Check if the folder fit within the available width.
- float contentUsedWidth = folderCellWidthPx * numFolderColumns
- + ((numFolderColumns - 1) * folderCellLayoutBorderSpacePx.x)
+ float contentUsedWidth = folderCellWidthPx * inv.numFolderColumns
+ + ((inv.numFolderColumns - 1) * folderCellLayoutBorderSpacePx.x)
+ folderContentPaddingLeftRight * 2;
int contentMaxWidth = availableWidthPx - totalWorkspacePadding.x;
float scaleX = contentMaxWidth / contentUsedWidth;
@@ -2049,8 +2045,8 @@
writer.println(prefix + pxToDpStr("iconTextSizePx", iconTextSizePx));
writer.println(prefix + pxToDpStr("iconDrawablePaddingPx", iconDrawablePaddingPx));
- writer.println(prefix + "\tnumFolderRows: " + numFolderRows);
- writer.println(prefix + "\tnumFolderColumns: " + numFolderColumns);
+ writer.println(prefix + "\tinv.numFolderRows: " + inv.numFolderRows);
+ writer.println(prefix + "\tinv.numFolderColumns: " + inv.numFolderColumns);
writer.println(prefix + pxToDpStr("folderCellWidthPx", folderCellWidthPx));
writer.println(prefix + pxToDpStr("folderCellHeightPx", folderCellHeightPx));
writer.println(prefix + pxToDpStr("folderChildIconSizePx", folderChildIconSizePx));