}
private void updateContrastedStaticColor() {
- if (mCachedContrastBackgroundColor == NO_COLOR) {
+ if (Color.alpha(mCachedContrastBackgroundColor) != 255) {
+ mContrastedDrawableColor = mDrawableColor;
return;
}
// We'll modify the color if it doesn't pass GAR
color = mIconView.getContrastedStaticDrawableColor(Color.WHITE);
assertTrue("Similar colors should be shifted to satisfy contrast",
NotificationColorUtil.satisfiesTextContrast(Color.WHITE, color));
+
+ mIconView.setStaticDrawableColor(Color.GREEN);
+ color = mIconView.getContrastedStaticDrawableColor(0xcc000000);
+ assertEquals("Transparent backgrounds should fallback to drawable color",
+ color, mIconView.getStaticDrawableColor());
}
}
\ No newline at end of file