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

Commit d70e0b04 authored by Evan Laird's avatar Evan Laird Committed by android-build-merger
Browse files

Merge "Don't apply corner cutout insets if we're already inset enough" into pi-dev

am: f0cbbff6

Change-Id: I8c0e23fcac114f7dc41bf45f60b75408ab53a5bf
parents 16130241 f0cbbff6
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -332,6 +332,18 @@ public class PhoneStatusBarView extends PanelBar {
        if (cornerCutoutMargins != null) {
            lp.leftMargin = Math.max(lp.leftMargin, cornerCutoutMargins.first);
            lp.rightMargin = Math.max(lp.rightMargin, cornerCutoutMargins.second);

            // If we're already inset enough (e.g. on the status bar side), we can have 0 margin
            WindowInsets insets = getRootWindowInsets();
            int leftInset = insets.getSystemWindowInsetLeft();
            int rightInset = insets.getSystemWindowInsetRight();
            if (lp.leftMargin <= leftInset) {
                lp.leftMargin = 0;
            }
            if (lp.rightMargin <= rightInset) {
                lp.rightMargin = 0;
            }

        }
    }