Merge "Update the color of the custom shape options" into ub-launcher3-qt-r1-dev
diff --git a/res/color/option_border_color.xml b/res/color/option_border_color.xml
index ea5f189..ec5ab97 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 129d364..b567d0d 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 42335bf..3d646f9 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 1c0f76d..ff8da08 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.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.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 @@
 
             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);