Marc Van Daele
Marc Van Daele

Reputation: 2734

How do I change the color of the ProgressDialog

I have a ProgressDialog that looks like this on a Galaxy Tab 10.1"
enter image description here

and like this on a Galaxy Tab 7"
enter image description here

I want both Dialogs to look the same:
The closest that I get is by using the following style

<style name="popupStyle" parent="android:Theme.Dialog">
<item name="android:textColor">#FFFFFFFF</item>
<item name="android:background">#FF000000</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>

which results in this enter image description here

So my questions are:
- How can I remove the border around the "Please wait" title?
- How can I change the overall border from blue to white?
- How can I adjust/reduce the width?

Upvotes: 5

Views: 15498

Answers (1)

Anand Tiwari
Anand Tiwari

Reputation: 1598

progressDialog = new ProgressDialog(context):    
progressDialog.show();  
TextView tv1 = (TextView) progressDialog.findViewById(android.R.id.message);  
tv1.setTextSize(20);  
tv1.setTypeface(yourCustomTF);  
tv1.setText("your msg");  

By doing it this way, you can change the message text and also customize the entire view by getting their components from the ProgressDialog that is shown. Remember, you can get the view Id by using findViewById() after progressDialog.show() because the view is generated after show().

Upvotes: 9

Related Questions