The system comes with ProgressBar too ugly, so I decided to customize a style.
The original style
<?xml version= "1.0" encoding= "Utf-8"?>
<layer-list xmlns:android= "Http://schemas.android.com/apk/res/android" >
<item android:id= "@android: Id/background" >
<shape >
<corners android:radius= "5DP" >
</corners>
<gradient
Android:startcolor= "#ff9d9e9d"
Android:centercolor= "#ff5a5d5a"
android:centery= "0.75"
Android:endcolor= "#ff747674"
Android:angle= "270"
/>
</shape>
</item>
<item android:id= "@android: Id/secondaryprogress" >
<clip
>
<shape>
<corners android:radius= "5DP"/>
<gradient
Android:startcolor= "#80ffd300"
Android:centercolor= "#80ffb600"
android:centery= "0.75"
Android:endcolor= "#a0ffcb00"
Android:angle= "270"
/>
</shape>
</clip>
</item>
<item android:id= "@android: Id/progress" >
<clip>
<shape>
<corners android:radius= "5DP" ></corners>
<gradient
Android:startcolor= "#ffffd300"
Android:centercolor= "#ffffb600"
android:centery= "0.75"
Android:endcolor= "#ffffcb00"
Android:angle= "270"
/>
</shape>
</clip>
</item>
</layer-list>
After customization:
Progressbarcolor.xml
<?xml version= "1.0" encoding= "Utf-8"?>
<layer-list xmlns:android= "Http://schemas.android.com/apk/res/android" >
<item android:id= "@android: Id/background"
android:drawable= "@drawable/bg_progress"
>
</item>
<item android:id= "@android: Id/secondaryprogress" >
<clip
>
<shape>
<corners android:radius= "5DP"/>
<gradient
Android:startcolor= "#80ffd300"
Android:centercolor= "#80ffb600"
android:centery= "0.75"
Android:endcolor= "#a0ffcb00"
Android:angle= "270"
/>
</shape>
</clip>
</item>
<item android:id= "@android: Id/progress" android:drawable= "@drawable/draw_progress" >
</item>
</layer-list>
<style name="My_pb_style" parent="@android: Style/widget.progressbar.horizontal" > < Name="android:progressdrawable" > @drawable/progressbarcolor</</style>
Of these, two images are required:
The focus is on how the style of the system is implemented, and then its own imitation, in this way of learning.
A tentative approach to Android custom style---progressbar