cgifox
cgifox

Reputation: 659

Android - Drawable has different color in different places

I have a drawable resource that has a different shades of black in different places

enter image description here

Drawable code:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
<path
    android:fillColor="#FF000000"
    android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
</vector>

How do i change the color of the icon in the cards to be the same as the one in the navigation drawer?

Edit: It happens even when the nav drawer is closed Screenshot when the nav drawer is closed:

enter image description here

Upvotes: 1

Views: 618

Answers (2)

Shmuel
Shmuel

Reputation: 3916

It looks like you are using the Design Support Library. It may be that the library automatically tints the drawable color to be that shade of gray.

I'd reccomend getting the hex value for that gray and setting android:fillColor="#FF000000" to be that value. This way you will have the same gray color everywhere.

Upvotes: 0

That happens because in your navigation view, your menu elements contains the svg and tint it with the default colorControlActivated resource color, so you can change the svg color in your xml file, or tint it anywhere you're using it

Upvotes: 1

Related Questions