I have made my custom style for progress dialog, however it has weird borders around it.
Here is the theme:
<style name="AppTheme.Dialog" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@android:color/white</item>
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:background">@color/colorPrimaryDark</item>
<item name="android:popupBackground">@null</item>
</style>
Any ideas why there is such weird background ?
To remove the colored or white border around the progress dialog have the dialog use a theme that defines a transparent windowBackground
<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
</style>
When creating the dialog use this theme:
new ProgressDialog(MyActivity.this, R.style.MyDialogTheme);
Please add:
your_progress_dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
to your java.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With