Merge "Make folder sizes customizable" into tm-qpr-dev

This commit is contained in:
Thales Lima
2022-08-16 15:02:41 +00:00
committed by Android (Google) Code Review
7 changed files with 149 additions and 80 deletions

View File

@@ -73,13 +73,14 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonTextSizePx: 36.0px (13.714286dp)\n" +
"\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
"\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
"\tfolderCellHeightPx: 272.0px (103.61905dp)\n" +
"\tfolderCellHeightPx: 247.0px (94.09524dp)\n" +
"\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
"\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
"\tfolderChildDrawablePaddingPx: 21.0px (8.0dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" +
"\tfolderTopPadding: 63.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" +
"\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
"\tallAppsTopPadding: 0.0px (0.0dp)\n" +
@@ -192,13 +193,14 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonTextSizePx: 36.0px (13.714286dp)\n" +
"\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
"\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
"\tfolderCellHeightPx: 272.0px (103.61905dp)\n" +
"\tfolderCellHeightPx: 247.0px (94.09524dp)\n" +
"\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
"\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
"\tfolderChildDrawablePaddingPx: 21.0px (8.0dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" +
"\tfolderTopPadding: 63.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 146.0px (55.61905dp)\n" +
"\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
"\tallAppsTopPadding: 0.0px (0.0dp)\n" +
@@ -316,9 +318,10 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
"\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" +
"\tfolderTopPadding: 48.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 104.0px (52.0dp)\n" +
"\tallAppsShiftRange: 1496.0px (748.0dp)\n" +
"\tallAppsTopPadding: 104.0px (52.0dp)\n" +
@@ -436,9 +439,10 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
"\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" +
"\tfolderTopPadding: 48.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 104.0px (52.0dp)\n" +
"\tallAppsShiftRange: 1496.0px (748.0dp)\n" +
"\tallAppsTopPadding: 104.0px (52.0dp)\n" +
@@ -551,14 +555,15 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonSizePx: 120.0px (60.0dp)\n" +
"\ticonTextSizePx: 28.0px (14.0dp)\n" +
"\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
"\tfolderCellWidthPx: 204.0px (102.0dp)\n" +
"\tfolderCellHeightPx: 240.0px (120.0dp)\n" +
"\tfolderCellWidthPx: 240.0px (120.0dp)\n" +
"\tfolderCellHeightPx: 208.0px (104.0dp)\n" +
"\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
"\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 27.0px (13.5dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" +
"\tfolderTopPadding: 48.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
"\tallAppsShiftRange: 1936.0px (968.0dp)\n" +
"\tallAppsTopPadding: 624.0px (312.0dp)\n" +
@@ -671,14 +676,15 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonSizePx: 120.0px (60.0dp)\n" +
"\ticonTextSizePx: 28.0px (14.0dp)\n" +
"\ticonDrawablePaddingPx: 14.0px (7.0dp)\n" +
"\tfolderCellWidthPx: 204.0px (102.0dp)\n" +
"\tfolderCellHeightPx: 240.0px (120.0dp)\n" +
"\tfolderCellWidthPx: 240.0px (120.0dp)\n" +
"\tfolderCellHeightPx: 208.0px (104.0dp)\n" +
"\tfolderChildIconSizePx: 120.0px (60.0dp)\n" +
"\tfolderChildTextSizePx: 28.0px (14.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 27.0px (13.5dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 0.0px (0.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 0.0px (0.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 16.0px (8.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 32.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 32.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 32.0px (16.0dp)\n" +
"\tfolderTopPadding: 48.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 704.0px (352.0dp)\n" +
"\tallAppsShiftRange: 1936.0px (968.0dp)\n" +
"\tallAppsTopPadding: 624.0px (312.0dp)\n" +
@@ -792,13 +798,14 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonTextSizePx: 36.0px (13.714286dp)\n" +
"\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
"\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
"\tfolderCellHeightPx: 267.0px (101.71429dp)\n" +
"\tfolderCellHeightPx: 247.0px (94.09524dp)\n" +
"\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
"\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
"\tfolderChildDrawablePaddingPx: 19.0px (7.2380953dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" +
"\tfolderTopPadding: 63.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
"\tallAppsShiftRange: 1730.0px (659.0476dp)\n" +
"\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
@@ -912,13 +919,14 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonTextSizePx: 36.0px (13.714286dp)\n" +
"\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
"\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
"\tfolderCellHeightPx: 267.0px (101.71429dp)\n" +
"\tfolderCellHeightPx: 247.0px (94.09524dp)\n" +
"\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
"\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
"\tfolderChildDrawablePaddingPx: 19.0px (7.2380953dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" +
"\tfolderTopPadding: 63.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
"\tallAppsShiftRange: 1730.0px (659.0476dp)\n" +
"\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
@@ -1031,14 +1039,15 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonSizePx: 136.0px (51.809525dp)\n" +
"\ticonTextSizePx: 31.0px (11.809524dp)\n" +
"\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
"\tfolderCellWidthPx: 192.0px (73.14286dp)\n" +
"\tfolderCellHeightPx: 304.0px (115.809525dp)\n" +
"\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
"\tfolderCellHeightPx: 247.0px (94.09524dp)\n" +
"\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
"\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
"\tfolderChildDrawablePaddingPx: 32.0px (12.190476dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" +
"\tfolderTopPadding: 63.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
"\tallAppsShiftRange: 2098.0px (799.2381dp)\n" +
"\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
@@ -1151,14 +1160,15 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonSizePx: 136.0px (51.809525dp)\n" +
"\ticonTextSizePx: 31.0px (11.809524dp)\n" +
"\ticonDrawablePaddingPx: 17.0px (6.4761906dp)\n" +
"\tfolderCellWidthPx: 192.0px (73.14286dp)\n" +
"\tfolderCellHeightPx: 304.0px (115.809525dp)\n" +
"\tfolderCellWidthPx: 210.0px (80.0dp)\n" +
"\tfolderCellHeightPx: 247.0px (94.09524dp)\n" +
"\tfolderChildIconSizePx: 158.0px (60.190475dp)\n" +
"\tfolderChildTextSizePx: 37.0px (14.095238dp)\n" +
"\tfolderChildDrawablePaddingPx: 32.0px (12.190476dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderChildDrawablePaddingPx: 13.0px (4.952381dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 42.0px (16.0dp)\n" +
"\tfolderTopPadding: 63.0px (24.0dp)\n" +
"\tbottomSheetTopPadding: 110.0px (41.904762dp)\n" +
"\tallAppsShiftRange: 2098.0px (799.2381dp)\n" +
"\tallAppsTopPadding: 110.0px (41.904762dp)\n" +
@@ -1270,14 +1280,15 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonSizePx: 142.0px (54.095238dp)\n" +
"\ticonTextSizePx: 0.0px (0.0dp)\n" +
"\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
"\tfolderCellWidthPx: 179.0px (68.190475dp)\n" +
"\tfolderCellHeightPx: 212.0px (80.7619dp)\n" +
"\tfolderChildIconSizePx: 135.0px (51.42857dp)\n" +
"\tfolderChildTextSizePx: 35.0px (13.333333dp)\n" +
"\tfolderChildDrawablePaddingPx: 10.0px (3.8095238dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderCellWidthPx: 175.0px (66.666664dp)\n" +
"\tfolderCellHeightPx: 205.0px (78.09524dp)\n" +
"\tfolderChildIconSizePx: 131.0px (49.904762dp)\n" +
"\tfolderChildTextSizePx: 34.0px (12.952381dp)\n" +
"\tfolderChildDrawablePaddingPx: 9.0px (3.4285715dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 21.0px (8.0dp)\n" +
"\tfolderTopPadding: 42.0px (16.0dp)\n" +
"\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" +
"\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
"\tallAppsTopPadding: 0.0px (0.0dp)\n" +
@@ -1389,14 +1400,15 @@ class DeviceProfileTest : DeviceProfileBaseTest() {
"\ticonSizePx: 142.0px (54.095238dp)\n" +
"\ticonTextSizePx: 0.0px (0.0dp)\n" +
"\ticonDrawablePaddingPx: 0.0px (0.0dp)\n" +
"\tfolderCellWidthPx: 163.0px (62.095238dp)\n" +
"\tfolderCellHeightPx: 192.0px (73.14286dp)\n" +
"\tfolderChildIconSizePx: 123.0px (46.857143dp)\n" +
"\tfolderChildTextSizePx: 32.0px (12.190476dp)\n" +
"\tfolderCellWidthPx: 159.0px (60.57143dp)\n" +
"\tfolderCellHeightPx: 187.0px (71.2381dp)\n" +
"\tfolderChildIconSizePx: 119.0px (45.333332dp)\n" +
"\tfolderChildTextSizePx: 31.0px (11.809524dp)\n" +
"\tfolderChildDrawablePaddingPx: 8.0px (3.047619dp)\n" +
"\tfolderCellLayoutBorderSpaceOriginalPx: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Horizontal: 42.0px (16.0dp)\n" +
"\tfolderCellLayoutBorderSpacePx Vertical: 42.0px (16.0dp)\n" +
"\tfolderContentPaddingLeftRight: 21.0px (8.0dp)\n" +
"\tfolderTopPadding: 42.0px (16.0dp)\n" +
"\tbottomSheetTopPadding: 114.0px (43.42857dp)\n" +
"\tallAppsShiftRange: 788.0px (300.1905dp)\n" +
"\tallAppsTopPadding: 0.0px (0.0dp)\n" +

View File

@@ -30,7 +30,7 @@
<LinearLayout
android:id="@+id/folder_footer"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_height="@dimen/folder_label_height"
android:clipChildren="false"
android:orientation="horizontal"
android:paddingLeft="12dp"

View File

@@ -327,6 +327,19 @@
if not specified -->
<attr name="allAppsBorderSpaceTwoPanelLandscapeVertical" format="float" />
<!-- defaults to minCellHeight if not specified
when GridDisplayOption#isScalable is true. -->
<attr name="folderCellHeight" format="float" />
<!-- defaults to minCellWidth, if not specified -->
<attr name="folderCellWidth" format="float" />
<!-- defaults to borderSpace, if not specified -->
<!-- space to be used horizontally and vertically -->
<attr name="folderBorderSpace" format="float" />
<!-- defaults to folderBorderSpace vertical, if not specified -->
<attr name="folderTopPadding" format="float" />
<!-- defaults to res.hotseat_bar_bottom_space_default, if not specified -->
<attr name="hotseatBarBottomSpace" format="float" />
<!-- defaults to hotseatBarBottomSpace, if not specified -->

View File

@@ -251,7 +251,7 @@
<dimen name="folder_cell_y_padding">6dp</dimen>
<!-- label text size = workspace text size multiplied by this scale -->
<dimen name="folder_label_text_scale">1.14</dimen>
<dimen name="folder_label_height">48dp</dimen>
<dimen name="folder_label_height">56dp</dimen>
<dimen name="folder_content_padding_left_right">8dp</dimen>
<dimen name="folder_content_padding_top">16dp</dimen>

View File

@@ -149,7 +149,6 @@ public class DeviceProfile {
// Folder content
public Point folderCellLayoutBorderSpacePx;
public int folderCellLayoutBorderSpaceOriginalPx;
public int folderContentPaddingLeftRight;
public int folderContentPaddingTop;
@@ -327,9 +326,8 @@ public class DeviceProfile {
pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics),
pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics));
cellLayoutBorderSpaceOriginalPx = new Point(cellLayoutBorderSpacePx);
folderCellLayoutBorderSpaceOriginalPx = pxFromDp(inv.folderBorderSpace, mMetrics);
folderCellLayoutBorderSpacePx = new Point(folderCellLayoutBorderSpaceOriginalPx,
folderCellLayoutBorderSpaceOriginalPx);
folderCellLayoutBorderSpacePx = new Point(pxFromDp(inv.folderBorderSpaces.x, mMetrics),
pxFromDp(inv.folderBorderSpaces.y, mMetrics));
workspacePageIndicatorHeight = res.getDimensionPixelSize(
R.dimen.workspace_page_indicator_height);
@@ -932,16 +930,14 @@ public class DeviceProfile {
int textHeight = Utilities.calculateTextHeight(folderChildTextSizePx);
if (isScalableGrid) {
int minWidth = folderChildIconSizePx + iconDrawablePaddingPx * 2;
int minHeight = folderChildIconSizePx + iconDrawablePaddingPx * 2 + textHeight;
folderCellWidthPx = pxFromDp(inv.folderCellSize.x, mMetrics, scale);
folderCellHeightPx = pxFromDp(inv.folderCellSize.y, mMetrics, scale);
folderCellWidthPx = (int) Math.max(minWidth, cellWidthPx * scale);
folderCellHeightPx = (int) Math.max(minHeight, cellHeightPx * scale);
int scaledSpace = (int) (folderCellLayoutBorderSpaceOriginalPx * scale);
folderCellLayoutBorderSpacePx = new Point(scaledSpace, scaledSpace);
folderContentPaddingLeftRight = scaledSpace;
folderContentPaddingTop = scaledSpace;
folderCellLayoutBorderSpacePx = new Point(
pxFromDp(inv.folderBorderSpaces.x, mMetrics, scale),
pxFromDp(inv.folderBorderSpaces.y, mMetrics, scale));
folderContentPaddingLeftRight = folderCellLayoutBorderSpacePx.x;
folderContentPaddingTop = pxFromDp(inv.folderTopPadding, mMetrics, scale);
} else {
int cellPaddingX = (int) (res.getDimensionPixelSize(R.dimen.folder_cell_x_padding)
* scale);
@@ -1417,12 +1413,13 @@ public class DeviceProfile {
writer.println(prefix + pxToDpStr("folderChildTextSizePx", folderChildTextSizePx));
writer.println(prefix + pxToDpStr("folderChildDrawablePaddingPx",
folderChildDrawablePaddingPx));
writer.println(prefix + pxToDpStr("folderCellLayoutBorderSpaceOriginalPx",
folderCellLayoutBorderSpaceOriginalPx));
writer.println(prefix + pxToDpStr("folderCellLayoutBorderSpacePx Horizontal",
folderCellLayoutBorderSpacePx.x));
writer.println(prefix + pxToDpStr("folderCellLayoutBorderSpacePx Vertical",
folderCellLayoutBorderSpacePx.y));
writer.println(prefix + pxToDpStr("folderContentPaddingLeftRight",
folderContentPaddingLeftRight));
writer.println(prefix + pxToDpStr("folderTopPadding", folderContentPaddingTop));
writer.println(prefix + pxToDpStr("bottomSheetTopPadding", bottomSheetTopPadding));

View File

@@ -127,9 +127,12 @@ public class InvariantDeviceProfile {
public PointF[] minCellSize;
public PointF[] borderSpaces;
public float folderBorderSpace;
public int inlineNavButtonsEndSpacing;
public PointF folderBorderSpaces;
public PointF folderCellSize;
public float folderTopPadding;
public float[] horizontalMargin;
public PointF[] allAppsCellSize;
@@ -353,7 +356,10 @@ public class InvariantDeviceProfile {
minCellSize = displayOption.minCellSize;
borderSpaces = displayOption.borderSpaces;
folderBorderSpace = displayOption.folderBorderSpace;
folderBorderSpaces = displayOption.folderBorderSpaces;
folderCellSize = displayOption.folderCellSize;
folderTopPadding = displayOption.folderTopPadding;
horizontalMargin = displayOption.horizontalMargin;
@@ -828,7 +834,10 @@ public class InvariantDeviceProfile {
private final PointF[] minCellSize = new PointF[COUNT_SIZES];
private float folderBorderSpace;
private final PointF folderCellSize;
private final PointF folderBorderSpaces;
private float folderTopPadding;
private final PointF[] borderSpaces = new PointF[COUNT_SIZES];
private final float[] horizontalMargin = new float[COUNT_SIZES];
private final float[] hotseatBarBottomSpace = new float[COUNT_SIZES];
@@ -924,7 +933,20 @@ public class InvariantDeviceProfile {
borderSpaceTwoPanelLandscape);
borderSpaces[INDEX_TWO_PANEL_LANDSCAPE] = new PointF(x, y);
folderBorderSpace = borderSpace;
x = a.getFloat(R.styleable.ProfileDisplayOption_folderCellWidth,
minCellSize[INDEX_DEFAULT].x);
y = a.getFloat(R.styleable.ProfileDisplayOption_folderCellHeight,
minCellSize[INDEX_DEFAULT].y);
folderCellSize = new PointF(x, y);
float folderBorderSpace = a.getFloat(R.styleable.ProfileDisplayOption_folderBorderSpace,
borderSpace);
x = y = folderBorderSpace;
folderBorderSpaces = new PointF(x, y);
folderTopPadding = a.getFloat(R.styleable.ProfileDisplayOption_folderTopPadding,
folderBorderSpaces.y);
x = a.getFloat(R.styleable.ProfileDisplayOption_allAppsCellWidth,
minCellSize[INDEX_DEFAULT].x);
@@ -1099,6 +1121,9 @@ public class InvariantDeviceProfile {
allAppsBorderSpaces[i] = new PointF();
inlineQsb[i] = false;
}
folderBorderSpaces = new PointF();
folderCellSize = new PointF();
folderTopPadding = 0f;
}
private DisplayOption multiply(float w) {
@@ -1119,8 +1144,11 @@ public class InvariantDeviceProfile {
allAppsBorderSpaces[i].x *= w;
allAppsBorderSpaces[i].y *= w;
}
folderBorderSpace *= w;
folderBorderSpaces.x *= w;
folderBorderSpaces.y *= w;
folderCellSize.x *= w;
folderCellSize.y *= w;
folderTopPadding *= w;
return this;
}
@@ -1144,8 +1172,11 @@ public class InvariantDeviceProfile {
allAppsBorderSpaces[i].y += p.allAppsBorderSpaces[i].y;
inlineQsb[i] |= p.inlineQsb[i];
}
folderBorderSpace += p.folderBorderSpace;
folderBorderSpaces.x += p.folderBorderSpaces.x;
folderBorderSpaces.y += p.folderBorderSpaces.y;
folderCellSize.x += p.folderCellSize.x;
folderCellSize.y += p.folderCellSize.y;
folderTopPadding += p.folderTopPadding;
return this;
}

View File

@@ -96,8 +96,6 @@ abstract class DeviceProfileBaseTest {
numColumns = 4
numSearchContainerColumns = 4
numFolderRows = 3
numFolderColumns = 3
iconSize = floatArrayOf(60f, 54f, 60f, 60f)
iconTextSize = FloatArray(4) { 14f }
deviceType = InvariantDeviceProfile.TYPE_PHONE
@@ -115,7 +113,14 @@ abstract class DeviceProfileBaseTest {
PointF(16f, 16f),
PointF(16f, 16f)
).toTypedArray()
folderBorderSpace = 16f
numFolderRows = 3
numFolderColumns = 3
folderBorderSpaces = PointF(16f, 16f)
folderTopPadding = 24f
folderCellSize = PointF(80f, 94f)
inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_5
horizontalMargin = FloatArray(4) { 22f }
@@ -199,6 +204,13 @@ abstract class DeviceProfileBaseTest {
PointF(16f, 64f),
PointF(16f, 64f)
).toTypedArray()
numFolderRows = 3
numFolderColumns = 3
folderBorderSpaces = PointF(16f, 16f)
folderTopPadding = 24f
folderCellSize = PointF(120f, 104f)
inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_6_5
horizontalMargin = floatArrayOf(54f, 120f, 54f, 54f)
@@ -273,8 +285,6 @@ abstract class DeviceProfileBaseTest {
numColumns = 4
numSearchContainerColumns = 4
numFolderRows = 3
numFolderColumns = 4
iconSize = floatArrayOf(60f, 52f, 52f, 60f)
iconTextSize = floatArrayOf(14f, 14f, 12f, 14f)
deviceType = InvariantDeviceProfile.TYPE_MULTI_DISPLAY
@@ -292,7 +302,13 @@ abstract class DeviceProfileBaseTest {
PointF(16f, 20f),
PointF(20f, 20f)
).toTypedArray()
folderBorderSpace = 16f
numFolderRows = 3
numFolderColumns = 3
folderBorderSpaces = PointF(16f, 16f)
folderTopPadding = 24f
folderCellSize = PointF(80f, 94f)
inlineNavButtonsEndSpacing = R.dimen.taskbar_button_margin_4_4
horizontalMargin = floatArrayOf(21.5f, 21.5f, 22.5f, 30.5f)