diff options
author | Samuel Fufa <sfufa@google.com> | 2019-11-18 18:19:14 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-11-18 18:19:14 +0000 |
commit | 9353b00616ac688d2df6b9f8513c4895bb4119d7 (patch) | |
tree | 3b758dc7a4b92a14ce192168cdf4175cf27f20d3 /src | |
parent | f7b75392fc3c7d952e800dee3e81246be9df8ff1 (diff) | |
parent | 1c8d90aed02f94659c1fecc1f6de6c0651ab1169 (diff) | |
download | android_packages_apps_Trebuchet-9353b00616ac688d2df6b9f8513c4895bb4119d7.tar.gz android_packages_apps_Trebuchet-9353b00616ac688d2df6b9f8513c4895bb4119d7.tar.bz2 android_packages_apps_Trebuchet-9353b00616ac688d2df6b9f8513c4895bb4119d7.zip |
Merge "Fix folder available height calculation" into ub-launcher3-qt-future-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 13 | ||||
-rw-r--r-- | src/com/android/launcher3/folder/Folder.java | 4 |
2 files changed, 9 insertions, 8 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) { diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index a7fa37948..6b9e20525 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -993,8 +993,8 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo private int getContentAreaHeight() { DeviceProfile grid = mLauncher.getDeviceProfile(); - int maxContentAreaHeight = grid.availableHeightPx - - grid.getTotalWorkspacePadding().y - mFooterHeight; + int maxContentAreaHeight = grid.availableHeightPx - grid.getTotalWorkspacePadding().y + - mFooterHeight; int height = Math.min(maxContentAreaHeight, mContent.getDesiredHeight()); return Math.max(height, MIN_CONTENT_DIMEN); |