Loading res/values/dimens.xml +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ <dimen name="dynamic_grid_cell_layout_padding">5.5dp</dimen> <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> <dimen name="two_panel_home_side_padding">18dp</dimen> <dimen name="two_panels_home_side_padding_landscape">36dp</dimen> <dimen name="two_panels_home_side_padding_portrait">9dp</dimen> <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen> Loading src/com/android/launcher3/DeviceProfile.java +12 −4 Original line number Diff line number Diff line Loading @@ -303,8 +303,10 @@ public class DeviceProfile { : res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); if (isTwoPanels) { cellLayoutPaddingLeftRightPx = res.getDimensionPixelSize(R.dimen.two_panel_home_side_padding); cellLayoutPaddingLeftRightPx = res.getDimensionPixelSize( isLandscape ? R.dimen.two_panels_home_side_padding_landscape : R.dimen.two_panels_home_side_padding_portrait); cellLayoutBottomPaddingPx = 0; } else if (isLandscape) { cellLayoutPaddingLeftRightPx = 0; Loading Loading @@ -753,8 +755,14 @@ public class DeviceProfile { // Since we are only concerned with the overall padding, layout direction does // not matter. Point padding = getTotalWorkspacePadding(); result.x = calculateCellWidth(availableWidthPx - padding.x - cellLayoutPaddingLeftRightPx * 2, cellLayoutBorderSpacingPx, inv.numColumns); // availableWidthPx is the screen width of the device. In 2 panels mode, each panel should // only have half of the screen width. In addition, there is only cellLayoutPadding in the // left side of the left panel and the right side of the right panel. There is no // cellLayoutPadding in the middle. int screenWidthPx = isTwoPanels ? availableWidthPx / 2 - padding.x - cellLayoutPaddingLeftRightPx : availableWidthPx - padding.x - cellLayoutPaddingLeftRightPx * 2; result.x = calculateCellWidth(screenWidthPx, cellLayoutBorderSpacingPx, inv.numColumns); result.y = calculateCellHeight(availableHeightPx - padding.y - cellLayoutBottomPaddingPx, cellLayoutBorderSpacingPx, inv.numRows); return result; Loading src/com/android/launcher3/Workspace.java +2 −6 Original line number Diff line number Diff line Loading @@ -327,8 +327,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator> int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx; int paddingBottom = grid.cellLayoutBottomPaddingPx; int twoPanelLandscapeSidePadding = paddingLeftRight * 2; int twoPanelPortraitSidePadding = paddingLeftRight / 2; int panelCount = getPanelCount(); for (int i = mWorkspaceScreens.size() - 1; i >= 0; i--) { Loading @@ -336,13 +334,11 @@ public class Workspace extends PagedView<WorkspacePageIndicator> int paddingRight = paddingLeftRight; if (panelCount > 1) { if (i % panelCount == 0) { // left side panel paddingLeft = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; paddingLeft = paddingLeftRight; paddingRight = 0; } else if (i % panelCount == panelCount - 1) { // right side panel paddingLeft = 0; paddingRight = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; paddingRight = paddingLeftRight; } else { // middle panel paddingLeft = 0; paddingRight = 0; Loading Loading
res/values/dimens.xml +2 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,8 @@ <dimen name="dynamic_grid_cell_layout_padding">5.5dp</dimen> <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> <dimen name="two_panel_home_side_padding">18dp</dimen> <dimen name="two_panels_home_side_padding_landscape">36dp</dimen> <dimen name="two_panels_home_side_padding_portrait">9dp</dimen> <!-- Hotseat --> <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen> Loading
src/com/android/launcher3/DeviceProfile.java +12 −4 Original line number Diff line number Diff line Loading @@ -303,8 +303,10 @@ public class DeviceProfile { : res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); if (isTwoPanels) { cellLayoutPaddingLeftRightPx = res.getDimensionPixelSize(R.dimen.two_panel_home_side_padding); cellLayoutPaddingLeftRightPx = res.getDimensionPixelSize( isLandscape ? R.dimen.two_panels_home_side_padding_landscape : R.dimen.two_panels_home_side_padding_portrait); cellLayoutBottomPaddingPx = 0; } else if (isLandscape) { cellLayoutPaddingLeftRightPx = 0; Loading Loading @@ -753,8 +755,14 @@ public class DeviceProfile { // Since we are only concerned with the overall padding, layout direction does // not matter. Point padding = getTotalWorkspacePadding(); result.x = calculateCellWidth(availableWidthPx - padding.x - cellLayoutPaddingLeftRightPx * 2, cellLayoutBorderSpacingPx, inv.numColumns); // availableWidthPx is the screen width of the device. In 2 panels mode, each panel should // only have half of the screen width. In addition, there is only cellLayoutPadding in the // left side of the left panel and the right side of the right panel. There is no // cellLayoutPadding in the middle. int screenWidthPx = isTwoPanels ? availableWidthPx / 2 - padding.x - cellLayoutPaddingLeftRightPx : availableWidthPx - padding.x - cellLayoutPaddingLeftRightPx * 2; result.x = calculateCellWidth(screenWidthPx, cellLayoutBorderSpacingPx, inv.numColumns); result.y = calculateCellHeight(availableHeightPx - padding.y - cellLayoutBottomPaddingPx, cellLayoutBorderSpacingPx, inv.numRows); return result; Loading
src/com/android/launcher3/Workspace.java +2 −6 Original line number Diff line number Diff line Loading @@ -327,8 +327,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator> int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx; int paddingBottom = grid.cellLayoutBottomPaddingPx; int twoPanelLandscapeSidePadding = paddingLeftRight * 2; int twoPanelPortraitSidePadding = paddingLeftRight / 2; int panelCount = getPanelCount(); for (int i = mWorkspaceScreens.size() - 1; i >= 0; i--) { Loading @@ -336,13 +334,11 @@ public class Workspace extends PagedView<WorkspacePageIndicator> int paddingRight = paddingLeftRight; if (panelCount > 1) { if (i % panelCount == 0) { // left side panel paddingLeft = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; paddingLeft = paddingLeftRight; paddingRight = 0; } else if (i % panelCount == panelCount - 1) { // right side panel paddingLeft = 0; paddingRight = grid.isLandscape ? twoPanelLandscapeSidePadding : twoPanelPortraitSidePadding; paddingRight = paddingLeftRight; } else { // middle panel paddingLeft = 0; paddingRight = 0; Loading