Loading packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +10 −4 Original line number Diff line number Diff line Loading @@ -499,12 +499,18 @@ public class StatusBarIconView extends AnimatedImageView { } private void setColorInternal(int color) { if (color != NO_COLOR) { setImageTintList(ColorStateList.valueOf(color)); mCurrentSetColor = color; updateIconColor(); } private void updateIconColor() { if (mCurrentSetColor != NO_COLOR) { setImageTintList(ColorStateList.valueOf(NotificationUtils.interpolateColors( mCurrentSetColor, Color.WHITE, mDarkAmount))); } else { setImageTintList(null); mDozer.updateGrayscale(this, mDarkAmount); } mCurrentSetColor = color; } public void setIconColor(int iconColor, boolean animate) { Loading Loading @@ -669,10 +675,10 @@ public class StatusBarIconView extends AnimatedImageView { } public void setDark(boolean dark, boolean fade, long delay) { mDozer.setImageDark(this, dark, fade, delay, mIconColor == NO_COLOR); mDozer.setIntensityDark(f -> { mDarkAmount = f; updateDecorColor(); updateIconColor(); }, dark, fade, delay); } Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationDozeHelper.java +7 −4 Original line number Diff line number Diff line Loading @@ -35,8 +35,7 @@ public class NotificationDozeHelper { startIntensityAnimation(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { updateGrayscaleMatrix((float) animation.getAnimatedValue()); target.setColorFilter(new ColorMatrixColorFilter(mGrayscaleColorMatrix)); updateGrayscale(target, (float) animation.getAnimatedValue()); } }, dark, delay, new AnimatorListenerAdapter() { @Override Loading @@ -49,8 +48,12 @@ public class NotificationDozeHelper { } public void updateGrayscale(ImageView target, boolean dark) { if (dark) { updateGrayscaleMatrix(1f); updateGrayscale(target, dark ? 1 : 0); } public void updateGrayscale(ImageView target, float darkAmount) { if (darkAmount > 0) { updateGrayscaleMatrix(darkAmount); target.setColorFilter(new ColorMatrixColorFilter(mGrayscaleColorMatrix)); } else { target.setColorFilter(null); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +10 −4 Original line number Diff line number Diff line Loading @@ -499,12 +499,18 @@ public class StatusBarIconView extends AnimatedImageView { } private void setColorInternal(int color) { if (color != NO_COLOR) { setImageTintList(ColorStateList.valueOf(color)); mCurrentSetColor = color; updateIconColor(); } private void updateIconColor() { if (mCurrentSetColor != NO_COLOR) { setImageTintList(ColorStateList.valueOf(NotificationUtils.interpolateColors( mCurrentSetColor, Color.WHITE, mDarkAmount))); } else { setImageTintList(null); mDozer.updateGrayscale(this, mDarkAmount); } mCurrentSetColor = color; } public void setIconColor(int iconColor, boolean animate) { Loading Loading @@ -669,10 +675,10 @@ public class StatusBarIconView extends AnimatedImageView { } public void setDark(boolean dark, boolean fade, long delay) { mDozer.setImageDark(this, dark, fade, delay, mIconColor == NO_COLOR); mDozer.setIntensityDark(f -> { mDarkAmount = f; updateDecorColor(); updateIconColor(); }, dark, fade, delay); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationDozeHelper.java +7 −4 Original line number Diff line number Diff line Loading @@ -35,8 +35,7 @@ public class NotificationDozeHelper { startIntensityAnimation(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { updateGrayscaleMatrix((float) animation.getAnimatedValue()); target.setColorFilter(new ColorMatrixColorFilter(mGrayscaleColorMatrix)); updateGrayscale(target, (float) animation.getAnimatedValue()); } }, dark, delay, new AnimatorListenerAdapter() { @Override Loading @@ -49,8 +48,12 @@ public class NotificationDozeHelper { } public void updateGrayscale(ImageView target, boolean dark) { if (dark) { updateGrayscaleMatrix(1f); updateGrayscale(target, dark ? 1 : 0); } public void updateGrayscale(ImageView target, float darkAmount) { if (darkAmount > 0) { updateGrayscaleMatrix(darkAmount); target.setColorFilter(new ColorMatrixColorFilter(mGrayscaleColorMatrix)); } else { target.setColorFilter(null); Loading