diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-06-26 23:12:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-06-26 23:12:21 +0000 |
commit | 752cc8ad33df5ecc352caab8993fe422e91272e7 (patch) | |
tree | ca13400de9385423d5f8b03f7b262167fc142d50 | |
parent | 4a17c50d7b735e1ab94748684f4a7be54fe1a0ce (diff) | |
parent | 3bbf75af662fe9001eecc44673ba80a9c0c07ca1 (diff) | |
download | ThemePicker-752cc8ad33df5ecc352caab8993fe422e91272e7.tar.gz |
Merge "Update the color of the custom shape options" into ub-launcher3-qt-r1-dev
-rw-r--r-- | res/color/option_border_color.xml | 3 | ||||
-rw-r--r-- | res/values-night/colors.xml | 2 | ||||
-rw-r--r-- | res/values/colors.xml | 4 | ||||
-rw-r--r-- | src/com/android/customization/model/theme/custom/ThemeComponentOption.java | 10 |
4 files changed, 16 insertions, 3 deletions
diff --git a/res/color/option_border_color.xml b/res/color/option_border_color.xml index ea5f189e..ec5ab977 100644 --- a/res/color/option_border_color.xml +++ b/res/color/option_border_color.xml @@ -23,5 +23,6 @@ android:alpha="0.24" android:color="?android:colorAccent" /> <item - android:color="@color/material_grey500"/> + android:alpha="0.05" + android:color="@color/option_border_default"/> </selector> diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml index 129d3642..b567d0d0 100644 --- a/res/values-night/colors.xml +++ b/res/values-night/colors.xml @@ -28,6 +28,8 @@ <color name="tile_disabled_icon_color">@color/light_grey</color> <color name="tile_disabled_background_color">#353535</color> + <color name="shape_option_tile_foreground_color">@color/edit_background_base</color> + <color name="tip_dot_color">#81C995</color> <color name="tip_dot_line_color">#000000</color> diff --git a/res/values/colors.xml b/res/values/colors.xml index 42335bf0..3d646f94 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -30,6 +30,8 @@ <color name="shape_thumbnail_color">#b2b2b2</color> <color name="icon_thumbnail_color">@color/black_87_alpha</color> + <color name="option_border_default">@color/edit_background_base</color> + <color name="clockface_preview_background">@android:color/black</color> <color name="theme_preview_icon_color">@color/google_grey700</color> @@ -47,7 +49,7 @@ <color name="tile_disabled_icon_color">#2d2d2d</color> <color name="tile_disabled_background_color">@color/light_grey</color> - <color name="shape_option_tile_foreground_color">#f8f9fa</color> + <color name="shape_option_tile_foreground_color">@color/edit_background_base</color> <color name="tip_dot_color">#34A853</color> <color name="tip_dot_line_color">#FFFFFF</color> diff --git a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java index 1c0f76de..ff8da087 100644 --- a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java +++ b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java @@ -29,6 +29,7 @@ import android.content.res.ColorStateList; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources.Theme; +import android.content.res.TypedArray; import android.graphics.Path; import android.graphics.Typeface; import android.graphics.drawable.Drawable; @@ -49,6 +50,7 @@ import androidx.annotation.Dimension; import androidx.annotation.DrawableRes; import androidx.annotation.Nullable; import androidx.annotation.StringRes; +import androidx.core.graphics.ColorUtils; import com.android.customization.model.CustomizationManager; import com.android.customization.model.CustomizationOption; @@ -443,7 +445,13 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC foreground.setIntrinsicHeight(background.getIntrinsicHeight() - borderWidth); foreground.setIntrinsicWidth(background.getIntrinsicWidth() - borderWidth); - foreground.setTint(res.getColor(R.color.shape_option_tile_foreground_color, theme)); + TypedArray ta = view.getContext().obtainStyledAttributes( + new int[]{android.R.attr.colorPrimary}); + int primaryColor = ta.getColor(0, 0); + ta.recycle(); + int foregroundColor = res.getColor(R.color.shape_option_tile_foreground_color, theme); + + foreground.setTint(ColorUtils.blendARGB(primaryColor, foregroundColor, .05f)); thumb.setImageDrawable(mShape); view.setContentDescription(mLabel); |