diff options
author | 2022-12-19 10:35:34 +0000 | |
---|---|---|
committer | 2022-12-19 10:35:34 +0000 | |
commit | 7908948853f6eba407e2c7ebf0683b79c944af78 (patch) | |
tree | 237104a9ca7db9c4233c590a5575f3178ec70487 | |
parent | b379d5c37db6db50f4c04cfce08bfe21eb981203 (diff) | |
parent | c6b2ffe2c8f2706ba2bef64531a438dcb4750949 (diff) |
Merge "Make aodIconTint default to white." into tm-qpr-dev
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/Utils.java | 10 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/Utils.java b/packages/SettingsLib/src/com/android/settingslib/Utils.java index a822e185479a..5611976ce180 100644 --- a/packages/SettingsLib/src/com/android/settingslib/Utils.java +++ b/packages/SettingsLib/src/com/android/settingslib/Utils.java @@ -308,8 +308,16 @@ public class Utils { @ColorInt public static int getColorAttrDefaultColor(Context context, int attr) { + return getColorAttrDefaultColor(context, attr, 0); + } + + /** + * Get color styled attribute {@code attr}, default to {@code defValue} if not found. + */ + @ColorInt + public static int getColorAttrDefaultColor(Context context, int attr, @ColorInt int defValue) { TypedArray ta = context.obtainStyledAttributes(new int[]{attr}); - @ColorInt int colorAccent = ta.getColor(0, 0); + @ColorInt int colorAccent = ta.getColor(0, defValue); ta.recycle(); return colorAccent; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java index e70c81de81af..85590fc0b64f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java @@ -11,6 +11,7 @@ import android.view.LayoutInflater; import android.view.View; import android.widget.FrameLayout; +import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import androidx.collection.ArrayMap; @@ -62,6 +63,8 @@ public class NotificationIconAreaController implements public static final String HIGH_PRIORITY = "high_priority"; private static final long AOD_ICONS_APPEAR_DURATION = 200; + @ColorInt + private static final int DEFAULT_AOD_ICON_COLOR = 0xffffffff; private final ContrastColorUtil mContrastColorUtil; private final Runnable mUpdateStatusBarIcons = this::updateStatusBarIcons; @@ -84,7 +87,7 @@ public class NotificationIconAreaController implements private NotificationIconContainer mShelfIcons; private NotificationIconContainer mAodIcons; private final ArrayList<Rect> mTintAreas = new ArrayList<>(); - private Context mContext; + private final Context mContext; private final DemoModeController mDemoModeController; @@ -567,7 +570,7 @@ public class NotificationIconAreaController implements private void reloadAodColor() { mAodIconTint = Utils.getColorAttrDefaultColor(mContext, - R.attr.wallpaperTextColor); + R.attr.wallpaperTextColor, DEFAULT_AOD_ICON_COLOR); } private void updateAodIconColors() { |