Merge "Update extra space allocations for taller devices." into sc-dev

This commit is contained in:
Jonathan Miranda 2021-08-05 18:33:56 +00:00 committed by Android (Google) Code Review
commit dd16ecbc61
1 changed files with 5 additions and 4 deletions

View File

@ -386,14 +386,15 @@ public class DeviceProfile {
// For devices with more extra space, we take a larger piece from each cell. // For devices with more extra space, we take a larger piece from each cell.
int piece = extraSpace < Utilities.dpToPx(TALL_DEVICE_MORE_EXTRA_SPACE_THRESHOLD_DP) int piece = extraSpace < Utilities.dpToPx(TALL_DEVICE_MORE_EXTRA_SPACE_THRESHOLD_DP)
? 5 : 3; ? 7 : 5;
int extraSpace = ((getCellSize().y - iconSizePx - iconDrawablePaddingPx * 2) int extraSpace = ((getCellSize().y - iconSizePx - iconDrawablePaddingPx * 2)
* inv.numRows) / piece; * inv.numRows) / piece;
int halfExtraSpace = extraSpace / 2; workspaceTopPadding = extraSpace / 8;
hotseatBarTopPaddingPx += halfExtraSpace; int halfLeftOver = (extraSpace - workspaceTopPadding) / 2;
hotseatBarSizeExtraSpacePx = halfExtraSpace; hotseatBarTopPaddingPx += halfLeftOver;
hotseatBarSizeExtraSpacePx = halfLeftOver;
} else { } else {
// ie. For a display with a large aspect ratio, we can keep the icons on the // ie. For a display with a large aspect ratio, we can keep the icons on the
// workspace in portrait mode closer together by adding more height to the hotseat. // workspace in portrait mode closer together by adding more height to the hotseat.