Bound drop target layout values to left and right. am: 3c0f4c156d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18491881 Change-Id: I9828fe17f8d36187d560a05071e483507c32fd85 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -285,13 +285,21 @@ public class DropTargetBar extends FrameLayout
|
|||||||
int buttonPlusGapWidth = leftButtonWidth + buttonGap + rightButtonWidth;
|
int buttonPlusGapWidth = leftButtonWidth + buttonGap + rightButtonWidth;
|
||||||
|
|
||||||
int extraSpace = end - start - buttonPlusGapWidth;
|
int extraSpace = end - start - buttonPlusGapWidth;
|
||||||
start = (start - left) + (extraSpace / 2);
|
int leftBound = Math.max(left, 0);
|
||||||
|
int rightBound = Math.min(right, dp.availableWidthPx);
|
||||||
|
|
||||||
leftButton.layout(start, 0, start + leftButtonWidth,
|
int leftButtonStart = Utilities.boundToRange(
|
||||||
|
(start - left) + (extraSpace / 2), leftBound, rightBound);
|
||||||
|
int leftButtonEnd = Utilities.boundToRange(
|
||||||
|
leftButtonStart + leftButtonWidth, leftBound, rightBound);
|
||||||
|
int rightButtonStart = Utilities.boundToRange(
|
||||||
|
leftButtonEnd + buttonGap, leftBound, rightBound);
|
||||||
|
int rightButtonEnd = Utilities.boundToRange(
|
||||||
|
rightButtonStart + rightButtonWidth, leftBound, rightBound);
|
||||||
|
|
||||||
|
leftButton.layout(leftButtonStart, 0, leftButtonEnd,
|
||||||
leftButton.getMeasuredHeight());
|
leftButton.getMeasuredHeight());
|
||||||
|
rightButton.layout(rightButtonStart, 0, rightButtonEnd,
|
||||||
int rightButtonStart = start + leftButtonWidth + buttonGap;
|
|
||||||
rightButton.layout(rightButtonStart, 0, rightButtonStart + rightButtonWidth,
|
|
||||||
rightButton.getMeasuredHeight());
|
rightButton.getMeasuredHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user