Reputation: 445
My problem is that the App Icon on my device looks way too small in comparison to the other apps. I read some solution on other questions, like this one Android App Icon size too small but this doesn't seems to be my problem. In the Android Studio you can make a right click on "res" where you can find new --> image asset where you can create such a icon. it creates icons for all the different sizes like mdpi, hdpi and so on. So i thougt that i might display the app icon correctly but it doesn't. can anybody help me?
Upvotes: 19
Views: 34524
Reputation: 883
If you use any single image directly as android:icon="@drawable/ic_launcher"
It'll be shown correctly on old devices but on android 26+ it'll appear small
Use this approach to make the icon appear like fitXY
scaleType for imageview, that is, it's corners can be clipped like cardview but it will not be shrinked
Delete ic_launcher
from drawables
and paste it in mipmap-xxhdpi-v4
Add transparent padding of width/6 px to your launcher icon online
Paste the second file as ic_launcher_foreground
Create ic_launcher.xml under res/mipmap-anydpi-v26 and add this content
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<background android:drawable="@color/colorTransparent"/>
</adaptive-icon>
Edit the manifest and use mipmap instead of drawable
Now your icon should not appear shrinked/zoomed This is useful when your app icon can't be split into foreground/background eg some graphic image as app icon
For API26+ devices, mipmap-anydpi-v26
will take precedence over mipmap-xxhdpi-v4 and system will load icon from xml, which in turn, loads foreground from ic_launcher_foreground, automatically crop 2/3 of its size because it's 'adaptive icon'. (This is the reason we add padding of width/6 from all sides
For older devices the ic_launcher.webp will be used directly
Tested on API 21-31
Upvotes: 2
Reputation: 4030
Try to use this. Its very useful, fast and free. And thats what I use. If your icon already has a shape, remember to set the shape to none. Hope it helps!
If you are getting the same results, I also recommend this website, where I usually get "bigger" icons.
Upvotes: 17
Reputation: 306
I had the same issue. I fixed it like so:
Create the adaptive icon through Android Asset Studio. In the third tab you can select "Create Legacy Icon". Only this legacy one is going to be too small! The others will be fine.
So the thing I did was just to replace the icon_launcher.png files (this is the legacy icon).
Upvotes: 1
Reputation: 4062
In "Configure Image Asset", click "Legacy", change "Shape" from "Square" to "None", and the image padding will appear. Go back to "Foreground Layer" and resize the image to fill the padding.
Upvotes: 21
Reputation: 73
I found the launcher icons generator puts there a small padding, that is the reason for smaller icons. On the other way it is recommended by Google team here.
Android expects product icons to be provided at 48dp, with edges at 1dp.
All is on you to decide. In case the icon applies to whole square space - use padding, otherwise when small object is not square shape, rather fit to edges :)
Upvotes: 3