tags:

views:

1798

answers:

2

Hello, I'm looking for a very obvious thing (in other languages !!) and it drives me crazy !

I would like to know how I can change indeterminate ProgressBar color from basis white/grey color to black ? When I change the indeterminateDrawable, I get a static image instead of a moving animated progressBar. Is there any way to do it simply in xml ?

Thank you !

+5  A: 

Step #1: Copy drawable/progress_indeterminate_horizontal.xml from your SDK's resources into your project.

Step #2: Copy drawable-hdpi/progressbar_indeterminate* from your SDK's resources into your project.

Step #3: Copy drawable-mdpi/progressbar_indeterminate* from your SDK's resources into your project.

Step #4: Modify the PNG files to look the way you want.

Step #5: Modify the progress_indeterminate_horizontal.xml to point to your PNG files (versus the standard ones).

Step #6: Use @drawable/progress_indeterminate_horizontal for the indeterminateDrawable value.

CommonsWare
Thanks for your explanations ! The component I'm using is the indeterminate one but not horizontal (a circle). It works anyway with the good files, but movement is not very smooth ! I tried with a linear interpolator, but it didn't do the thing ! What a mess for only one color !!! I stay with that for the moment !
mwa
Whoops, sorry, I was thinking the horizontal one. The same principle holds, but you probably need different resources from the SDK, instead of the ones I list above.
CommonsWare
No problem ! Thanks for your help ;)
mwa
A: 

actually all u need to do (for both cirle and bar) is create an xml file in drawable as shown below...... progress_spinner_001 points to whatever image u want to animate and duration ... how long u want to display each frame for....... and set ur android:indeterminateDrawable= filename_in_drawable....

ps u may need to resize the progressbar to show as desired

lawnile