What I'm trying to do is to change the font of progressBar message from default to custom. I've already tried many techniques and failed.
I've tried to change it via Styles and then apply this style to my dialog:
<style name="StyledDialog" parent="@android:style/Theme.Panel">
<item name="android:background">@android:color/transparent</item>
<item name="android:alertDialogStyle">@style/CustomStyle</item>
<item name="fontPath">fonts/Lato-Regular.ttf</item> // not working
</style>
<style name="CustomStyle">
<item name="fontPath">fonts/Lato-Regular.ttf</item> // not working
</style>
Then I tried to get the message in TextView, but I'm getting null
dialog = new ProgressDialog(getContext(), R.style.StyledDialog); //tried with styles here.
dialog.create(); //yep, create the dialog, see that dialogs's onCreate method was executed;
TextView view = (TextView) dialog.findViewById(R.id.message); // getting null
Typeface face = Typeface.createFromAsset(getAssets(),
"fonts/epimodem.ttf");
view.setTypeface(face); //null pointerException
I'm using Calligraphy library to change the font of all the textViews I have. So do you have any idea how to change the fond of the progressDialog I have