Add ability to change height of rows in App Drawer
This commit is contained in:
1 parent
14624dbefd
commit
db6c43f239
4 files changed
+16
-3
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user