Add support for color extracted notification dots

Changing the badge_color in colors.xml to transparent
will cause them to be color extracted.

When an extracted color is used in the IconPalette, we
desaturate the background. Otherwise we respect the
exact color specified in colors.xml.

Change-Id: Ie82d0c5335fa5f24d4cc47766e4c1719c4916f8b
This commit is contained in:
Tony Wickham
2017-06-07 14:32:23 -07:00
parent 85b64c7da0
commit 7092db0241
7 changed files with 66 additions and 26 deletions

View File

@@ -124,7 +124,7 @@ public class FastBitmapDrawable extends Drawable {
public IconPalette getIconPalette() {
if (mIconPalette == null) {
mIconPalette = IconPalette.fromDominantColor(Utilities
.findDominantColorByHue(mBitmap, 20));
.findDominantColorByHue(mBitmap, 20), true /* desaturateBackground */);
}
return mIconPalette;
}