8

I am trying to add a customized ProgressDialog to my Activity. I successfully changed the ProgressDialog font and the background colors, but I don't know how to change the spinner color without using a widget. Can anyone help me?

This is my Activity code:

 myPd_bar=new ProgressDialog(Ratings.this,R.style.Theme_MyDialog); myPd_bar.setMessage("Loading...."); myPd_bar.setTitle(null); myPd_bar.show(); 

This is my styles.xml code:

<style name="Theme.MyDialog" parent="@android:style/Theme.Dialog"> <item name="android:textColor">#daac56</item> <item name="android:background">#160203</item> <item name="android:windowFrame">@null</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> </style> 

And this is the current output:

enter image description here

3
  • refer this one maybe helpful stackoverflow.com/questions/5337613/… Commented Feb 26, 2014 at 8:15
  • @Aravinth i did not use any widget here. I used ProgressDialog. Commented Feb 26, 2014 at 8:19
  • The better response for this is stackoverflow.com/a/22072093/176977, the specific questions was spinner (progress) inside a ProgressDialog. Commented Jan 12, 2016 at 3:28

3 Answers 3

2

You would have to find the asset of the progressbar and change the color manually with Photoshop or some other image editing program.

If you really want to style your progressbar, I would recommend taking a look at the HoloEverywhere library, which gives your app the Android 4.0 Holo style, compatible with older versions of Android, it looks really nice.

By the way, the Android design guidelines say it's unnecessary to add the "Loading..." text next to the progress bar. The progressbar is enough to indicate the user that your app is loading. They also say it is nicer to embed the progressbar somewhere in your app, rather than displaying it in a dialog.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

1

You can't... because the spinner is different on all android versions (2.3, 4.0, ...)

If you want to change the spinner,

  1. you have to create your own maybe in .gif format.

Or

  1. maybe try to set the transparancy and change the color in background.

But why change the spinner ? Is it really important ?

3 Comments

According to my designing i thought that should match with my app customized theme. Thats why i trid.
Ok, but if you take a look at all app in Android, you always see the basic spinner. Maybe there is a reason... Personally, I never see a "custom" spinner.
1

It won't be easy to change the colour of the spinner.

If you wan't to have a different colour on the spinner the easiest will be to create your own progressdialog (extend it from the current). And then do a customized animation.

1 Comment

I don't have any idea about it. can u explain it?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.