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/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 13971ad..14d8b93 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -117,6 +117,7 @@
// Insets
private final Rect mInsets = new Rect();
public final Rect workspacePadding = new Rect();
+ private final Rect mHotseatPadding = new Rect();
// Icon badges
public BadgeRenderer mBadgeRenderer;
@@ -456,6 +457,33 @@
}
}
+ public Rect getHotseatLayoutPadding() {
+ if (isVerticalBarLayout()) {
+ if (isSeascape()) {
+ mHotseatPadding.set(
+ mInsets.left, mInsets.top, hotseatBarSidePaddingPx, mInsets.bottom);
+ } else {
+ mHotseatPadding.set(
+ hotseatBarSidePaddingPx, mInsets.top, mInsets.right, mInsets.bottom);
+ }
+ } else {
+
+ // 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) widthPx / inv.numColumns;
+ float hotseatCellWidth = (float) widthPx / inv.numHotseatIcons;
+ int hotseatAdjustment = Math.round((workspaceCellWidth - hotseatCellWidth) / 2);
+ mHotseatPadding.set(
+ hotseatAdjustment + workspacePadding.left + cellLayoutPaddingLeftRightPx,
+ hotseatBarTopPaddingPx,
+ hotseatAdjustment + workspacePadding.right + cellLayoutPaddingLeftRightPx,
+ hotseatBarBottomPaddingPx + mInsets.bottom + cellLayoutBottomPaddingPx);
+ }
+ return mHotseatPadding;
+ }
+
/**
* @return the bounds for which the open folders should be contained within
*/