I need to add blurred drop shadow to my button:
I tried to create background with layer-list xml drawable, but it not looks like blur.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Drop Shadow Stack -->
<item>
<shape>
<corners android:radius="45dp" />
<padding
android:bottom="2dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<stroke
android:width="6dp"
android:color="#007879E8" />
</shape>
</item>
////// 10 more items
<item>
<shape>
<corners android:radius="45dp" />
<padding
android:bottom="2dp"
android:left="1dp"
android:right="1dp"
android:top="1dp" />
<stroke
android:width="6dp"
android:color="#177879E8" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<corners android:radius="45dp" />
<stroke
android:width="2dp"
android:color="@color/main_purple_text_color" />
</shape>
</item>
</layer-list>
Also i tried to use background element behind button with blured png but it uses to many resources and i cannot create selector to change background on hover or click.
I need to have single background file for button and use selector to change blur and gradient on hover/click.
Any ideas how to achieve such effect with Android SDK ?
UPDATE 1
Thanks everybody for answers, but I'm not asking how to create gradient. I've already done this. I need to create blurred drop-shadow.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…