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

Commit 59a11c63 authored by Alex Stetson's avatar Alex Stetson
Browse files

Ensure toolbar popup respects left system bars

The current x position calculation only respects the right side of the
display frame, not the left side. This can cause the popup to sometimes
render under a system bar attached to the left side of the screen.

Bug: 328290309
Test: manual
Flag: NONE bugfix
Change-Id: I81be5f6d32fb0ac318f1efc81b776824e0951427
parent fcd43343
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -437,9 +437,8 @@ public final class LocalFloatingToolbarPopup implements FloatingToolbarPopup {

        // Initialize x ensuring that the toolbar isn't rendered behind the nav bar in
        // landscape.
        final int x = Math.min(
                contentRectOnScreen.centerX() - mPopupWindow.getWidth() / 2,
                mViewPortOnScreen.right - mPopupWindow.getWidth());
        final int x = Math.clamp(contentRectOnScreen.centerX() - mPopupWindow.getWidth() / 2,
                mViewPortOnScreen.left, mViewPortOnScreen.right - mPopupWindow.getWidth());

        final int y;