简体   繁体   中英

force android use square launcher icon

I want to use the square version of my launcher icon but somehow android keeps forcing use the rounded version.

I read forcing square app icon and although the explanation makes sense it is not true:

在此处输入图片说明

in this screenshot you can see that most of icons are rounded but you have contacts, widget preview and terminal emulator

And before someone say "they are special apps" terminal emulator is a shit app i downloaded from play store... In my cellphone 80% of apps are rounded but instagram, booking and some others are square...

how to force android use my square launcher?

There is a solution for this which i have tried and its works for me. What we have to do is take the app icon and keep in res -> drawable. App icon should be in all formats:-

mdpi , hdpi , xhdpi , xxhdpi , xxxhdpi

with same name for example-

  • ic_app_icon.png(mdpi)
  • ic_app_icon.png(hdpi)
  • ic_app_icon.png(xhdpi)
  • ic_app_icon.png(xxhdpi)
  • ic_app_icon.png(xxxhdpi)

Then in Android Menifest file do this change

android:roundIcon="@drawable/ic_app_icon"

by this we can get app icon square.

First, please understand that there are hundreds of different launcher implementations in use across the ~10,000 Android device models and ~2 billion Android devices. How a launcher chooses to represent your activity is up to the developer of the launcher. For example, there is no requirement for the launcher to use any icon at all (eg, a launcher optimized for screen readers and visually impaired users). A launcher that does use some sort of graphical element might use your icon or not, and if if it does use your icon, it might modify it (crop it to a shape, apply a color filter, cause it to spin, whatever).

Your screenshot appears to be of the Android emulator. In that case, temporarily, you can set your targetSdkVersion to be 25 or lower, and that particular launcher will not attempt to adapt your launcher icon.

However, please bear in mind that you will not be able to ship your app on the Play Store with that low of a targetSdkVersion starting in a few months. So, if the Play Store is your planned distribution channel, you will need to get used to Android's adaptive icon system and deal with the fact that the shape of your icon will be changed on most Android 8.0+ devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM