Yanndroid / DualWallpaper

Customize your device even more by having two separate sets of wallpapers for light and dark mode.
https://play.google.com/store/apps/details?id=de.dlyt.yanndroid.dualwallpaper
MIT License
105 stars 4 forks source link

Day and night icons for icon packs #14

Closed BaruaAtish closed 4 months ago

BaruaAtish commented 11 months ago

Hello there, I have been working on creating icons for DualWallpaper on the Articons Icon Pack. One the issues I have run into though is that I do not know how DualWallpaper switch icons with system theme. Currently, when using the IconRequest app what I get back is this for both light and dark mode:

de.dlyt.yanndroid.dualwallpaper
de.dlyt.yanndroid.dualwallpaper.ui.activity.MainActivity

Because they are the same in both light and dark mode, the icon pack is not able to differenciate between the two thus making switching icons impossible. Any insight would be appreciated, thank you.

Yanndroid commented 11 months ago

Hi there,

The icon is actually pretty complicated in this app and personally I haven't seen any other app do this. This is how it works:

There's only one icon; ic_launcher.xml, which contains a background color, foreground icon and monochrome icon.

The background color ( @color/ic_launcher_background ) is present in values/colors.xml and values-night/colors.xml which are blue and dark blue for light and dark mode respectively. For API versions 31+, there also is values-v31/colors.xml and values-night-v31/colors.xml which overrides the color and uses the device's color theme instead.

The foreground ( @drawable/ic_launcher_foreground ) is kinda similar. It has two drawables, drawable/ic_launcher_foreground.xml and drawable-night/ic_launcher_foreground.xml which then show either a sun or a moon as foreground in light and dark mode.

The monochrome works just like the foreground and is applied instead, if monochrome icons are enabled on the device.

Additionally, for Samsung devices the AndroidManifest contains some meta-data tags for a slightly different theming of the icon.

Ngl, I'm pretty proud of this :sweat_smile:

If with this configuration there is no way for your app to differentiate between light and dark mode you can simply use the one with the sun. The other variations are only a neat little feature since the app changes wallpapers.