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

Commit 0e39fac3 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the scrim drawing in seascape

The scrim was drawing offset in seascape leading to artifacts.

Test: add notifications, observe seascape drawing, no artifacts
Bug: 32437839
Change-Id: I63d9f680a62212873a01fb947193f7cece19d81c
parent 932005db
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ public class ScrimView extends View
    private float mViewAlpha = 1.0f;
    private ValueAnimator mAlphaAnimator;
    private Rect mExcludedRect = new Rect();
    private int mLeftInset = 0;
    private boolean mHasExcludedArea;
    private ValueAnimator.AnimatorUpdateListener mAlphaUpdateListener
            = new ValueAnimator.AnimatorUpdateListener() {
@@ -88,12 +87,12 @@ public class ScrimView extends View
                if (mExcludedRect.top > 0) {
                    canvas.drawRect(0, 0, getWidth(), mExcludedRect.top, mPaint);
                }
                if (mExcludedRect.left + mLeftInset > 0) {
                    canvas.drawRect(0,  mExcludedRect.top, mExcludedRect.left + mLeftInset,
                            mExcludedRect.bottom, mPaint);
                if (mExcludedRect.left > 0) {
                    canvas.drawRect(0,  mExcludedRect.top, mExcludedRect.left, mExcludedRect.bottom,
                            mPaint);
                }
                if (mExcludedRect.right + mLeftInset < getWidth()) {
                    canvas.drawRect(mExcludedRect.right + mLeftInset,
                if (mExcludedRect.right < getWidth()) {
                    canvas.drawRect(mExcludedRect.right,
                            mExcludedRect.top,
                            getWidth(),
                            mExcludedRect.bottom,
@@ -184,14 +183,4 @@ public class ScrimView extends View
    public void setChangeRunnable(Runnable changeRunnable) {
        mChangeRunnable = changeRunnable;
    }

    public void setLeftInset(int leftInset) {
        if (mLeftInset != leftInset) {
            mLeftInset = leftInset;

            if (mHasExcludedArea) {
                invalidate();
            }
        }
    }
}
+0 −4
Original line number Diff line number Diff line
@@ -556,10 +556,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        mScrimBehind.setExcludedArea(area);
    }

    public void setLeftInset(int inset) {
        mScrimBehind.setLeftInset(inset);
    }

    public int getScrimBehindColor() {
        return mScrimBehind.getScrimColorWithAlpha();
    }
+0 −1
Original line number Diff line number Diff line
@@ -130,7 +130,6 @@ public class StatusBarWindowView extends FrameLayout {
    }

    private void applyMargins() {
        mService.mScrimController.setLeftInset(mLeftInset);
        final int N = getChildCount();
        for (int i = 0; i < N; i++) {
            View child = getChildAt(i);