Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notification icons, fully white on some devices, multicolored on others. Why?

My question is not about how to create white icons.

I'm just trying to understand WHEN, exactly, the automatic white filter kicks in.

I've read notification icons, from Lollipop onwards, automatically become white 'silhouettes', so even if you use a multicolored image with setSmallIcon, any non-transparent part of it will turn fully white when displayed in the status bar.

And that's precisely what it actually does on every nexus/pixel emulator I start from android studio. Any android version, among 5, 6, 7, 8, does this.

But I actually didn't find out about this lollipop feature until recently, because all this time, and even now, by loading the exact same app on real devices, I always see the original multicolor image in the status bar. This happens on a samsung s5neo, on a huawei p8lite, and many others.

I asked my users, and apparently some see them white, some see them colored. Some with Oreo see them white, some with Oreo see them colored. It seems it also depends on which specific icons I use, because some users report they see, on the very same device, some of them white and some of them colored.

I use with setSmallIcon either my ic_launcher, so applying it from the resources, or Icon objects created from some Drawables I get from external sources. And I use pixeled sprites of characters as icons, so when I say colored I don't mean a 'green thing', I mean a really colorful image.

My app has sdk target 27, it also uses some oreo functionalities.

So, what's going on? I read everywhere that it should do the silhouettes on ANY >=lollipop device, but that's obviously not all there is to know about it, and I want to understand better. How can, for example, my oreo users, see multicolored images, set with setSmallIcon, if I have sdk target 27? Can someone explain? Thanks!

like image 493
Luke B. Avatar asked Oct 18 '22 02:10

Luke B.


1 Answers

Create your notification icon using white pixels plus the alpha channel, as documented, and you will get consistent results.

Some device manufacturers tinker with Android. For some, apparently, that tinkering includes supporting non-standard notification icons. You have no good way, ahead of time, of knowing exactly which devices (out of 10,000+ models) will have this behavior.

If a device manufacturer hires you to build an app, or wishes to license an app from you, you might inquire about their notification icon policy and make adjustments to take advantage of whatever they offer.

like image 183
CommonsWare Avatar answered Oct 27 '22 19:10

CommonsWare