Initial commit
[GitHub/Stricted/android_vendor_extra.git] / frameworks / base / 0034-doze-allow-grayscale-even-if-invert-boolean-is-false.patch
1 From 82244aeb8e03cec7e5cbbcd89fef918ea3d151d2 Mon Sep 17 00:00:00 2001
2 From: Daniel Koman <dankoman30@gmail.com>
3 Date: Wed, 28 Sep 2016 15:28:26 +0200
4 Subject: [PATCH 34/38] doze: allow grayscale even if invert boolean is false
5
6 for dark themes, we are setting the config boolean for inverting
7 doze notifications to false. in addition to preventing
8 color inversion, this was also preventing the notification
9 from grayscaling. as a result, on dark themes (boolean false), we
10 were seeing color icons on doze notifications. this commit fixes
11 the grayscaling, and brings back the very aesthetically pleasing
12 (imo) grayscale-to-color fade-in for the notifications' app icons.
13
14 Change-Id: Ifc5efbccbeb02910684b76793721b10f1d64f870
15 ---
16 packages/SystemUI/src/com/android/systemui/ViewInvertHelper.java | 6 ++++--
17 1 file changed, 4 insertions(+), 2 deletions(-)
18
19 diff --git a/packages/SystemUI/src/com/android/systemui/ViewInvertHelper.java b/packages/SystemUI/src/com/android/systemui/ViewInvertHelper.java
20 index 605f381..16d46c0 100644
21 --- a/packages/SystemUI/src/com/android/systemui/ViewInvertHelper.java
22 +++ b/packages/SystemUI/src/com/android/systemui/ViewInvertHelper.java
23 @@ -92,7 +92,7 @@ public class ViewInvertHelper {
24 }
25
26 public void update(boolean invert) {
27 - if (invert && mThemeInvert) {
28 + if (invert) {
29 updateInvertPaint(1f);
30 for (int i = 0; i < mTargets.size(); i++) {
31 mTargets.get(i).setLayerType(View.LAYER_TYPE_HARDWARE, mDarkPaint);
32 @@ -115,7 +115,9 @@ public class ViewInvertHelper {
33 mMatrix.set(invert);
34 mGrayscaleMatrix.setSaturation(1 - intensity);
35 mMatrix.preConcat(mGrayscaleMatrix);
36 - mDarkPaint.setColorFilter(new ColorMatrixColorFilter(mMatrix));
37 + mDarkPaint.setColorFilter(new ColorMatrixColorFilter(
38 + mThemeInvert ? mMatrix : mGrayscaleMatrix));
39 +
40 }
41
42 public void setInverted(boolean invert, boolean fade, long delay) {
43 --
44 2.9.3
45