mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Bound drop target layout values to left and right.
Test: manual Fix: 232636570 Bug: 233225825 Change-Id: I388cb3407cb9f887ccc222f4804636f9f7651884
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