Merge "Fix issue where allAppsCellWidth is 0" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e9b40bec24
@@ -252,9 +252,10 @@
|
||||
if not specified -->
|
||||
<attr name="borderSpaceTwoPanelLandscapeVertical" format="float" />
|
||||
|
||||
<!-- These min cell values are only used if GridDisplayOption#isScalable is true -->
|
||||
<!-- defaults to minCellHeight, if not specified -->
|
||||
<!-- defaults to minCellHeight if not specified when GridDisplayOption#isScalable is true.
|
||||
Must be defined when GridDisplayOption#isScalable is false. -->
|
||||
<attr name="allAppsCellHeight" format="float" />
|
||||
<!-- These min cell values are only used if GridDisplayOption#isScalable is true -->
|
||||
<!-- defaults to minCellWidth, if not specified -->
|
||||
<attr name="allAppsCellWidth" format="float" />
|
||||
<!-- defaults to allAppsCellHeight, if not specified -->
|
||||
|
||||
@@ -799,13 +799,13 @@ public class DeviceProfile {
|
||||
+ allAppsBorderSpacePx.y;
|
||||
// but width is just the cell,
|
||||
// the border is added in #updateAllAppsContainerWidth
|
||||
allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale);
|
||||
if (isScalableGrid) {
|
||||
allAppsIconSizePx =
|
||||
pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics, scale);
|
||||
allAppsIconTextSizePx =
|
||||
pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics, scale);
|
||||
allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx;
|
||||
allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale);
|
||||
} else {
|
||||
float invIconSizeDp = inv.allAppsIconSize[mTypeIndex];
|
||||
float invIconTextSizeSp = inv.allAppsIconTextSize[mTypeIndex];
|
||||
@@ -813,6 +813,7 @@ public class DeviceProfile {
|
||||
allAppsIconTextSizePx = (int) (pxFromSp(invIconTextSizeSp, mMetrics) * scale);
|
||||
allAppsIconDrawablePaddingPx =
|
||||
res.getDimensionPixelSize(R.dimen.all_apps_icon_drawable_padding);
|
||||
allAppsCellWidthPx = allAppsIconSizePx + (2 * allAppsIconDrawablePaddingPx);
|
||||
}
|
||||
|
||||
updateAllAppsContainerWidth(res);
|
||||
|
||||
Reference in New Issue
Block a user