androidandroid-studiopngvector-graphics

Android Adaptive icon foreground always too big


I have a problem and I don't know how to solve it.

I am trying to make an adaptive android app icon. That's the code for it:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/launcher_backg" />
    <foreground android:drawable="@drawable/logo" />
</adaptive-icon>

That's what it looks like: Icon, that does not look like what it should look like

As you can see, the foreground is way too big. I don't want that, and I don't know how to fix it. I had a workaround, where I just scaled the foreground until it was small enough. The problem then is, that I don't know what the best size is and all, and I'm sure, there is a better solution.

The foreground is a png and the background a vector graphic.

How can I make the foreground to be the perfect size for an android app icon.


Solution

  • As you can tell from this reference the following sizes need to be provided:

    In Android 7.1 (API level 25) and earlier, launcher icons were sized at 48 x 48 dp. You must now size your icon layers using the following guidelines: