5

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?

Marc Van Daele
  • 2,856
  • 1
  • 26
  • 52

1 Answers1

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

JDJ
  • 4,298
  • 3
  • 25
  • 44
Anand Tiwari
  • 1,583
  • 10
  • 22
  • I did not succeeed yet in getting rid of the blue backgrounds using your suggestion though I do think it should be possible. It's probably a cleaner solution than the accepted solution if I could get it working. – Marc Van Daele Jan 04 '12 at 16:58
  • It throws NullPointerException at tv1.setTextSize(20);. It does not get viewbyid after the show is generated. – lifemoveson May 16 '12 at 16:22
  • 1
    its working at my end, here 'android.R.id.message' is id of TextView, Android platform using to show message on progress dialog. you should study ProgressDialog class for better understanding. if you donot use progressDialog.show(); before getting tv1 from progressDialog, then tv1 will be a nullpointer exception. – Anand Tiwari May 17 '12 at 11:41
  • This post is old but do you know a way to the same but get the Title textview? What would be the resource id then? I tried with android.R.id.title but is not working. Is there a place where I can find this list? – Burakito Feb 10 '17 at 11:09
  • @Burakito, yes Answer is too old, there are lots of changes happened after, and usefullness of above is depend, but you can find your way your own, please go with link here for src code of class in Android L http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.1_r1/android/app/ProgressDialog.java#ProgressDialog – Anand Tiwari Feb 10 '17 at 11:59