Bound drop target layout values to left and right. am: 3c0f4c156d am: 781c68b236
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18491881 Change-Id: I14acd17e473d0f2a081a90e41bfb1598f21c49d9 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 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());
|
||||
|
||||
int rightButtonStart = start + leftButtonWidth + buttonGap;
|
||||
rightButton.layout(rightButtonStart, 0, rightButtonStart + rightButtonWidth,
|
||||
rightButton.layout(rightButtonStart, 0, rightButtonEnd,
|
||||
rightButton.getMeasuredHeight());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user