summaryrefslogtreecommitdiff
path: root/src/com/android/customization/picker/theme
diff options
context:
space:
mode:
authorTianguang Zhang <tianguang@google.com>2021-04-14 00:32:20 +0200
committerTianguang Zhang <tianguang@google.com>2021-04-19 16:01:06 +0200
commit12827ffc49bae9828e3642de414deb8e24054495 (patch)
treeca0e11ea43ebf085b18b8db54b2d68ec28d51dd2 /src/com/android/customization/picker/theme
parent8192e46749ced0304954737bc3c46bc86559e621 (diff)
downloadThemePicker-12827ffc49bae9828e3642de414deb8e24054495.tar.gz
Remove hard-coded colors in Wallpaper Picker
The CLs in this topic remove the hard-coded colors from the app, replacing them with ?android:attr/, ?attr/, and sometimes @color/ that is defined using device default colors. Fixes: 173549815 Test: none added Change-Id: I4f0d18c1c4afdc5e1651e5b34fef8c7d71cdf8b7
Diffstat (limited to 'src/com/android/customization/picker/theme')
-rw-r--r--src/com/android/customization/picker/theme/CustomThemeStepFragment.java4
-rw-r--r--src/com/android/customization/picker/theme/ThemeOptionPreviewer.java12
2 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/customization/picker/theme/CustomThemeStepFragment.java b/src/com/android/customization/picker/theme/CustomThemeStepFragment.java
index 50f391df..3f07431d 100644
--- a/src/com/android/customization/picker/theme/CustomThemeStepFragment.java
+++ b/src/com/android/customization/picker/theme/CustomThemeStepFragment.java
@@ -68,10 +68,10 @@ abstract class CustomThemeStepFragment extends AppbarFragment {
} else {
setUpToolbar(view, R.menu.custom_theme_editor_menu);
mToolbar.getMenu().getItem(0).setIconTintList(
- getContext().getColorStateList(R.color.toolbar_icon_color));
+ getContext().getColorStateList(R.color.toolbar_icon_tint));
}
Drawable closeIcon = getResources().getDrawable(R.drawable.ic_close_24px, null).mutate();
- closeIcon.setTintList(getResources().getColorStateList(R.color.toolbar_icon_color, null));
+ closeIcon.setTintList(getResources().getColorStateList(R.color.toolbar_icon_tint, null));
mToolbar.setNavigationIcon(closeIcon);
mToolbar.setNavigationContentDescription(R.string.cancel);
diff --git a/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java b/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
index 5c775ddf..850edf9c 100644
--- a/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
+++ b/src/com/android/customization/picker/theme/ThemeOptionPreviewer.java
@@ -49,6 +49,7 @@ import com.android.customization.model.theme.ThemeBundle;
import com.android.customization.model.theme.ThemeBundle.PreviewInfo;
import com.android.customization.model.theme.ThemeBundle.PreviewInfo.ShapeAppIcon;
import com.android.wallpaper.R;
+import com.android.wallpaper.util.ResourceUtils;
import com.android.wallpaper.util.ScreenSizeCalculator;
import com.android.wallpaper.util.TimeUtils;
import com.android.wallpaper.util.TimeUtils.TimeTicker;
@@ -184,11 +185,11 @@ class ThemeOptionPreviewer implements LifecycleObserver {
boolean useLightTextColor = colors == null
|| (colors.getColorHints() & WallpaperColors.HINT_SUPPORTS_DARK_TEXT) == 0;
int textColor = mContext.getColor(useLightTextColor
- ? R.color.text_color_light
- : R.color.text_color_dark);
+ ? android.R.color.white
+ : android.R.color.black);
int textShadowColor = mContext.getColor(useLightTextColor
- ? R.color.smartspace_preview_shadow_color_dark
- : R.color.smartspace_preview_shadow_color_transparent);
+ ? android.R.color.tertiary_text_dark
+ : android.R.color.transparent);
// Update the top status bar clock text color.
mStatusBarClock.setTextColor(textColor);
// Update the top status bar icon color.
@@ -358,7 +359,8 @@ class ThemeOptionPreviewer implements LifecycleObserver {
}
private ColorStateList getColorStateList(int accentColor) {
- int controlGreyColor = mContext.getColor(R.color.control_grey);
+ int controlGreyColor =
+ ResourceUtils.getColorAttr(mContext, android.R.attr.textColorTertiary);
return new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_selected},