Add ability to change height of rows in App Drawer

This commit is contained in:
Patryk Michalik committed 2021-11-03 14:01:50 +01:00
1 parent 14624dbefd
commit db6c43f239
4 files changed
+16 -3

No files matched your search

+7 -3
View File
@@ -179,6 +179,7 @@ public class DeviceProfile {
public int allAppsIconDrawablePaddingPx;
public final int numShownAllAppsColumns;
public float allAppsIconTextSizePx;
private float allAppsCellHeightMultiplier;
// Overview
public int overviewTaskMarginPx;
@@ -222,6 +223,9 @@ public class DeviceProfile {
boolean useTwoPanels) {
mContext = context;
PreferenceManager pm = PreferenceManager.INSTANCE.get(context);
allAppsCellHeightMultiplier = pm.getAllAppsCellHeightMultiplier().get();
this.inv = inv;
this.isLandscape = windowBounds.isLandscape();
this.isMultiWindowMode = isMultiWindowMode;
@@ -538,12 +542,12 @@ public class DeviceProfile {
public void autoResizeAllAppsCells() {
int textHeight = Utilities.calculateTextHeight(allAppsIconTextSizePx);
int topBottomPadding = textHeight;
allAppsCellHeightPx = allAppsIconSizePx + allAppsIconDrawablePaddingPx
+ textHeight + (topBottomPadding * 2);
int baseCellHeight = allAppsIconSizePx + allAppsIconDrawablePaddingPx + textHeight + (topBottomPadding * 2);
allAppsCellHeightPx = (int) (baseCellHeight * allAppsCellHeightMultiplier);
if (allAppsIconTextSizePx == 0) {
int leftRightPadding = desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx;
int drawerWidth = availableWidthPx - leftRightPadding * 2;
allAppsCellHeightPx = drawerWidth / inv.numAllAppsColumns;
allAppsCellHeightPx = (int) (drawerWidth / inv.numAllAppsColumns * allAppsCellHeightMultiplier);
allAppsIconDrawablePaddingPx = 0;
}
}