summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-11-01 15:52:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-11-01 15:52:08 +0000
commit85a2bb56f9f033fcdf418f1b4513443bbb41358b (patch)
tree3e512a55074b9f48b73d1c4cf59f2142409fcd73
parent90170a10cc714b5bf73691df50a6f04ab3c79fd6 (diff)
parent21334a02a69482d3bcc13f17c40c76f733e52cd8 (diff)
downloadandroid_packages_apps_ThemePicker-85a2bb56f9f033fcdf418f1b4513443bbb41358b.tar.gz
android_packages_apps_ThemePicker-85a2bb56f9f033fcdf418f1b4513443bbb41358b.tar.bz2
android_packages_apps_ThemePicker-85a2bb56f9f033fcdf418f1b4513443bbb41358b.zip
Merge "Explicitly tint the color preview icons" into ub-launcher3-qt-future-dev
-rw-r--r--src/com/android/customization/model/theme/custom/ColorOptionsProvider.java2
-rw-r--r--src/com/android/customization/model/theme/custom/ThemeComponentOption.java3
-rw-r--r--src/com/android/customization/picker/theme/ThemeFragment.java3
3 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java b/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java
index a37f250..f3b950b 100644
--- a/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java
+++ b/src/com/android/customization/model/theme/custom/ColorOptionsProvider.java
@@ -24,8 +24,6 @@ import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_ICON_ANDROID;
import static com.android.customization.model.ResourceConstants.OVERLAY_CATEGORY_SHAPE;
import static com.android.customization.model.ResourceConstants.PATH_SIZE;
-import static com.android.customization.model.ResourceConstants.SYSUI_PACKAGE;
-import static com.android.customization.model.theme.custom.ThemeComponentOption.ColorOption.COLOR_TILES_ICON_IDS;
import android.content.Context;
import android.content.pm.PackageManager;
diff --git a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
index f918d8e..6583433 100644
--- a/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
+++ b/src/com/android/customization/model/theme/custom/ThemeComponentOption.java
@@ -379,10 +379,13 @@ public abstract class ThemeComponentOption implements CustomizationOption<ThemeC
seekbar.setProgressBackgroundTintList(seekbarTintList);
// Disable seekbar
seekbar.setOnTouchListener((view, motionEvent) -> true);
+
+ int iconFgColor = res.getColor(R.color.tile_enabled_icon_color, null);
if (!mIcons.isEmpty() && mShapeDrawable != null) {
for (int i = 0; i < COLOR_TILE_IDS.length; i++) {
Drawable icon = mIcons.get(COLOR_TILES_ICON_IDS[i][1]).getConstantState()
.newDrawable();
+ icon.setTint(iconFgColor);
//TODO: load and set the shape.
Drawable bgShape = mShapeDrawable.getConstantState().newDrawable();
bgShape.setTint(accentColor);
diff --git a/src/com/android/customization/picker/theme/ThemeFragment.java b/src/com/android/customization/picker/theme/ThemeFragment.java
index e4682bb..641d3e1 100644
--- a/src/com/android/customization/picker/theme/ThemeFragment.java
+++ b/src/com/android/customization/picker/theme/ThemeFragment.java
@@ -23,7 +23,6 @@ import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
-import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
@@ -455,10 +454,12 @@ public class ThemeFragment extends ToolbarFragment {
// Disable seekbar
seekbar.setOnTouchListener((view, motionEvent) -> true);
+ int iconFgColor = res.getColor(R.color.tile_enabled_icon_color, null);
for (int i = 0; i < mColorTileIds.length && i < previewInfo.icons.size();
i++) {
Drawable icon = previewInfo.icons.get(mColorTileIconIds[i][1])
.getConstantState().newDrawable().mutate();
+ icon.setTint(iconFgColor);
Drawable bgShape =
previewInfo.shapeDrawable.getConstantState().newDrawable();
bgShape.setTint(accentColor);