Merge "Update icon and text size for two panel home screen" into sc-dev am: 12eeecc36b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14103520 Change-Id: I9a8301cc5bd914d73149d421fe1f774d636f45e1
This commit is contained in:
@@ -162,6 +162,8 @@
|
||||
<!-- landscapeIconSize defaults to iconSize, if not specified -->
|
||||
<attr name="landscapeIconSize" format="float" />
|
||||
<attr name="iconTextSize" format="float" />
|
||||
<!-- landscapeIconTextSize defaults to iconTextSize, if not specified -->
|
||||
<attr name="landscapeIconTextSize" format="float" />
|
||||
<!-- If true, this display option is used to determine the default grid -->
|
||||
<attr name="canBeDefault" format="boolean" />
|
||||
|
||||
|
||||
@@ -506,9 +506,10 @@ public class DeviceProfile {
|
||||
|
||||
// Workspace
|
||||
final boolean isVerticalLayout = isVerticalBarLayout();
|
||||
float invIconSizeDp = isVerticalLayout ? inv.landscapeIconSize : inv.iconSize;
|
||||
float invIconSizeDp = isLandscape ? inv.landscapeIconSize : inv.iconSize;
|
||||
iconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mInfo.metrics, scale));
|
||||
iconTextSizePx = (int) (Utilities.pxFromSp(inv.iconTextSize, mInfo.metrics) * scale);
|
||||
float invIconTextSizeSp = isLandscape ? inv.landscapeIconTextSize : inv.iconTextSize;
|
||||
iconTextSizePx = (int) (Utilities.pxFromSp(invIconTextSizeSp, mInfo.metrics) * scale);
|
||||
iconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale);
|
||||
|
||||
setCellLayoutBorderSpacing((int) (cellLayoutBorderSpacingOriginalPx * scale));
|
||||
|
||||
@@ -106,6 +106,7 @@ public class InvariantDeviceProfile {
|
||||
public float iconSize;
|
||||
public String iconShapePath;
|
||||
public float landscapeIconSize;
|
||||
public float landscapeIconTextSize;
|
||||
public int iconBitmapSize;
|
||||
public int fillResIconDpi;
|
||||
public float iconTextSize;
|
||||
@@ -163,6 +164,7 @@ public class InvariantDeviceProfile {
|
||||
landscapeIconSize = p.landscapeIconSize;
|
||||
iconBitmapSize = p.iconBitmapSize;
|
||||
iconTextSize = p.iconTextSize;
|
||||
landscapeIconTextSize = p.landscapeIconTextSize;
|
||||
numHotseatIcons = p.numHotseatIcons;
|
||||
numAllAppsColumns = p.numAllAppsColumns;
|
||||
isScalable = p.isScalable;
|
||||
@@ -293,6 +295,7 @@ public class InvariantDeviceProfile {
|
||||
landscapeIconSize = displayOption.landscapeIconSize;
|
||||
iconBitmapSize = ResourceUtils.pxFromDp(iconSize, displayInfo.metrics);
|
||||
iconTextSize = displayOption.iconTextSize;
|
||||
landscapeIconTextSize = displayOption.landscapeIconTextSize;
|
||||
fillResIconDpi = getLauncherIconDensity(iconBitmapSize);
|
||||
|
||||
minCellHeight = displayOption.minCellHeight;
|
||||
@@ -678,6 +681,7 @@ public class InvariantDeviceProfile {
|
||||
private float iconSize;
|
||||
private float iconTextSize;
|
||||
private float landscapeIconSize;
|
||||
private float landscapeIconTextSize;
|
||||
private float allAppsIconSize;
|
||||
private float allAppsIconTextSize;
|
||||
|
||||
@@ -702,6 +706,8 @@ public class InvariantDeviceProfile {
|
||||
landscapeIconSize = a.getFloat(R.styleable.ProfileDisplayOption_landscapeIconSize,
|
||||
iconSize);
|
||||
iconTextSize = a.getFloat(R.styleable.ProfileDisplayOption_iconTextSize, 0);
|
||||
landscapeIconTextSize = a.getFloat(
|
||||
R.styleable.ProfileDisplayOption_landscapeIconTextSize, iconTextSize);
|
||||
|
||||
allAppsIconSize = a.getFloat(R.styleable.ProfileDisplayOption_allAppsIconSize,
|
||||
iconSize);
|
||||
@@ -731,6 +737,7 @@ public class InvariantDeviceProfile {
|
||||
landscapeIconSize *= w;
|
||||
allAppsIconSize *= w;
|
||||
iconTextSize *= w;
|
||||
landscapeIconTextSize *= w;
|
||||
allAppsIconTextSize *= w;
|
||||
minCellHeight *= w;
|
||||
minCellWidth *= w;
|
||||
@@ -744,6 +751,7 @@ public class InvariantDeviceProfile {
|
||||
landscapeIconSize += p.landscapeIconSize;
|
||||
allAppsIconSize += p.allAppsIconSize;
|
||||
iconTextSize += p.iconTextSize;
|
||||
landscapeIconTextSize += p.landscapeIconTextSize;
|
||||
allAppsIconTextSize += p.allAppsIconTextSize;
|
||||
minCellHeight += p.minCellHeight;
|
||||
minCellWidth += p.minCellWidth;
|
||||
|
||||
Reference in New Issue
Block a user