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.
Asked
Active
Viewed 61 times
0

Fahim
- 384
- 5
- 20
-
Here: https://stackoverflow.com/questions/16893209/how-to-customize-a-progress-bar-in-android – Hoàng Vũ Anh Aug 10 '20 at 06:37
1 Answers
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