mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Revert "Adjust edit state drop targets, workspace scaling, and m..."
Test: manual Revert submission 17004675-edit-state Reason for revert: b/226274309 Reverted Changes: Ib50509b6f:Adjust edit state drop targets per device type and... Id1817cd3c:Adjust edit state drop targets, workspace scaling,... Change-Id: I22863d7735f49f6a040a17cf56cc66f20a3e0986
This commit is contained in:
@@ -324,14 +324,37 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
setPageSpacing(Math.max(maxInsets, maxPadding));
|
||||
}
|
||||
|
||||
updateCellLayoutPadding();
|
||||
updateWorkspaceScreensPadding();
|
||||
updateWorkspaceWidgetsSizes();
|
||||
}
|
||||
|
||||
private void updateCellLayoutPadding() {
|
||||
Rect padding = mLauncher.getDeviceProfile().cellLayoutPaddingPx;
|
||||
mWorkspaceScreens.forEach(
|
||||
s -> s.setPadding(padding.left, padding.top, padding.right, padding.bottom));
|
||||
private void updateWorkspaceScreensPadding() {
|
||||
DeviceProfile grid = mLauncher.getDeviceProfile();
|
||||
int paddingLeftRight = grid.cellLayoutPaddingLeftRightPx;
|
||||
int paddingBottom = grid.cellLayoutBottomPaddingPx;
|
||||
|
||||
int panelCount = getPanelCount();
|
||||
int rightPanelModulus = mIsRtl ? 0 : panelCount - 1;
|
||||
int leftPanelModulus = mIsRtl ? panelCount - 1 : 0;
|
||||
int numberOfScreens = mScreenOrder.size();
|
||||
for (int i = 0; i < numberOfScreens; i++) {
|
||||
int paddingLeft = paddingLeftRight;
|
||||
int paddingRight = paddingLeftRight;
|
||||
// Add missing cellLayout border in-between panels.
|
||||
if (panelCount > 1) {
|
||||
if (i % panelCount == leftPanelModulus) {
|
||||
paddingRight += grid.cellLayoutBorderSpacePx.x / 2;
|
||||
} else if (i % panelCount == rightPanelModulus) { // right side panel
|
||||
paddingLeft += grid.cellLayoutBorderSpacePx.x / 2;
|
||||
} else { // middle panel
|
||||
paddingLeft += grid.cellLayoutBorderSpacePx.x / 2;
|
||||
paddingRight += grid.cellLayoutBorderSpacePx.x / 2;
|
||||
}
|
||||
}
|
||||
// SparseArrayMap doesn't keep the order
|
||||
mWorkspaceScreens.get(mScreenOrder.get(i))
|
||||
.setPadding(paddingLeft, 0, paddingRight, paddingBottom);
|
||||
}
|
||||
}
|
||||
|
||||
private void updateWorkspaceWidgetsSizes() {
|
||||
@@ -629,7 +652,7 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
|
||||
mLauncher.getStateManager().getState(), newScreen, insertIndex);
|
||||
|
||||
updatePageScrollValues();
|
||||
updateCellLayoutPadding();
|
||||
updateWorkspaceScreensPadding();
|
||||
return newScreen;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user