Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawable xml with horizontal line and circle in middle

I want to create a drawable xml file for the shape below. It will be like a horizontal line should fill the width of the layout and a circle in the middle.

enter image description here

Can anyone help me on this? Thanks in advance.

like image 792
Kameswari Avatar asked Nov 04 '25 23:11

Kameswari


1 Answers

Keep it simple

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:height="1dp"
        android:gravity="center">
        <shape android:shape="rectangle">
            <solid android:color="#ff0000" />
        </shape>
    </item>

    <item
        android:width="56dp"
        android:height="56dp"
        android:gravity="center">
        <shape android:shape="oval">
            <solid android:color="#ff0000" />
        </shape>
    </item>
</layer-list>

output

enter image description here