Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8b8de1f authored by Pat Manning's avatar Pat Manning Committed by Automerger Merge Worker
Browse files

Bound drop target layout values to left and right. am: 3c0f4c15 am: 781c68b2

parents c6df6eda 781c68b2
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -285,13 +285,21 @@ public class DropTargetBar extends FrameLayout
                int buttonPlusGapWidth = leftButtonWidth + buttonGap + rightButtonWidth;

                int extraSpace = end - start - buttonPlusGapWidth;
                start = (start - left) + (extraSpace / 2);

                leftButton.layout(start, 0, start + leftButtonWidth,
                int leftBound = Math.max(left, 0);
                int rightBound = Math.min(right, dp.availableWidthPx);

                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());
            }
        }