0

I want to create the below progress bar but I don't know how to create this image with layer list and xml based. If you know about this, please help me.

enter image description here

Fahim
  • 384
  • 5
  • 20

1 Answers1

0

In your layer list you need two items,first with background id and second with progress id, then you can create your own custom shape,for example what you looking is like this:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
    android:id="@+id/background"
    android:gravity="center_vertical|fill_horizontal">
    <shape android:shape="rectangle">
        <corners android:radius="20dp" />
        <size android:height="45dp" />
        <solid android:color="#FFFFFF"/>
        <stroke android:color="#0000FF"
            android:width="5dp"/>
    </shape>
</item>
<item
    android:id="@+id/progress"
    android:left="10dp"
    android:right="10dp"
    android:gravity="center_vertical|fill_horizontal">
    <scale android:scaleWidth="100%">
        <shape android:shape="rectangle">
            <corners android:radius="20dp" />
            <size android:height="25dp" />
            <solid android:color="#0000FF" />
        </shape>
    </scale>
</item>
</layer-list>
Farid
  • 1,024
  • 9
  • 16