[SOLVED] How to change back color to Android adaptive icons?

Hello, I am using the F7-CLI to create an android app. I figured out how to override my apps icon, however, Android’s circle/round icons leave a white border around my app icon. Is there anyway that I can fill that white color with a different color?

Thanks!

Ok, figured it out by referring to the following SO page: https://stackoverflow.com/a/55169307/1640090

First, you need to create a new file called “colors.xml” which you will need to save in “project folder\cordova\res\icon\android”

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="background">#FF0000</color>
</resources>

Then modify the file “project folder/cordova/res/config.xml” and find the tag name=“android”.

    <platform name="android">
         ...
        <resource-file src="res/icon/android/colors.xml" target="/app/src/main/res/values/colors.xml" />
        <icon density="ldpi" background="@color/background" foreground="res/icon/android/mipmap-ldpi/ic_launcher.png" />
        <icon density="mdpi" background="@color/background" foreground="res/icon/android/mipmap-mdpi/ic_launcher.png" />
        <icon density="hdpi" background="@color/background" foreground="res/icon/android/mipmap-hdpi/ic_launcher.png" />
        <icon density="xhdpi" background="@color/background" foreground="res/icon/android/mipmap-xhdpi/ic_launcher.png" />
        <icon density="xxhdpi" background="@color/background" foreground="res/icon/android/mipmap-xxhdpi/ic_launcher.png" />
        <icon density="xxxhdpi" background="@color/background" foreground="res/icon/android/mipmap-xxxhdpi/ic_launcher.png" />
    </platform>

The next time you recompile the Android app, it will use an have the adaptive icon.

1 Like