How to make custom indeterminate ProgressBar in Android or how to change ProgressBar style or color

Hi,

Here i want to show you how easily make your own Android ProgressBar style or how to change ProgressBar color.

It is very easy! Also below you can download source code of Android project.

Below you can see the screenShot with ProgressBar

Indeterminate ProgressBar style

To do this you need:

  • Create the image for this ProgressBar in any graphical editor.
  • Create animation drawable with content:
<?xml version="1.0" encoding="utf-8"?>
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/image_for_rotation"
android:pivotX="50%"
android:pivotY="50%" />
Where @drawable/image_for_rotation is resource of your progressBar image.
  • Select android:indeterminateDrawable for ProgressBar witget.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<ProgressBar
android:indeterminateDrawable="@drawable/my_progress_indeterminate"
android:layout_height="100dp" android:layout_width="100dp"/>
</LinearLayout>

Enjoy! :)
Download source code. Here you can download Sample project with custom Android ProgressBar.

facebooktwittergoogle_plusredditpinterestlinkedintumblrmailby feather

19 thoughts on “How to make custom indeterminate ProgressBar in Android or how to change ProgressBar style or color

  1. Hello, Rafsan
    The intermediate progress bar cannot be stopped. You can make it invisible. I’ll doing this task in this way.

  2. thanks bro for ur reply…..i will tell were iam stuck..i have a home page with two buttons and and weview showing google.com..when i click on one button one gridview should come…the grid view should be above the webview we should see both the web view and gridview …and if i click the same button gridview should go and webview should be seen how this transparency can be achieved plz help..iam stuck here

  3. bro can this progress bar be used while switching between webpages in application in same layout………..

Leave a Reply

Your email address will not be published. Required fields are marked *


9 + two =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>