A simple workaround is to wrap the progress bar in a layout that has a rounded shape and the same background color as the progress bar.
Example progress bar (drawable / progress_bar.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"> <shape> <corners android:radius="50dip" /> <solid android:color="@color/white"/> <padding android:bottom="3dip" android:left="3dip" android:right="3dip" android:top="3dip" /> </shape> </item> <item android:id="@android:id/progress"> <bitmap android:src="@drawable/test_progress_bar_progress" android:tileMode="repeat"/> </item> </layer-list>
Execution Style:
<resources> <style name="ProgressBarStyle" parent="@android:style/Widget.ProgressBar.Horizontal"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">10dip</item> <item name="android:max">100</item> <item name="android:progressDrawable">@drawable/progress_bar</item> </style> </resources>
Layout Form (drawable / rounded_shape.xml):
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <padding android:top="2dip" android:left="2dip" android:right="2dip" android:bottom="2dip"/> <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp"/> <solid android:color="@color/white"/> </shape>
Action Scheme:
<!-- ... --> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/rounded_shape" android:layout_marginLeft="30dip" android:layout_marginRight="30dip"> <ProgressBar android:id="@+id/testSummaryProgressBar" android:progress="10" style="@style/ProgressBarStyle"/> </LinearLayout> <!-- ... -->
The effect:

To increase the filling of the progress bar, you need to increase the indentation in the rounded_shape file.
Nykakin
source share