Florin M
Florin M

Reputation: 445

App Icon on Device is too small

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?

enter image description here

Upvotes: 19

Views: 34524

Answers (5)

Omkar T
Omkar T

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

enter image description here

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

Step 1

Delete ic_launcher from drawables and paste it in mipmap-xxhdpi-v4 Add transparent padding of width/6 px to your launcher icon online

Step 2

Paste the second file as ic_launcher_foreground

project view

Step 3

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>

Step 4

Edit the manifest and use mipmap instead of drawable manifest

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

How it works:

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

Geraldo Neto
Geraldo Neto

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

Chris8447
Chris8447

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

ezChx
ezChx

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.

enter image description here

Upvotes: 21

rudifus
rudifus

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

Related Questions