[automerger] Using dragHandle for workspace padding calculation instead of pageIndicator am: 08ef66789b

Change-Id: If1cee04dcd365d87328119ccec457c30c0fb317d
This commit is contained in:
Android Build Merger (Role) 2018-05-10 18:33:17 +00:00
commit 1e4420c4ab
5 changed files with 11 additions and 17 deletions

View File

@ -42,8 +42,7 @@ public class LayoutUtils {
if (dp.isVerticalBarLayout()) { if (dp.isVerticalBarLayout()) {
extraSpace = 0; extraSpace = 0;
} else { } else {
Resources res = context.getResources(); extraSpace = dp.hotseatBarSizePx + dp.verticalDragHandleSizePx;
extraSpace = dp.hotseatBarSizePx + res.getDimension(R.dimen.vertical_drag_handle_size);
} }
calculateTaskSize(context, dp, extraSpace, MULTI_WINDOW_STRATEGY_HALF_SCREEN, outRect); calculateTaskSize(context, dp, extraSpace, MULTI_WINDOW_STRATEGY_HALF_SCREEN, outRect);
} }

View File

@ -25,7 +25,6 @@
<dimen name="fastscroll_popup_text_size">24dp</dimen> <dimen name="fastscroll_popup_text_size">24dp</dimen>
<!-- Dynamic grid --> <!-- Dynamic grid -->
<dimen name="dynamic_grid_min_page_indicator_size">48dp</dimen>
<dimen name="dynamic_grid_icon_drawable_padding">4dp</dimen> <dimen name="dynamic_grid_icon_drawable_padding">4dp</dimen>
<dimen name="dynamic_grid_cell_layout_padding">0dp</dimen> <dimen name="dynamic_grid_cell_layout_padding">0dp</dimen>

View File

@ -15,9 +15,6 @@
--> -->
<resources> <resources>
<!-- Dynamic Grid -->
<dimen name="dynamic_grid_min_page_indicator_size">24dp</dimen>
<!-- All Apps --> <!-- All Apps -->
<dimen name="all_apps_button_scale_down">8dp</dimen> <dimen name="all_apps_button_scale_down">8dp</dimen>
<dimen name="all_apps_empty_search_message_top_offset">64dp</dimen> <dimen name="all_apps_empty_search_message_top_offset">64dp</dimen>

View File

@ -20,7 +20,6 @@
<!-- Dynamic Grid --> <!-- Dynamic Grid -->
<dimen name="dynamic_grid_edge_margin">8dp</dimen> <dimen name="dynamic_grid_edge_margin">8dp</dimen>
<dimen name="dynamic_grid_min_page_indicator_size">24dp</dimen>
<dimen name="dynamic_grid_page_indicator_line_height">1dp</dimen> <dimen name="dynamic_grid_page_indicator_line_height">1dp</dimen>
<dimen name="dynamic_grid_icon_drawable_padding">8dp</dimen> <dimen name="dynamic_grid_icon_drawable_padding">8dp</dimen>
<dimen name="dynamic_grid_workspace_top_padding">8dp</dimen> <dimen name="dynamic_grid_workspace_top_padding">8dp</dimen>

View File

@ -70,8 +70,8 @@ public class DeviceProfile {
public float workspaceSpringLoadShrinkFactor; public float workspaceSpringLoadShrinkFactor;
public final int workspaceSpringLoadedBottomSpace; public final int workspaceSpringLoadedBottomSpace;
// Page indicator // Drag handle
public final int pageIndicatorSizePx; public final int verticalDragHandleSizePx;
// Workspace icons // Workspace icons
public int iconSizePx; public int iconSizePx;
@ -160,8 +160,8 @@ public class DeviceProfile {
res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding); res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_padding);
cellLayoutBottomPaddingPx = cellLayoutBottomPaddingPx =
res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_bottom_padding); res.getDimensionPixelSize(R.dimen.dynamic_grid_cell_layout_bottom_padding);
pageIndicatorSizePx = res.getDimensionPixelSize( verticalDragHandleSizePx = res.getDimensionPixelSize(
R.dimen.dynamic_grid_min_page_indicator_size); R.dimen.vertical_drag_handle_size);
defaultPageSpacingPx = defaultPageSpacingPx =
res.getDimensionPixelSize(R.dimen.dynamic_grid_workspace_page_spacing); res.getDimensionPixelSize(R.dimen.dynamic_grid_workspace_page_spacing);
topWorkspacePadding = topWorkspacePadding =
@ -208,7 +208,7 @@ public class DeviceProfile {
// in portrait mode closer together by adding more height to the hotseat. // 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. // Note: This calculation was created after noticing a pattern in the design spec.
int extraSpace = getCellSize().y - iconSizePx - iconDrawablePaddingPx; int extraSpace = getCellSize().y - iconSizePx - iconDrawablePaddingPx;
hotseatBarSizePx += extraSpace - pageIndicatorSizePx; hotseatBarSizePx += extraSpace - verticalDragHandleSizePx;
// Recalculate the available dimensions using the new hotseat size. // Recalculate the available dimensions using the new hotseat size.
updateAvailableDimensions(dm, res); updateAvailableDimensions(dm, res);
@ -332,7 +332,7 @@ public class DeviceProfile {
if (!isVerticalLayout) { if (!isVerticalLayout) {
int expectedWorkspaceHeight = availableHeightPx - hotseatBarSizePx int expectedWorkspaceHeight = availableHeightPx - hotseatBarSizePx
- pageIndicatorSizePx - topWorkspacePadding; - verticalDragHandleSizePx - topWorkspacePadding;
float minRequiredHeight = dropTargetBarSizePx + workspaceSpringLoadedBottomSpace; float minRequiredHeight = dropTargetBarSizePx + workspaceSpringLoadedBottomSpace;
workspaceSpringLoadShrinkFactor = Math.min( workspaceSpringLoadShrinkFactor = Math.min(
res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f, res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100.0f,
@ -429,13 +429,13 @@ public class DeviceProfile {
padding.right = hotseatBarSidePaddingPx; padding.right = hotseatBarSidePaddingPx;
if (isSeascape()) { if (isSeascape()) {
padding.left += hotseatBarSizePx; padding.left += hotseatBarSizePx;
padding.right += pageIndicatorSizePx; padding.right += verticalDragHandleSizePx;
} else { } else {
padding.left += pageIndicatorSizePx; padding.left += verticalDragHandleSizePx;
padding.right += hotseatBarSizePx; padding.right += hotseatBarSizePx;
} }
} else { } else {
int paddingBottom = hotseatBarSizePx + pageIndicatorSizePx; int paddingBottom = hotseatBarSizePx + verticalDragHandleSizePx;
if (isTablet) { if (isTablet) {
// Pad the left and right of the workspace to ensure consistent spacing // Pad the left and right of the workspace to ensure consistent spacing
// between all icons // between all icons
@ -502,7 +502,7 @@ public class DeviceProfile {
mInsets.top + dropTargetBarSizePx + edgeMarginPx, mInsets.top + dropTargetBarSizePx + edgeMarginPx,
mInsets.left + availableWidthPx - edgeMarginPx, mInsets.left + availableWidthPx - edgeMarginPx,
mInsets.top + availableHeightPx - hotseatBarSizePx mInsets.top + availableHeightPx - hotseatBarSizePx
- pageIndicatorSizePx - edgeMarginPx); - verticalDragHandleSizePx - edgeMarginPx);
} }
} }