I've linked the image how to create it in android xml
The rounded corners rectangle and circle
The code is written for Getting the circle in rectangle.
I need to create the rectangle with a circle inside. as shown in the image below.
the code I tried
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Larger blue circle in back -->
<item>
<shape
android:shape="rectangle"
>
<solid android:color="#FFFFFF"
/>
<corners
android:topLeftRadius="30dp"
android:topRightRadius="30dp"
android:bottomRightRadius="30dp"
android:bottomLeftRadius="30dp"
/>
<size
android:width="89dp"
android:height="22dp"/>
<stroke android:width="1dp"
android:color="#fff" />
</shape>
</item>
<!-- Smaller red circle in front -->
<item>
<shape android:shape="oval">
<!-- transparent stroke = larger_circle_size - smaller_circle_size -->
<stroke android:color="@android:color/transparent"
android:width="5dp"/>
<solid android:color="#f00"/>
<size
android:width="5dp"
android:height="5dp"/>
<padding
android:bottom="0dp"
android:left="10dp"
android:right="40dp"
android:top="0dp"
/>
</shape>
</item>
</layer-list>