Monday 16 January 2017

Change default color of ProgressDialog's (Text, Background, Circle) in android


Default ProgressDialog  in Android Looks like : 



Now if we want to customize the color of round progress that should match our Android app theme,  we can do this by defining a custom theme for our ProgressDialog like this :

in style.xml  (located in app > main > res > values > style.xml )


<style name="MyAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/orange</item> <--define your color here-->
</style>
Now in .java class define your custom style for ProgressDialog like this :  






ProgressDialog progressDialog = new ProgressDialog(this , R.style.MyAlertDialogStyle);
progressDialog.setMessage("Please wait ...");
progressDialog.show();
 output :