Update monochrome theme icon notification dot color am: 1d57706125

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/17228731

Change-Id: I1acc3468f695fc5c5c605daabcf39fecc339609f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Stefan Andonian
2022-03-29 16:47:04 +00:00
committed by Automerger Merge Worker
2 changed files with 3 additions and 12 deletions
@@ -55,7 +55,6 @@ import com.android.launcher3.accessibility.BaseAccessibilityDelegate;
import com.android.launcher3.dot.DotInfo;
import com.android.launcher3.dragndrop.DraggableView;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.graphics.IconPalette;
import com.android.launcher3.graphics.IconShape;
import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.icons.DotRenderer;
@@ -378,8 +377,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
flags |= FLAG_NO_BADGE;
}
FastBitmapDrawable iconDrawable = info.newIcon(getContext(), flags);
mDotParams.color = IconPalette.getMutedColor(iconDrawable.getIconColor(), 0.54f);
mDotParams.color = iconDrawable.getIconColor();
setIcon(iconDrawable);
applyLabel(info);
}
@@ -16,18 +16,16 @@
package com.android.launcher3.graphics;
import static com.android.launcher3.icons.GraphicsUtils.setColorAlphaBound;
import android.app.Notification;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import androidx.core.graphics.ColorUtils;
import com.android.launcher3.R;
import com.android.launcher3.util.Themes;
import androidx.core.graphics.ColorUtils;
/**
* Contains colors based on the dominant color of an icon.
*/
@@ -147,9 +145,4 @@ public class IconPalette {
}
return ColorUtils.LABToColor(low, a, b);
}
public static int getMutedColor(int color, float whiteScrimAlpha) {
int whiteScrim = setColorAlphaBound(Color.WHITE, (int) (255 * whiteScrimAlpha));
return ColorUtils.compositeColors(whiteScrim, color);
}
}