Merge "Make aodIconTint default to white." into tm-qpr-dev am: 7908948853
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20748232 Change-Id: Ibbcbd820582b7f622d96afee4b0fceaf707e1fbd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -308,8 +308,16 @@ public class Utils {
|
|||||||
|
|
||||||
@ColorInt
|
@ColorInt
|
||||||
public static int getColorAttrDefaultColor(Context context, int attr) {
|
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});
|
TypedArray ta = context.obtainStyledAttributes(new int[]{attr});
|
||||||
@ColorInt int colorAccent = ta.getColor(0, 0);
|
@ColorInt int colorAccent = ta.getColor(0, defValue);
|
||||||
ta.recycle();
|
ta.recycle();
|
||||||
return colorAccent;
|
return colorAccent;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import android.view.LayoutInflater;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.ColorInt;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import androidx.collection.ArrayMap;
|
import androidx.collection.ArrayMap;
|
||||||
@@ -62,6 +63,8 @@ public class NotificationIconAreaController implements
|
|||||||
|
|
||||||
public static final String HIGH_PRIORITY = "high_priority";
|
public static final String HIGH_PRIORITY = "high_priority";
|
||||||
private static final long AOD_ICONS_APPEAR_DURATION = 200;
|
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 ContrastColorUtil mContrastColorUtil;
|
||||||
private final Runnable mUpdateStatusBarIcons = this::updateStatusBarIcons;
|
private final Runnable mUpdateStatusBarIcons = this::updateStatusBarIcons;
|
||||||
@@ -84,7 +87,7 @@ public class NotificationIconAreaController implements
|
|||||||
private NotificationIconContainer mShelfIcons;
|
private NotificationIconContainer mShelfIcons;
|
||||||
private NotificationIconContainer mAodIcons;
|
private NotificationIconContainer mAodIcons;
|
||||||
private final ArrayList<Rect> mTintAreas = new ArrayList<>();
|
private final ArrayList<Rect> mTintAreas = new ArrayList<>();
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
private final DemoModeController mDemoModeController;
|
private final DemoModeController mDemoModeController;
|
||||||
|
|
||||||
@@ -567,7 +570,7 @@ public class NotificationIconAreaController implements
|
|||||||
|
|
||||||
private void reloadAodColor() {
|
private void reloadAodColor() {
|
||||||
mAodIconTint = Utils.getColorAttrDefaultColor(mContext,
|
mAodIconTint = Utils.getColorAttrDefaultColor(mContext,
|
||||||
R.attr.wallpaperTextColor);
|
R.attr.wallpaperTextColor, DEFAULT_AOD_ICON_COLOR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateAodIconColors() {
|
private void updateAodIconColors() {
|
||||||
|
|||||||
Reference in New Issue
Block a user