NegeroKiddero
NegeroKiddero

Reputation: 41

Vector asset displayed as white, even though it's red

I've created drawable called ic_live. This vector is used for a notification.

This is the code for the drawable:

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

    <path
    android:fillColor="#FE3A39"
    android:pathData="M12,12m-10,0a10,10 0,1 1,20 0a10,10 0,1 1,-20 0"/>
</vector>

As you can see, tint is set to red, as well as the fillColor, yet, in the notification, the image is white.

Notification:

Notification notification = new NotificationCompat.Builder(this, App.CHANNEL_1_ID)
                    .setSmallIcon(R.drawable.ic_live)
                    .setContentTitle("LIVE")
                    .setPriority(NotificationCompat.PRIORITY_HIGH)
                    .setCategory(NotificationCompat.CATEGORY_MESSAGE)
                    .build();

            notificationManager.notify(1, notification);

Upvotes: 0

Views: 65

Answers (1)

Related Questions