mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Using dragHandle for workspace padding calculation instead of pageIndicator
> PageIndicator is a 1dp indicator which does not contribute in any padding calculations Bug: 79111591 Change-Id: I4d8be0149da2b3f14593ae71ca037ffe3885d9be
This commit is contained in:
@@ -70,8 +70,8 @@ public class DeviceProfile {
|
||||
public float workspaceSpringLoadShrinkFactor;
|
||||
public final int workspaceSpringLoadedBottomSpace;
|
||||
|
||||
// Page indicator
|
||||
public final int pageIndicatorSizePx;
|
||||
// Drag handle
|
||||
public final int verticalDragHandleSizePx;
|
||||
|
||||
// Workspace icons
|
||||
public int iconSizePx;
|
||||
@@ -160,8 +160,8 @@ public class DeviceProfile {
|
||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding);
|
||||
cellLayoutBottomPaddingPx =
|
||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_bottom_padding);
|
||||
pageIndicatorSizePx = res.getDimensionPixelSize(
|
||||
R.dimen.dynamic_grid_min_page_indicator_size);
|
||||
verticalDragHandleSizePx = res.getDimensionPixelSize(
|
||||
R.dimen.vertical_drag_handle_size);
|
||||
defaultPageSpacingPx =
|
||||
res.getDimensionPixelSize(R.dimen.dynamic_grid_workspace_page_spacing);
|
||||
topWorkspacePadding =
|
||||
@@ -208,7 +208,7 @@ public class DeviceProfile {
|
||||
// in portrait mode closer together by adding more height to the hotseat.
|
||||
// Note: This calculation was created after noticing a pattern in the design spec.
|
||||
int extraSpace = getCellSize().y - iconSizePx - iconDrawablePaddingPx;
|
||||
hotseatBarSizePx += extraSpace - pageIndicatorSizePx;
|
||||
hotseatBarSizePx += extraSpace - verticalDragHandleSizePx;
|
||||
|
||||
// Recalculate the available dimensions using the new hotseat size.
|
||||
updateAvailableDimensions(dm, res);
|
||||
@@ -332,7 +332,7 @@ public class DeviceProfile {
|
||||
|
||||
if (!isVerticalLayout) {
|
||||
int expectedWorkspaceHeight = availableHeightPx - hotseatBarSizePx
|
||||
- pageIndicatorSizePx - topWorkspacePadding;
|
||||
- verticalDragHandleSizePx - topWorkspacePadding;
|
||||
float minRequiredHeight = dropTargetBarSizePx + workspaceSpringLoadedBottomSpace;
|
||||
workspaceSpringLoadShrinkFactor = Math.min(
|
||||
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f,
|
||||
@@ -429,13 +429,13 @@ public class DeviceProfile {
|
||||
padding.right = hotseatBarSidePaddingPx;
|
||||
if (isSeascape()) {
|
||||
padding.left += hotseatBarSizePx;
|
||||
padding.right += pageIndicatorSizePx;
|
||||
padding.right += verticalDragHandleSizePx;
|
||||
} else {
|
||||
padding.left += pageIndicatorSizePx;
|
||||
padding.left += verticalDragHandleSizePx;
|
||||
padding.right += hotseatBarSizePx;
|
||||
}
|
||||
} else {
|
||||
int paddingBottom = hotseatBarSizePx + pageIndicatorSizePx;
|
||||
int paddingBottom = hotseatBarSizePx + verticalDragHandleSizePx;
|
||||
if (isTablet) {
|
||||
// Pad the left and right of the workspace to ensure consistent spacing
|
||||
// between all icons
|
||||
@@ -502,7 +502,7 @@ public class DeviceProfile {
|
||||
mInsets.top + dropTargetBarSizePx + edgeMarginPx,
|
||||
mInsets.left + availableWidthPx - edgeMarginPx,
|
||||
mInsets.top + availableHeightPx - hotseatBarSizePx
|
||||
- pageIndicatorSizePx - edgeMarginPx);
|
||||
- verticalDragHandleSizePx - edgeMarginPx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user