You can try the following simple way: you need to duplicate the path tag with the same pathData and add the necessary parameters to it(strokeWidth, strokeColor, strokeLineJoin, strokeLineCap).
For a smoother shadow transition, you can duplicate the path tag several times with a larger strokeWidth. The order of the tags is also important. example code:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
android:strokeWidth="1"
android:strokeColor="#FFEB3B"
android:strokeLineJoin="round" />
<path
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"
android:strokeWidth=".5"
android:strokeColor="#2196F3"
android:strokeLineJoin="round" />
<path
android:fillColor="#FFFFFF"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/></vector>
vector in the end
Drawable
class and do the drawing insidedraw
method, first draw the shadow then originalDrawable
– UrbanaScriptIntrinsicBlur
to blur the edges, BTW if you want to use shadow pngs with different resolutions why do you want to use vectors at all? – Urbana