The problem with stock Android"/>
Different Android devices have different themes. That means, that background colors, like in dialogs, may differ among Android versions and among manufacturers.
This may result into icons getting "invisible":
The problem with stock Android themes could be solved relatively easy, by providing different colored icons in target specific folders, eg white icons in a folder drawable-v14
, and black ones in drawable-v10
. But that does not solve the issue that comes with customized themes from manufacturers, may it be TouchWiz, Blur or Sense. It is simply not possible to cover every device by this method.
Another way would be, to draw a small black border around white icons, and vice versa. But if the background would be gray, like in ICS, it wouldn't look good, either.
So, the question is: How to provide custom icons, that will work well on every theme, without touching the theme itself?
Accounting for all vendor choices (and mistakes) would be a pain.
I see a couple of options:
I recently went with the hard-coded colors in a derivative theme to fix a bug in the Nook dialog color selections for a dialog. More extensive testing would probably show me another platform that I just made worse with that.
Hopefully someone has a better answer than those, because none of those seem completely clean and universal. Reading your post again, it looks like none of those options meet your criteria of not touching the theme, either.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.