MaterialFiles
MaterialFiles copied to clipboard
App icon on app directory looks weird in dark mode

Need have a dark background for app icon in dark mode.
Hmm, that may or may not be possible because the app icon itself may include a white background...
Background of the badge is from BaseIconFactory.createBadgedIconBitmap?
From your https://github.com/zhanghai/AppIconLoader project and eventually from Android systemui BaseIconFactory.createBadgedIconBitmap
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.
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.
I got your point. This is not a severe issue, totally OK for me.