ionic-team / capacitor-assets

Local Capacitor icon/splash screen resource generation tool
MIT License
503 stars 99 forks source link

Support for themed app icons (Android 13+) #428

Open linuslabo opened 1 year ago

linuslabo commented 1 year ago

It would be great to have support for Android 13+ themed Icons, as promoted here and with more details here

It should be sufficient to add a monochromatic version of the icon and generate the corresponding drawable:

<?xml version="1.0" encoding="utf-8"?>
...
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background" />
    <foreground android:drawable="@drawable/ic_launcher_foreground" />

    // Starting with Android 13 (API level 33), you can opt-in to providing a
    // <monochrome> drawable.
    <monochrome android:drawable="@drawable/ic_launcher_monochrome" />
</adaptive-icon>
...
SoCuul commented 1 year ago

Is there a possibility of this being implemented?

orjandh commented 8 months ago

This should be simple if we can provide a icon-monochrome.png and it just applies the same resizing logic and outputs the icons as ic_launcher_monochrome.png and adds it to ic_launcher.xml.

borgoat commented 8 months ago

I've been looking into this, and trying to implement something, but I'd like to share my initial findings because I'm not quite sure what the best approach could be. I found a few different strategies:

It'd be great to hear from the Ionic team! Then I'm happy to implement this

reslear commented 2 months ago

image there's no way to make it happen now, is there?