Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - VectorXML notification icon color, SAMSUNG bug?

I try to use the new VectorXML for small icon into the NotificationCompat.Builder. On Nexus devices everything works fine and Android automatically tint the icon to the required color, mostly to white. But on Samsung (S5 with Android 6.0.1) the icon is never tinted. See screenshots:

enter image description here

enter image description here

Any idea why? It is an Samsung's implementation bug?

like image 395
Tomas Avatar asked Feb 12 '26 11:02

Tomas


1 Answers

For all,

the solution is to make the base (fill) color white, then "auto" tint works fine also on Samsung devices! ;)

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24">

    <path
        android:fillColor="#FFF"
        android:pathData="M12,12m-8,0a8,8 0,1 1,16 0a8,8 0,1 1,-16 0"/>

</vector>
like image 114
Tomas Avatar answered Feb 14 '26 23:02

Tomas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!