I may be late to answer this question, but as I was facing same problem, I resolved it as follows:
I created 2 styles one for above lollipop and one for below it.
API Level greater than 19
<style name="AppAlertTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/white</item>
<item name="android:textColorPrimary">@color/transparent</item>
<item name="android:background">@color/blue</item>
<item name="android:windowBackground">@color/transparent</item>
<item name="android:popupBackground">@null</item>
</style>
API Level less than 19
<style name="AppAlertTheme_api19" parent="android:Theme.Holo.Dialog">
<item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
<item name="android:windowBackground">@color/nlue</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:textColor">@color/white</item>
</style>
<style name="CustomAlertDialogStyle">
<item name="android:bottomBright">@android:color/transparent</item>
<item name="android:bottomDark">@android:color/transparent</item>
<item name="android:bottomMedium">@android:color/transparent</item>
<item name="android:centerBright">@android:color/transparent</item>
<item name="android:centerDark">@android:color/transparent</item>
<item name="android:centerMedium">@android:color/transparent</item>
<item name="android:fullBright">@android:color/transparent</item>
<item name="android:fullDark">@android:color/transparent</item>
<item name="android:topBright">@android:color/transparent</item>
<item name="android:topDark">@android:color/transparent</item>
</style>
Then used this style as follows:
public int getProgressDailogStyle(){
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT) {
return R.style.AppAlertTheme;
} else {
return R.style.AppAlertTheme_api19;
}
}
and finally
progressDialog = new ProgressDialog(context, getProgressDailogStyle());
Hope this helps you..
<item name="android:background">@color/colorPrimaryDark</item>
. It's not the correct way to set the background drawable for aProgessDialog
– Obel