I am trying to make custom button below is the code. I want to achieve gradient,corners,shadow in my button and also I want to put small Icon in the center of the button say lock button
<Button
android:id="@+id/button5"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_alignBaseline="@+id/button4"
android:layout_alignBottom="@+id/button4"
android:layout_marginLeft="15dp"
android:layout_toRightOf="@+id/button1"
android:shadowColor="#000000"
android:shadowRadius="50"
android:background="@drawable/levelselectionbutton"/>
I achieved gradient and corners and also image at some extend but I want it in center and if i use gravity then image is getting zoomed nd also looking blur. what should i do to achieve it in the center whitout getting pixalized here is the code of my layerlist
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" >
<corners android:radius="20dp" />
<gradient
android:startColor="#7F7F7F"
android:type="linear"
android:endColor="#FFFF"
android:angle="270"/>
</shape>
</item>
<item
android:drawable="@drawable/ic_hh_lock"
android:gravity="center"
/>
How will I achieve the shadow one more item in the list?