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
This commit is contained in:
Selim Cinek
2016-12-06 11:50:55 -08:00
parent 932005db01
commit 0e39fac360
3 changed files with 5 additions and 21 deletions

View File

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

View File

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

View File

@@ -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);