You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "kalwinskidawid (via GitHub)" <gi...@apache.org> on 2023/09/29 13:41:24 UTC
[GitHub] [cordova] kalwinskidawid added a comment to the discussion: Cordova-android how to correctly declare an adaptive icon
GitHub user kalwinskidawid added a comment to the discussion: Cordova-android how to correctly declare an adaptive icon
After several hours of testing different ways and dozens of compilations I managed to define all the icons correctly (`WOOOOOOHO!`), if anyone would be interested I attach below how it should look like: .
So in config for android platform I did:
```xml
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round"/>
</edit-config>
<!-- colors include <resources><color name ="ic_launcher_background">#FFFFFF</color></resources> -->
<resource-file src="res/android/colors.xml" target="/app/src/main/res/values/colors.xml" />
<!-- import drawable -->
<resource-file src="res/android/drawable/ic_launcher_foreground.xml" target="app/src/main/res/drawable/ic_launcher_foreground.xml" />
<!-- import anydpi -->
<resource-file src="res/android/mipmap/anydpi-v26/ic_launcher.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml" />
<!-- import rounded icons -->
<resource-file src="res/android/mipmap/anydpi-v26/ic_launcher_round.xml" target="app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml" />
<resource-file src="res/android/mipmap/hdpi/ic_launcher_round.webp" target="app/src/main/res/mipmap-hdpi/ic_launcher_round.webp" />
<resource-file src="res/android/mipmap/mdpi/ic_launcher_round.webp" target="app/src/main/res/mipmap-mdpi/ic_launcher_round.webp" />
<resource-file src="res/android/mipmap/xhdpi/ic_launcher_round.webp" target="app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp" />
<resource-file src="res/android/mipmap/xxhdpi/ic_launcher_round.webp" target="app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp" />
<resource-file src="res/android/mipmap/xxxhdpi/ic_launcher_round.webp" target="app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp" />
<!-- create icons -->
<icon monochrome="res/android/drawable/ic_launcher_foreground.xml" background="@color/ic_launcher_background" density="mdpi"
foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap/mdpi/ic_launcher.webp"/>
<icon monochrome="res/android/drawable/ic_launcher_foreground.xml" background="@color/ic_launcher_background" density="hdpi"
foreground="res/android/drawable/ic_launcher_foreground.xml" src="res/android/mipmap/hdpi/ic_launcher.webp"/>
<icon monochrome="res/android/drawable/ic_launcher_foreground.xml" background="@color/ic_launcher_background" density="xhdpi"
foreground="res/android/drawable/ic_launcher_foreground.xml" src ="res/android/mipmap/xhdpi/ic_launcher.webp" />
<icon monochrome="res/android/drawable/ic_launcher_foreground.xml" background="@color/ic_launcher_background" density="xxhdpi"
foreground="res/android/drawable/ic_launcher_foreground.xml" src ="res/android/mipmap/xxhdpi/ic_launcher.webp" />
<icon monochrome="res/android/drawable/ic_launcher_foreground.xml" background="@color/ic_launcher_background" density="xxxhdpi"
foreground="res/android/drawable/ic_launcher_foreground.xml" src ="res/android/mipmap/xxxhdpi/ic_launcher.webp" />
```
GitHub link: https://github.com/apache/cordova/discussions/435#discussioncomment-7144712
----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscribe@cordova.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org