How to remove icon border in Android 12

1.6k Views Asked by At

Assuming this is my app icon enter image description here

It works fine in Android 11 (and below) enter image description here

but when I install the app in Android 12, there is a white border around the icon in the splash screen (also a black border around the top app icon.) enter image description here

Is there any way I can remove those borders? below is my splash code

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    android:opacity="opaque">

    <item android:drawable="@color/colorBlack"/>

    <item>
        <bitmap
            android:src="@drawable/notice"/>
    </item>
</layer-list>

Also this line in my AndroidManifest.xml

 android:roundIcon="@drawable/notice"
1

There are 1 best solutions below

0
On

There seems a misusage in your terminology splash screen. It should be called Recents screen in the screen shots.

So this is not a problem about Splash screen. This should be a problem about a launcher icon using Adaptive icon.

By default, in template projects on Android Studio, the launcher icons in the Manifest are:

android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"

And both of mipmaps are:

<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" />
</adaptive-icon>

Lastly, both of these ic_launcher_foreground and ic_launcher_background are vector drawables. (note that you can also use @color instead of a vector drawable)

As you can notice, layer-list or bitmap is not used. You can use an Adaptive icon on API-26+.