Look at the images below :
On each image ProgressBar
has different style from another ProgressBar's.
I want to know, how i can specify progress bar style/thin in my application.
I look at android.R.attr.progressBarStyleSmall
but it just change a size of progress bar, not a thickness of a spinning circle.
Note : Don't post answers which suppose create a custom drawables. Libraries allow.
You may try this git library it will help you and give more customization ...
https://github.com/castorflex/SmoothProgressBar
mProgressBar.setIndeterminateDrawable(new SmoothProgressDrawable.Builder(context)
.strokeWidth(8f) //You should use Resources#getDimension
.build());
You can give any stroke width here.
Can't say whether you can deal with these default progress bars, but you can try with an alternative design your own progress image and perform animation over it like here,
Now add this in res/drawable/customprogress.xml
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="360" >
<shape
android:shape="oval"
android:useLevel="false" >
<size
android:height="48dip"
android:width="48dip" />
<gradient
android:centerColor="#ff000000"
android:centerY="0.50"
android:endColor="#ff00ff00"
android:startColor="#ff000000"
android:type="sweep"
android:useLevel="false" />
</shape>
</rotate>
and add this progressbar attribute
android:indeterminateDrawable="@drawable/customprogress"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With