I need to make an indeterminate progress bar that is identical to the default widget just in a different color. I can't use tinting because I need to support from api 15+.
My solution thus far is to use a custom drawable xml:
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
android:toDegrees="360">
<shape android:shape="ring" android:innerRadiusRatio="3"
android:thicknessRatio="8" android:useLevel="false">
<size android:width="48dip" android:height="48dip" />
<gradient android:type="sweep" android:useLevel="false"
android:startColor="somecolor" android:centerColor="somecolor"
android:centerY="0.50" android:endColor="somecolor" />
</shape>
</rotate>
and then define that custom drawable thusly:
<ProgressBar
android:id="@+id/customprogressbar"
android:layout_width="42dp"
android:layout_height="35dp"
android:layout_gravity="center"
android:visibility="gone"
android:indeterminateDrawable="@drawable/customprogressbardrawable"
style="@android:style/Widget.ProgressBar"
/>
This works, but it doesn't look like the default progressbar. What are the default settings that I can use - or is there a better way to make my progressbar identical in every way with the default widget, just in different colors?