diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2018-05-10 11:32:00 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2018-05-10 11:33:11 -0700 |
commit | 08ef66789b7108694b075df43496042003fdfabe (patch) | |
tree | 69bbf6a8a6613e812ab93409d35098ffb229ed08 /src | |
parent | 5d1873a812297ad207df1f068a987d2dd84a9888 (diff) | |
download | android_packages_apps_Trebuchet-08ef66789b7108694b075df43496042003fdfabe.tar.gz android_packages_apps_Trebuchet-08ef66789b7108694b075df43496042003fdfabe.tar.bz2 android_packages_apps_Trebuchet-08ef66789b7108694b075df43496042003fdfabe.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 4f9920c5b..2f4772806 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -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); } } |