Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3c7bdf0 authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Fix notification contrast with transparent bg" into oc-dev

am: 9b734011

Change-Id: Iad0f7b3ff9db9128e825b72040cc4c9123dde4c1
parents 41bf50cc 9b734011
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -601,7 +601,8 @@ public class StatusBarIconView extends AnimatedImageView {
    }

    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
+5 −0
Original line number Diff line number Diff line
@@ -116,5 +116,10 @@ public class StatusBarIconViewTest extends SysuiTestCase {
        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