Consider two panel in home to overview transition

- Get the value from DeviceProfile directly

Fix: 202444558
Test: manual
Change-Id: Ifadbbf34c8103d7275b8b4043dcae47d1168ae83
This commit is contained in:
Alex Chau
2021-11-24 18:11:45 +00:00
parent 226bd5b973
commit 6095333370
2 changed files with 12 additions and 9 deletions
+11 -3
View File
@@ -813,15 +813,23 @@ public class DeviceProfile {
Point padding = getTotalWorkspacePadding();
int numColumns = isTwoPanels ? inv.numColumns * 2 : inv.numColumns;
int cellLayoutTotalPadding =
isTwoPanels ? 4 * cellLayoutPaddingLeftRightPx : 2 * cellLayoutPaddingLeftRightPx;
int screenWidthPx = availableWidthPx - padding.x - cellLayoutTotalPadding;
int screenWidthPx = getWorkspaceWidth(padding);
result.x = calculateCellWidth(screenWidthPx, cellLayoutBorderSpacePx.x, numColumns);
result.y = calculateCellHeight(availableHeightPx - padding.y
- cellLayoutBottomPaddingPx, cellLayoutBorderSpacePx.y, inv.numRows);
return result;
}
public int getWorkspaceWidth() {
return getWorkspaceWidth(getTotalWorkspacePadding());
}
public int getWorkspaceWidth(Point workspacePadding) {
int cellLayoutTotalPadding =
isTwoPanels ? 4 * cellLayoutPaddingLeftRightPx : 2 * cellLayoutPaddingLeftRightPx;
return availableWidthPx - workspacePadding.x - cellLayoutTotalPadding;
}
public Point getTotalWorkspacePadding() {
updateWorkspacePadding();
return new Point(workspacePadding.left + workspacePadding.right,