MaterialFiles icon indicating copy to clipboard operation
MaterialFiles copied to clipboard

App icon on app directory looks weird in dark mode

Open sunjw opened this issue 3 years ago • 6 comments

Screenshot_2022-04-26-13-34-43-644_me zhanghai android files Screenshot_2022-04-26-13-34-57-243_me zhanghai android files

sunjw avatar Apr 28 '22 03:04 sunjw

Need have a dark background for app icon in dark mode.

sunjw avatar Apr 28 '22 07:04 sunjw

Hmm, that may or may not be possible because the app icon itself may include a white background...

zhanghai avatar Apr 29 '22 01:04 zhanghai

Background of the badge is from BaseIconFactory.createBadgedIconBitmap? From your https://github.com/zhanghai/AppIconLoader project and eventually from Android systemui BaseIconFactory.createBadgedIconBitmap

sunjw avatar Apr 29 '22 02:04 sunjw

I tried the simple fix of overriding @color/legacy_icon_background in app resources, and tried both a theme attr (and passing in a themed context) and a plain hex color, but neither worked. The plain color somehow doesn't affect the background at all and it remained white, whereas any theme attr or invalid value would make the icon draw nothing. So at least I don't have time to fix it before this weekend.

And actually, the icons will always be round since Android 12 because Google has removed the ability to change system-wide icon shapes (replaced by Material You themed icons).

Meanwhile, does your launcher color the icons black instead of white in this case? I was assuming nobody would do that, because many app icons may be round and include a white background themselves, so putting that onto a black sqaure background would look a lot worse than a white background.

zhanghai avatar Apr 29 '22 23:04 zhanghai

Well, just realized I needed to call BaseIconFactory.setWrapperBackgroundColor() to set the background color. However, this stil won't solve the rounded white icon on black square issue.

zhanghai avatar Apr 30 '22 00:04 zhanghai

I got your point. This is not a severe issue, totally OK for me.

sunjw avatar Apr 30 '22 03:04 sunjw