Using theme color as primary icon color am: ab267964d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/libs/systemui/+/14682104
Change-Id: I55f58a7914861fc390f697a1b39dcc1b732da84a
diff --git a/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java b/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java
index ad9267a..41de147 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/ClockDrawableWrapper.java
@@ -297,9 +297,9 @@
if (themeData != null) {
ClockDrawableWrapper wrapper = fromThemeData(context, themeData);
if (wrapper != null) {
- ColorFilter bgFilter = new PorterDuffColorFilter(
- getColors(context)[0], Mode.SRC_ATOP);
- ClockBitmapInfo bitmapInfo = new ClockBitmapInfo(icon, color, scale,
+ int[] colors = getColors(context);
+ ColorFilter bgFilter = new PorterDuffColorFilter(colors[0], Mode.SRC_ATOP);
+ ClockBitmapInfo bitmapInfo = new ClockBitmapInfo(icon, colors[1], scale,
wrapper.mAnimationInfo, mFlattenedBackground, themeData) {
@Override
diff --git a/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java b/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java
index cf510a1..72864c8 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/FastBitmapDrawable.java
@@ -113,6 +113,13 @@
canvas.drawBitmap(mBitmap, null, bounds, mPaint);
}
+ /**
+ * Returns the primary icon color
+ */
+ public int getIconColor() {
+ return mIconColor;
+ }
+
@Override
public void setColorFilter(ColorFilter cf) {
mColorFilter = cf;
diff --git a/iconloaderlib/src/com/android/launcher3/icons/ThemedIconDrawable.java b/iconloaderlib/src/com/android/launcher3/icons/ThemedIconDrawable.java
index da62712..b4d72d4 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/ThemedIconDrawable.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/ThemedIconDrawable.java
@@ -67,7 +67,7 @@
private final Rect mBadgeBounds;
protected ThemedIconDrawable(ThemedConstantState constantState) {
- super(constantState.mBitmap, constantState.mIconColor, constantState.mIsDisabled);
+ super(constantState.mBitmap, constantState.colorFg, constantState.mIsDisabled);
bitmapInfo = constantState.bitmapInfo;
colorBg = constantState.colorBg;
colorFg = constantState.colorFg;