diff --git a/packages/SettingsLib/src/com/android/settingslib/Utils.java b/packages/SettingsLib/src/com/android/settingslib/Utils.java index 56a242aea6a1b..c756fdb9909ee 100644 --- a/packages/SettingsLib/src/com/android/settingslib/Utils.java +++ b/packages/SettingsLib/src/com/android/settingslib/Utils.java @@ -204,16 +204,16 @@ public class Utils { @ColorInt public static int getColorAccent(Context context) { - return getColorAttr(context, android.R.attr.colorAccent); + return getColorAttrDefaultColor(context, android.R.attr.colorAccent); } @ColorInt public static int getColorError(Context context) { - return getColorAttr(context, android.R.attr.colorError); + return getColorAttrDefaultColor(context, android.R.attr.colorError); } @ColorInt - public static int getDefaultColor(Context context, int resId) { + public static int getColorStateListDefaultColor(Context context, int resId) { final ColorStateList list = context.getResources().getColorStateList(resId, context.getTheme()); @@ -241,13 +241,24 @@ public class Utils { } @ColorInt - public static int getColorAttr(Context context, int attr) { + public static int getColorAttrDefaultColor(Context context, int attr) { TypedArray ta = context.obtainStyledAttributes(new int[]{attr}); @ColorInt int colorAccent = ta.getColor(0, 0); ta.recycle(); return colorAccent; } + public static ColorStateList getColorAttr(Context context, int attr) { + TypedArray ta = context.obtainStyledAttributes(new int[]{attr}); + ColorStateList stateList = null; + try { + stateList = ta.getColorStateList(0); + } finally { + ta.recycle(); + } + return stateList; + } + public static int getThemeAttr(Context context, int attr) { TypedArray ta = context.obtainStyledAttributes(new int[]{attr}); int theme = ta.getResourceId(0, 0); diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java b/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java index e2f279a92796c..ec524c34383a1 100644 --- a/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java +++ b/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java @@ -103,7 +103,8 @@ public class BatteryMeterDrawableBase extends Drawable { for (int i = 0; i < N; i++) { mColors[2 * i] = levels.getInt(i, 0); if (colors.getType(i) == TypedValue.TYPE_ATTRIBUTE) { - mColors[2 * i + 1] = Utils.getColorAttr(context, colors.getThemeAttributeId(i, 0)); + mColors[2 * i + 1] = Utils.getColorAttrDefaultColor(context, + colors.getThemeAttributeId(i, 0)); } else { mColors[2 * i + 1] = colors.getColor(i, 0); } @@ -145,14 +146,16 @@ public class BatteryMeterDrawableBase extends Drawable { mWarningTextPaint.setColor(mColors[1]); } - mChargeColor = Utils.getDefaultColor(mContext, R.color.meter_consumed_color); + mChargeColor = Utils.getColorStateListDefaultColor(mContext, R.color.meter_consumed_color); mBoltPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - mBoltPaint.setColor(Utils.getDefaultColor(mContext, R.color.batterymeter_bolt_color)); + mBoltPaint.setColor(Utils.getColorStateListDefaultColor(mContext, + R.color.batterymeter_bolt_color)); mBoltPoints = loadPoints(res, R.array.batterymeter_bolt_points); mPlusPaint = new Paint(Paint.ANTI_ALIAS_FLAG); - mPlusPaint.setColor(Utils.getDefaultColor(mContext, R.color.batterymeter_plus_color)); + mPlusPaint.setColor(Utils.getColorStateListDefaultColor(mContext, + R.color.batterymeter_plus_color)); mPlusPoints = loadPoints(res, R.array.batterymeter_plus_points); mIntrinsicWidth = context.getResources().getDimensionPixelSize(R.dimen.battery_width); diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/BluetoothDeviceLayerDrawable.java b/packages/SettingsLib/src/com/android/settingslib/graph/BluetoothDeviceLayerDrawable.java index 3c5ac8dff0afd..11c9f7f37bde4 100644 --- a/packages/SettingsLib/src/com/android/settingslib/graph/BluetoothDeviceLayerDrawable.java +++ b/packages/SettingsLib/src/com/android/settingslib/graph/BluetoothDeviceLayerDrawable.java @@ -117,7 +117,8 @@ public class BluetoothDeviceLayerDrawable extends LayerDrawable { R.fraction.bt_battery_button_height_fraction, 1, 1); mAspectRatio = resources.getFraction(R.fraction.bt_battery_ratio_fraction, 1, 1); - final int tintColor = Utils.getColorAttr(context, android.R.attr.colorControlNormal); + final int tintColor = Utils.getColorAttrDefaultColor(context, + android.R.attr.colorControlNormal); setColorFilter(new PorterDuffColorFilter(tintColor, PorterDuff.Mode.SRC_IN)); setBatteryLevel(batteryLevel); mFrameColor = frameColor; diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/SignalDrawable.java b/packages/SettingsLib/src/com/android/settingslib/graph/SignalDrawable.java index 846e30d500635..a6b57550c358c 100644 --- a/packages/SettingsLib/src/com/android/settingslib/graph/SignalDrawable.java +++ b/packages/SettingsLib/src/com/android/settingslib/graph/SignalDrawable.java @@ -132,13 +132,17 @@ public class SignalDrawable extends Drawable { public SignalDrawable(Context context) { mDarkModeBackgroundColor = - Utils.getDefaultColor(context, R.color.dark_mode_icon_color_dual_tone_background); + Utils.getColorStateListDefaultColor(context, + R.color.dark_mode_icon_color_dual_tone_background); mDarkModeFillColor = - Utils.getDefaultColor(context, R.color.dark_mode_icon_color_dual_tone_fill); + Utils.getColorStateListDefaultColor(context, + R.color.dark_mode_icon_color_dual_tone_fill); mLightModeBackgroundColor = - Utils.getDefaultColor(context, R.color.light_mode_icon_color_dual_tone_background); + Utils.getColorStateListDefaultColor(context, + R.color.light_mode_icon_color_dual_tone_background); mLightModeFillColor = - Utils.getDefaultColor(context, R.color.light_mode_icon_color_dual_tone_fill); + Utils.getColorStateListDefaultColor(context, + R.color.light_mode_icon_color_dual_tone_fill); mIntrinsicSize = context.getResources().getDimensionPixelSize(R.dimen.signal_icon_size); mHandler = new Handler(); diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java index 26f3683f92b4b..f1729479e7312 100644 --- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java +++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPointPreference.java @@ -183,7 +183,7 @@ public class AccessPointPreference extends Preference { Drawable drawable = mIconInjector.getIcon(level); if (!mForSavedNetworks && drawable != null) { - drawable.setTint(Utils.getColorAttr(context, android.R.attr.colorControlNormal)); + drawable.setTintList(Utils.getColorAttr(context, android.R.attr.colorControlNormal)); setIcon(drawable); } else { safeSetDefaultIcon(); diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java index 9a26b35c09398..5a6ff412b7546 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSliceView.java @@ -102,7 +102,7 @@ public class KeyguardSliceView extends LinearLayout implements View.OnClickListe super.onFinishInflate(); mTitle = findViewById(R.id.title); mRow = findViewById(R.id.row); - mTextColor = Utils.getColorAttr(mContext, R.attr.wallpaperTextColor); + mTextColor = Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor); mIconSize = (int) mContext.getResources().getDimension(R.dimen.widget_icon_size); } diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java index 0683514f6f2a4..84bb7fed19ead 100644 --- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java @@ -164,8 +164,8 @@ public class BatteryMeterView extends LinearLayout implements if (mUseWallpaperTextColors) { updateColors( - Utils.getColorAttr(mContext, R.attr.wallpaperTextColor), - Utils.getColorAttr(mContext, R.attr.wallpaperTextColorSecondary)); + Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor), + Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColorSecondary)); } else { updateColors(mNonAdaptedForegroundColor, mNonAdaptedBackgroundColor); } @@ -180,10 +180,13 @@ public class BatteryMeterView extends LinearLayout implements Utils.getThemeAttr(context, R.attr.darkIconTheme)); Context dualToneLightTheme = new ContextThemeWrapper(context, Utils.getThemeAttr(context, R.attr.lightIconTheme)); - mDarkModeBackgroundColor = Utils.getColorAttr(dualToneDarkTheme, R.attr.backgroundColor); - mDarkModeFillColor = Utils.getColorAttr(dualToneDarkTheme, R.attr.fillColor); - mLightModeBackgroundColor = Utils.getColorAttr(dualToneLightTheme, R.attr.backgroundColor); - mLightModeFillColor = Utils.getColorAttr(dualToneLightTheme, R.attr.fillColor); + mDarkModeBackgroundColor = Utils.getColorAttrDefaultColor(dualToneDarkTheme, + R.attr.backgroundColor); + mDarkModeFillColor = Utils.getColorAttrDefaultColor(dualToneDarkTheme, + R.attr.fillColor); + mLightModeBackgroundColor = Utils.getColorAttrDefaultColor(dualToneLightTheme, + R.attr.backgroundColor); + mLightModeFillColor = Utils.getColorAttrDefaultColor(dualToneLightTheme, R.attr.fillColor); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/HardwareBgDrawable.java b/packages/SystemUI/src/com/android/systemui/HardwareBgDrawable.java index fb2eb4cbe36d1..97d799909ed9f 100644 --- a/packages/SystemUI/src/com/android/systemui/HardwareBgDrawable.java +++ b/packages/SystemUI/src/com/android/systemui/HardwareBgDrawable.java @@ -61,7 +61,7 @@ public class HardwareBgDrawable extends LayerDrawable { : R.drawable.rounded_bg_bottom).mutate(), }; } - layers[1].setTint(Utils.getColorAttr(context, android.R.attr.colorPrimary)); + layers[1].setTintList(Utils.getColorAttr(context, android.R.attr.colorPrimary)); return layers; } diff --git a/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingView.java b/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingView.java index 9c411d6cb1af9..ad6dfa4236bc9 100644 --- a/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingView.java +++ b/packages/SystemUI/src/com/android/systemui/charging/WirelessChargingView.java @@ -95,7 +95,7 @@ final class WirelessChargingView extends View { private void setupPaint() { mPaint = new Paint(); - mPaint.setColor(Utils.getColorAttr(mContext, R.attr.wallpaperTextColor)); + mPaint.setColor(Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor)); } public void setPaintColor(int color) { @@ -179,4 +179,4 @@ final class WirelessChargingView extends View { private float getPathGone(long now) { return (float) (now - mAnimationStartTime) / (WirelessChargingAnimation.DURATION); } -} \ No newline at end of file +} diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java index a1adfa6b28aa5..1489c21c5a5c2 100644 --- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java @@ -106,7 +106,8 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks d.setContentView(R.layout.shutdown_dialog); d.setCancelable(false); - int color = Utils.getColorAttr(mContext, com.android.systemui.R.attr.wallpaperTextColor); + int color = Utils.getColorAttrDefaultColor(mContext, + com.android.systemui.R.attr.wallpaperTextColor); boolean onKeyguard = mContext.getSystemService( KeyguardManager.class).isKeyguardLocked(); diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java index 40ce69b8e5800..2763f4c5f3246 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java @@ -242,7 +242,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { // remaining estimate is disabled if (mEstimate == null || mBucket < 0 || mEstimate.estimateMillis < mSevereWarningThreshold) { - nb.setColor(Utils.getColorAttr(mContext, android.R.attr.colorError)); + nb.setColor(Utils.getColorAttrDefaultColor(mContext, android.R.attr.colorError)); } nb.addAction(0, mContext.getString(R.string.battery_saver_start_action), @@ -337,7 +337,8 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { .setVisibility(Notification.VISIBILITY_PUBLIC) .setContentIntent(pendingBroadcast(ACTION_CLICKED_TEMP_WARNING)) .setDeleteIntent(pendingBroadcast(ACTION_DISMISSED_TEMP_WARNING)) - .setColor(Utils.getColorAttr(mContext, android.R.attr.colorError)); + .setColor(Utils.getColorAttrDefaultColor(mContext, + android.R.attr.colorError)); SystemUI.overrideNotificationAppName(mContext, nb, false); final Notification n = nb.build(); mNoMan.notifyAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, n, UserHandle.ALL); @@ -387,7 +388,8 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { .setContentIntent(pendingBroadcast(ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING)) .setDeleteIntent( pendingBroadcast(ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING)) - .setColor(Utils.getColorAttr(mContext, android.R.attr.colorError)); + .setColor(Utils.getColorAttrDefaultColor(mContext, + android.R.attr.colorError)); SystemUI.overrideNotificationAppName(mContext, nb, false); final Notification n = nb.build(); mNoMan.notifyAsUser( diff --git a/packages/SystemUI/src/com/android/systemui/qs/DataUsageGraph.java b/packages/SystemUI/src/com/android/systemui/qs/DataUsageGraph.java index 047e0d17ad189..9b5f23b813c27 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/DataUsageGraph.java +++ b/packages/SystemUI/src/com/android/systemui/qs/DataUsageGraph.java @@ -45,8 +45,10 @@ public class DataUsageGraph extends View { public DataUsageGraph(Context context, AttributeSet attrs) { super(context, attrs); final Resources res = context.getResources(); - mTrackColor = Utils.getDefaultColor(context, R.color.data_usage_graph_track); - mWarningColor = Utils.getDefaultColor(context, R.color.data_usage_graph_warning); + mTrackColor = Utils.getColorStateListDefaultColor(context, + R.color.data_usage_graph_track); + mWarningColor = Utils.getColorStateListDefaultColor(context, + R.color.data_usage_graph_warning); mUsageColor = Utils.getColorAccent(context); mOverlimitColor = Utils.getColorError(context); mMarkerWidth = res.getDimensionPixelSize(R.dimen.data_usage_graph_marker_width); diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java index 28dd26f4f00bb..3ff0fe6313428 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java @@ -96,7 +96,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, public QSFooterImpl(Context context, AttributeSet attrs) { super(context, attrs); - mColorForeground = Utils.getColorAttr(context, android.R.attr.colorForeground); + mColorForeground = Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground); } @Override @@ -354,7 +354,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter, !(picture instanceof UserIconDrawable)) { picture = picture.getConstantState().newDrawable(mContext.getResources()).mutate(); picture.setColorFilter( - Utils.getColorAttr(mContext, android.R.attr.colorForeground), + Utils.getColorAttrDefaultColor(mContext, android.R.attr.colorForeground), Mode.SRC_IN); } mMultiUserAvatar.setImageDrawable(picture); diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java index e2af90d6bbce2..655f9620a1fc4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java @@ -162,7 +162,8 @@ public class QuickStatusBarHeader extends RelativeLayout implements updateResources(); Rect tintArea = new Rect(0, 0, 0, 0); - int colorForeground = Utils.getColorAttr(getContext(), android.R.attr.colorForeground); + int colorForeground = Utils.getColorAttrDefaultColor(getContext(), + android.R.attr.colorForeground); float intensity = getColorIntensity(colorForeground); int fillColor = fillColorForIntensity(intensity, getContext()); diff --git a/packages/SystemUI/src/com/android/systemui/qs/car/CarStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/car/CarStatusBarHeader.java index 31c455d880d63..40f174f594b18 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/car/CarStatusBarHeader.java +++ b/packages/SystemUI/src/com/android/systemui/qs/car/CarStatusBarHeader.java @@ -40,7 +40,8 @@ public class CarStatusBarHeader extends LinearLayout { super.onFinishInflate(); // Set the light/dark theming on the header status UI to match the current theme. - int colorForeground = Utils.getColorAttr(getContext(), android.R.attr.colorForeground); + int colorForeground = Utils.getColorAttrDefaultColor(getContext(), + android.R.attr.colorForeground); float intensity = colorForeground == Color.WHITE ? 0f : 1f; Rect tintArea = new Rect(0, 0, 0, 0); diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java index 4aa83d0d5f159..bec4baba404b5 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java @@ -101,7 +101,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene mToolbar.getMenu().add(Menu.NONE, MENU_RESET, 0, mContext.getString(com.android.internal.R.string.reset)); mToolbar.setTitle(R.string.qs_edit); - int accentColor = Utils.getColorAttr(context, android.R.attr.colorAccent); + int accentColor = Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent); mToolbar.setTitleTextColor(accentColor); mToolbar.getNavigationIcon().setTint(accentColor); mToolbar.getOverflowIcon().setTint(accentColor); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java index cc60f8744ca7c..ebfa6afe8617c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileBaseView.java @@ -94,10 +94,10 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView { setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); setBackground(mTileBackground); - mColorActive = Utils.getColorAttr(context, android.R.attr.colorAccent); + mColorActive = Utils.getColorAttrDefaultColor(context, android.R.attr.colorAccent); mColorDisabled = Utils.getDisabled(context, - Utils.getColorAttr(context, android.R.attr.textColorTertiary)); - mColorInactive = Utils.getColorAttr(context, android.R.attr.textColorSecondary); + Utils.getColorAttrDefaultColor(context, android.R.attr.textColorTertiary)); + mColorInactive = Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondary); setPadding(0, 0, 0, 0); setClipChildren(false); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java index 834feb7781eab..6bc3bee636d0a 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java @@ -387,11 +387,11 @@ public abstract class QSTileImpl implements QSTile { switch (state) { case Tile.STATE_UNAVAILABLE: return Utils.getDisabled(context, - Utils.getColorAttr(context, android.R.attr.textColorSecondary)); + Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondary)); case Tile.STATE_INACTIVE: - return Utils.getColorAttr(context, android.R.attr.textColorSecondary); + return Utils.getColorAttrDefaultColor(context, android.R.attr.textColorSecondary); case Tile.STATE_ACTIVE: - return Utils.getColorAttr(context, android.R.attr.colorPrimary); + return Utils.getColorAttrDefaultColor(context, android.R.attr.colorPrimary); default: Log.e("QSTile", "Invalid state " + state); return 0; diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java index 7224ae6a1e15f..b52e215a17e95 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DataUsageDetailView.java @@ -91,7 +91,7 @@ public class DataUsageDetailView extends LinearLayout { formatBytes(info.usageLevel)); bottom = res.getString(R.string.quick_settings_cellular_detail_data_limit, formatBytes(info.limitLevel)); - usageColor = Utils.getDefaultColor(mContext, android.R.attr.colorError); + usageColor = Utils.getColorStateListDefaultColor(mContext, android.R.attr.colorError); } if (usageColor == 0) { diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java index e3ed1aaa5506d..0f64ea33176e5 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java +++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java @@ -198,7 +198,7 @@ public class RecentsView extends FrameLayout { } public void reevaluateStyles() { - int textColor = Utils.getColorAttr(mContext, R.attr.wallpaperTextColor); + int textColor = Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor); boolean usingDarkText = Color.luminance(textColor) < 0.5f; mEmptyView.setTextColor(textColor); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java index 5ec822dcbe084..235ff2bc93a6c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/BarTransitions.java @@ -166,7 +166,7 @@ public class BarTransitions { mSemiTransparent = context.getColor( com.android.internal.R.color.system_bar_background_semi_transparent); mTransparent = context.getColor(R.color.system_bar_background_transparent); - mWarning = Utils.getColorAttr(context, android.R.attr.colorError); + mWarning = Utils.getColorAttrDefaultColor(context, android.R.attr.colorError); } mGradient = context.getDrawable(gradientResourceId); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java index b81780962f08d..dc3a752a26949 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java @@ -437,9 +437,10 @@ public class KeyguardStatusBarView extends RelativeLayout } public void onThemeChanged() { - @ColorInt int textColor = Utils.getColorAttr(mContext, R.attr.wallpaperTextColor); - @ColorInt int iconColor = Utils.getDefaultColor(mContext, Color.luminance(textColor) < 0.5 ? - R.color.dark_mode_icon_color_single_tone : + @ColorInt int textColor = Utils.getColorAttrDefaultColor(mContext, + R.attr.wallpaperTextColor); + @ColorInt int iconColor = Utils.getColorStateListDefaultColor(mContext, + Color.luminance(textColor) < 0.5 ? R.color.dark_mode_icon_color_single_tone : R.color.light_mode_icon_color_single_tone); float intensity = textColor == Color.WHITE ? 0 : 1; mCarrierLabel.setTextColor(iconColor); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index d79f308eee4c4..74ad9c88d0754 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -750,8 +750,8 @@ public class NavigationBarView extends FrameLayout implements PluginListener