Android layerlist is not working in different mobiles

Viewed 273

I want to create a drawable file like the below screenshot.

screenshot

My drawable xml file:

<?xml version="1.0" encoding="utf-8"?>
<layer-list
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:top="0px"
        android:left="0px"
        android:right="0px"
        android:bottom="0px">
        <shape android:shape="rectangle">
            <corners android:radius="@dimen/_6sdp" />
            <solid android:color="@color/activeslots"/>
        </shape>
    </item>
    <item
        android:top="@dimen/_14sdp"
        android:left="@dimen/_12sdp"
        android:right="@dimen/_58sdp"
        android:bottom="@dimen/_14sdp">
        <shape android:shape="oval">
            <solid android:color="@color/white"/>
            <size android:height="@dimen/_20sdp"
                android:width="@dimen/_20sdp"/>
        </shape>
    </item>
</layer-list>

I created rectangle and oval inside the layer_list. But the issue is it is not working in different mobiles, also the white circle inside the drawable is becomes big after setting height and width.

0 Answers
Related