My app's launcher icon is vector-drawn (as opposed to image-drawn). It is launched with
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/appColorDark" />
<foreground android:drawable="@drawable/ic_myIcon" />
</adaptive-icon>
However, the icon is severely cropped (i.e. only partially visible) in the preview display (and therefore in the ultimate launcher icon).
QUESTION: is there any attribute in XML (or alternatively, in code) I can use to scale the icon down, so that it fits nicely (i.e. with the required padding) in the previewed colored background? That code would also come in handy whenever I want to use the same vector file somewhere else in the app.
My solution now is to go back to Inkscape, reset the borders, resave the file in Android Studio, have a look in the preview, back to Inkscape etc. till it fits. Not ideal.
from How to adjust size of vector icon in launcher
No comments:
Post a Comment