2

You might be thinking this question is a duplicate of this one. But since then, Android Studio has been updated and the solution given there is not working anymore.

Why are we forced to have a background when creating an Image Asset? What's the reason behind this? How we are supposed to change the launcher_icon without having any background? I don't see any option to disable the background in Image Asset.

Alternatively, I use an empty background but this doesn't work in Full Bleed Layers:

<?xml version="1.0" encoding="utf-8"?>
<vector
android:height="108dp"
android:width="108dp"
android:viewportHeight="108"
android:viewportWidth="108"
xmlns:android="http://schemas.android.com/apk/res/android">
</vector>

Or, just remove the background, but this will add a white background in your launcher_icon:

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

Or, change icon type into Legacy Only and set shape to none: enter image description here

Still, there's a white background in the launcher icon when installed.

So how can I get a transparent background or none for that matter, for my Launcher icon using Image Asset?

Nissim R
  • 542
  • 11
  • 29
Polar
  • 3,327
  • 4
  • 42
  • 77
  • 1
    Doesn't changing Shape to 'None' solve your problem? – Sonu Sanjeev Dec 28 '17 at 11:17
  • 2
    I just tried the Legacy approach setting the Shape to None and I obtained the icon without any background. I also installed it in my phone and shows correctly. Maybe is your phone that sets a white background? Try using another phone or an emulator and let us know. – dalla92 Dec 28 '17 at 11:26
  • 1
    Some phones like "Redmi" have a default white background for all app icons.So try installing app in different phones and check if white background still exists. – Sonu Sanjeev Dec 28 '17 at 11:32
  • Alright, I try another phone and the white background is gone. maybe it's because the launcher installed in my device is automatically adding white background, but why Google Apps like map, google, etc. has no white background? Also, some of my application has no white background? I'm using Infinix Hot S X521. – Polar Dec 28 '17 at 13:05

1 Answers1

1

It is not a problem of the icon you created with Android Studio, but it's a problem related to your specific device you're testing the application on. In fact, in the Image Asset if you specify the Shape to None, you get a trasparent background.

To address your problem, please try to use a different Home theme, like the Nova Launcher; you can change the home theme in Settings - Home.

dalla92
  • 432
  • 2
  • 8