What I would do is something like this:
1 - Separate your LayerList into 2 distinct drawables
circle.xml
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
>
<size android:height="85dp" android:width="90dp" />
<solid android:color="@color/grey" />
<stroke android:color="@color/white" android:width="4dp" />
</shape>
I assume you already have this bitmap: drawable/checkmark_filled
2 - Use a TextView, instead of an ImageView:
<TextView
android:id="@+id/button_apply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:backgound="@drawable/button"
android:drawableTop="drawable/checkmark_filled"
android:text="APPLY"
android:clickable="true"
/>
Adjust the gravity and the paddings as needed.
Also set some other properties as needed.
Note that you can (and should) use a string resource, instead of a hard-coded text.
Brief explanation:
- I'm using the oval shape as the TextView brackground.
- I'm using the checkmark bitmap as a compound drawable.
- I'm using the TextView's text to write something.
- I set the TextView as
clickable
, so you can use it as if it was a Button.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…