summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Anderson <charlander@google.com>2023-12-14 03:30:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-12-14 03:30:55 +0000
commit97eedb9570c8cdf684ed8cf7cb771cdd3d7b45f5 (patch)
treed3a712f4bfa2e59333b030bfb7fe41d33147d755
parent2c00a542c26d4add947062d20719429b70eca6cf (diff)
parent7bb10974d7caf2a28dddc6438877df8ba86e33b5 (diff)
downloadLauncher3-97eedb9570c8cdf684ed8cf7cb771cdd3d7b45f5.tar.gz
Merge "fix font-scaling from clipping folder child icons" into main
-rw-r--r--src/com/android/launcher3/DeviceProfile.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index b6e8ec3628..1ca7da9d44 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -356,7 +356,7 @@ public class DeviceProfile {
final Resources res = context.getResources();
mMetrics = res.getDisplayMetrics();
- mIconSizeSteps = mIsResponsiveGrid ? new IconSizeSteps(res) : null;
+ mIconSizeSteps = new IconSizeSteps(res);
// Determine sizes.
widthPx = windowBounds.bounds.width();
@@ -1486,6 +1486,17 @@ public class DeviceProfile {
folderCellWidthPx = roundPxValueFromFloat(folderCellWidthPx * scale);
folderCellHeightPx = roundPxValueFromFloat(folderCellHeightPx * scale);
}
+ // Recalculating padding and cell height
+ folderChildDrawablePaddingPx = getNormalizedFolderChildDrawablePaddingPx(textHeight);
+
+ CellContentDimensions cellContentDimensions = new CellContentDimensions(
+ folderChildIconSizePx,
+ folderChildDrawablePaddingPx,
+ folderChildTextSizePx);
+ cellContentDimensions.resizeToFitCellHeight(folderCellHeightPx, mIconSizeSteps);
+ folderChildIconSizePx = cellContentDimensions.getIconSizePx();
+ folderChildDrawablePaddingPx = cellContentDimensions.getIconDrawablePaddingPx();
+ folderChildTextSizePx = cellContentDimensions.getIconTextSizePx();
folderContentPaddingTop = roundPxValueFromFloat(folderContentPaddingTop * scale);
folderCellLayoutBorderSpacePx = new Point(
@@ -1493,10 +1504,7 @@ public class DeviceProfile {
roundPxValueFromFloat(folderCellLayoutBorderSpacePx.y * scale)
);
folderFooterHeightPx = roundPxValueFromFloat(folderFooterHeightPx * scale);
-
folderContentPaddingLeftRight = folderCellLayoutBorderSpacePx.x;
-
- folderChildDrawablePaddingPx = getNormalizedFolderChildDrawablePaddingPx(textHeight);
} else {
int cellPaddingX = (int) (res.getDimensionPixelSize(R.dimen.folder_cell_x_padding)
* scale);