8

Look at the images below :

  • enter image description here
  • enter image description here
  • enter image description here

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.

Sergey Shustikov
  • 15,377
  • 12
  • 67
  • 119

2 Answers2

5

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.

Moinkhan
  • 12,732
  • 5
  • 48
  • 65
5

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,

enter image description 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" 
Abhishek
  • 1,337
  • 10
  • 29