Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 206
Marc Van Daele Avatar asked Jan 03 '12 14:01

Marc Van Daele


2 Answers

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().

like image 125
Anand Tiwari Avatar answered Nov 11 '22 09:11

Anand Tiwari


This article may give you some hints on styling your dialogs and they will look the same on both targets.

like image 34
Diego Torres Milano Avatar answered Nov 11 '22 08:11

Diego Torres Milano