Reputation: 322
In my application I have a media notification (using the MediaStyle) and I need to have action icons with different tints. An example of what I want to achieve is the Spotify notification running on Android N:
The Previous action icon doesn't have the same color than the other actions. I know I can tint all of them with NotificationCompat.Builder.setColor() method, but how can each action icon have a different color/tint?
Upvotes: 1
Views: 801
Reputation: 322
Finally found the solution. Starting from Lollipop, Android only use the alpha from drawables and apply its own color on them. The Spotify app use a black color, and with some alpha they can have a grey icon. So by tweaking the alpha of the used drawables, it's possible to have different tints on action icons.
Upvotes: 3