ProgressDrawable
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- background -->
<item
android:id="@android:id/background"
android:drawable="@drawable/progress_patch_white_orange"></item>
<!-- progress -->
<item android:id="@android:id/progress">
<scale
android:drawable="@drawable/progress_patch_orange"
android:scaleWidth="100%"></scale>
</item>
<!-- second progress -->
<item android:id="@android:id/secondaryProgress">
<clip android:drawable="@drawable/progress_patch_orange"></clip>
</item>
</layer-list>
progress_patch_orange.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@color/orange" /><!-- 背景填充颜色 -->
<corners android:radius="20dp" /><!-- 边角圆弧的半径 -->
<!--<padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp" /><!– 四周留出来的空白 –>-->
</shape>
progress_patch_white_orange.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white" /><!-- 背景填充颜色 -->
<stroke
android:width="2dp"
android:color="@color/orange" /><!-- 描边,边框宽度、颜色 -->
<corners android:radius="45dp" /><!-- 边角圆弧的半径 -->
<!--<padding android:left="2dp" android:top="2dp" android:right="2dp" android:bottom="2dp" /><!– 四周留出来的空白 –>-->
</shape>