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

Commit 3c0f4c15 authored by Pat Manning's avatar Pat Manning
Browse files

Bound drop target layout values to left and right.

Test: manual
Fix: 232636570
Bug: 233225825
Change-Id: I388cb3407cb9f887ccc222f4804636f9f7651884
parent 3e6cd999
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());
            }
        }