Adding a custom view for DragHandle
> Separating page indicator and drag handle
> Page indicator always draws irrespactive of oriantation
> Drag handle is responsible for accessibility interactions
> Adding assissibility actions for DragHandle
Bug: 72500733
Change-Id: I9030337456964af1bdf77f1c01956452321f9229
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 211a756..9660468 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -152,19 +152,13 @@
if (mHasVerticalHotseat) {
mContent.setGridSize(1, grid.inv.numHotseatIcons);
-
lp.height = ViewGroup.LayoutParams.MATCH_PARENT;
if (grid.isSeascape()) {
lp.gravity = Gravity.LEFT;
lp.width = grid.hotseatBarSizePx + insets.left + grid.hotseatBarSidePaddingPx;
- getLayout().setPadding(
- insets.left, insets.top, grid.hotseatBarSidePaddingPx, insets.bottom);
-
} else {
lp.gravity = Gravity.RIGHT;
lp.width = grid.hotseatBarSizePx + insets.right + grid.hotseatBarSidePaddingPx;
- getLayout().setPadding(
- grid.hotseatBarSidePaddingPx, insets.top, insets.right, insets.bottom);
}
} else {
mContent.setGridSize(grid.inv.numHotseatIcons, 1);
@@ -172,22 +166,10 @@
lp.gravity = Gravity.BOTTOM;
lp.width = ViewGroup.LayoutParams.MATCH_PARENT;
lp.height = grid.hotseatBarSizePx + insets.bottom;
-
- // We want the edges of the hotseat to line up with the edges of the workspace, but the
- // icons in the hotseat are a different size, and so don't line up perfectly. To account for
- // this, we pad the left and right of the hotseat with half of the difference of a workspace
- // cell vs a hotseat cell.
- float workspaceCellWidth = (float) grid.widthPx / grid.inv.numColumns;
- float hotseatCellWidth = (float) grid.widthPx / grid.inv.numHotseatIcons;
- int hotseatAdjustment = Math.round((workspaceCellWidth - hotseatCellWidth) / 2);
- Rect workspacePadding = grid.workspacePadding;
-
- getLayout().setPadding(
- hotseatAdjustment + workspacePadding.left + grid.cellLayoutPaddingLeftRightPx,
- grid.hotseatBarTopPaddingPx,
- hotseatAdjustment + workspacePadding.right + grid.cellLayoutPaddingLeftRightPx,
- grid.hotseatBarBottomPaddingPx + insets.bottom + grid.cellLayoutBottomPaddingPx);
}
+ Rect padding = grid.getHotseatLayoutPadding();
+ getLayout().setPadding(padding.left, padding.top, padding.right, padding.bottom);
+
setLayoutParams(lp);
InsettableFrameLayout.dispatchInsets(this, insets);
}