Use new icon stepping logic for Folders
Bug: 307694237 Test: DeviceProfileResponsiveDumpTest Test: DeviceProfileResponsiveAlternativeDisplaysDumpTest Test: ResponsiveFolderImageTest Flag: ACONFIG com.android.launcher3.enable_responsive_workspace TEAMFOOD Change-Id: Ifbfb714e48c2e0851ef55ac60cadafbb6358d074
This commit is contained in:
@@ -1338,8 +1338,6 @@ public class DeviceProfile {
|
||||
|
||||
if (mIsResponsiveGrid) {
|
||||
folderCellWidthPx = mResponsiveFolderWidthSpec.getCellSizePx();
|
||||
|
||||
// Height
|
||||
folderCellHeightPx = mResponsiveFolderHeightSpec.getCellSizePx();
|
||||
folderContentPaddingTop = mResponsiveFolderHeightSpec.getStartPaddingPx();
|
||||
folderFooterHeightPx = mResponsiveFolderHeightSpec.getEndPaddingPx();
|
||||
@@ -1356,24 +1354,15 @@ public class DeviceProfile {
|
||||
|
||||
// Recalculating padding and cell height
|
||||
folderChildDrawablePaddingPx = getNormalizedFolderChildDrawablePaddingPx(textHeight);
|
||||
int folderCellContentHeight = folderChildIconSizePx + folderChildDrawablePaddingPx
|
||||
+ textHeight;
|
||||
|
||||
// Reduce the icon in height when it's taller than the expected cell height
|
||||
while (folderChildIconSizePx > mIconSizeSteps.minimumIconSize()
|
||||
&& folderCellContentHeight > folderCellHeightPx) {
|
||||
folderChildDrawablePaddingPx -= folderCellContentHeight - folderCellHeightPx;
|
||||
if (folderChildDrawablePaddingPx < 0) {
|
||||
// get a smaller icon size
|
||||
folderChildIconSizePx = mIconSizeSteps.getNextLowerIconSize(
|
||||
folderChildIconSizePx);
|
||||
folderChildDrawablePaddingPx =
|
||||
getNormalizedFolderChildDrawablePaddingPx(textHeight);
|
||||
}
|
||||
// calculate new cellContentHeight
|
||||
folderCellContentHeight = folderChildIconSizePx + folderChildDrawablePaddingPx
|
||||
+ textHeight;
|
||||
}
|
||||
CellContentDimensions cellContentDimensions = new CellContentDimensions(
|
||||
folderChildIconSizePx,
|
||||
folderChildDrawablePaddingPx,
|
||||
folderChildTextSizePx);
|
||||
cellContentDimensions.resizeToFitCellHeight(folderCellHeightPx, mIconSizeSteps);
|
||||
folderChildIconSizePx = cellContentDimensions.getIconSizePx();
|
||||
folderChildDrawablePaddingPx = cellContentDimensions.getIconDrawablePaddingPx();
|
||||
folderChildTextSizePx = cellContentDimensions.getIconTextSizePx();
|
||||
} else if (mIsScalableGrid) {
|
||||
if (inv.folderStyle == INVALID_RESOURCE_HANDLE) {
|
||||
folderCellWidthPx = roundPxValueFromFloat(getCellSize().x * scale);
|
||||
|
||||
Reference in New Issue
Block a user