summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorSamuel Fufa <sfufa@google.com>2019-11-12 17:54:58 -0800
committerSamuel Fufa <sfufa@google.com>2019-11-14 11:02:49 -0800
commit1c8d90aed02f94659c1fecc1f6de6c0651ab1169 (patch)
treed86597ceadaa902854a9ab128684e0f98e13fde0 /src/com/android/launcher3/DeviceProfile.java
parent992cfbf63d13e9490f4726119733fda7f638089c (diff)
downloadandroid_packages_apps_Trebuchet-1c8d90aed02f94659c1fecc1f6de6c0651ab1169.tar.gz
android_packages_apps_Trebuchet-1c8d90aed02f94659c1fecc1f6de6c0651ab1169.tar.bz2
android_packages_apps_Trebuchet-1c8d90aed02f94659c1fecc1f6de6c0651ab1169.zip
Fix folder available height calculation
Bug: 139456471 Test: Manual Change-Id: Ic86c481e76f8b6629ad74109ef98900f1c00e16c
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index a35f59868..bc6fa6e90 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -403,14 +403,15 @@ public class DeviceProfile {
Point totalWorkspacePadding = getTotalWorkspacePadding();
// Check if the icons fit within the available height.
- float usedHeight = folderCellHeightPx * inv.numFolderRows + folderBottomPanelSize;
- int maxHeight = availableHeightPx - totalWorkspacePadding.y - folderMargin;
- float scaleY = maxHeight / usedHeight;
+ float contentUsedHeight = folderCellHeightPx * inv.numFolderRows;
+ int contentMaxHeight = availableHeightPx - totalWorkspacePadding.y - folderBottomPanelSize
+ - folderMargin;
+ float scaleY = contentMaxHeight / contentUsedHeight;
// Check if the icons fit within the available width.
- float usedWidth = folderCellWidthPx * inv.numFolderColumns;
- int maxWidth = availableWidthPx - totalWorkspacePadding.x - folderMargin;
- float scaleX = maxWidth / usedWidth;
+ float contentUsedWidth = folderCellWidthPx * inv.numFolderColumns;
+ int contentMaxWidth = availableWidthPx - totalWorkspacePadding.x - folderMargin;
+ float scaleX = contentMaxWidth / contentUsedWidth;
float scale = Math.min(scaleX, scaleY);
if (scale < 1f) {