2

iam making a custom progress dialog

my custom style code is

 <style name="CustomDialog" parent="@android:style/Theme.Dialog">
 <item name="android:background">#000000</item>
 <item name="android:textColor">#FFFFFF</item>
 </style>

and my java code is.

    pDialog = new ProgressDialog(context,R.style.CustomDialog);
    pDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    pDialog.setMessage("Processing");

    pDialog.getWindow().setBackgroundDrawable(newColorDrawable(android.graphics.Color.TRANSPARENT));
    pDialog.setCancelable(false);
    pDialog.show();

now how i remove a bckground color in my progress dialog same is image link is Using custom ProgressDialog android

Community
  • 1
  • 1
Qadeer Hussain
  • 653
  • 2
  • 7
  • 17

2 Answers2

3

in your styles.xml:

<style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsFloating">false</item>
    <item name="android:windowNoTitle">true</item>
</style>

in your code:

pDialog = new ProgressDialog(context,R.style.CustomDialogTheme);
canova
  • 3,965
  • 2
  • 22
  • 39
2

Just use this in your style

<style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
    <item name="android:windowBackground">@android:color/transparent</item>
</style>

Credits to Sir SC

ceosilvajr
  • 185
  • 1
  • 2
  • 10