Attribute ignored for AlertDialog
When creating an AlertDialog using AlertDialog.Builder(), the default specified font is used, but fontPath is ignored. I've tried:
mContext = new ContextThemeWrapper(CalligraphyContextWrapper.wrap(c), R.style.Z70_AlertDialog);
mContext = CalligraphyContextWrapper.wrap(new ContextThemeWrapper(c, R.style.Z70_AlertDialog));
as well as using just ContextThemeWrapper and CalligraphyContextWrapper.
Yeah its not setup to work out what is in the AlertDialog yet, You would need to define a custom view. Sorry about that.
It's 5, nearly 5 and a half, months later. Will this be implemented, and if so, do you have a progress report? I tried the same with ProgressDialog with the same outcome, so I assume that this is an issue with any form of built-in dialog?
Well, I haven't tried but it should pick up what ever is defined in the theme supplied to it. I'm open to pull requests... Or if you post a work around it makes it much easier to implement as it saves the grunt work.
The current "hacks" available to dialogs are as follows:
- Custom View
- Adjusting a dialog theme with a specified system typeface and a ContextThemeWrapper.
While you have CalligraphyContextWrapper.wrap(), it does not work with Dialogs for some reason. I've been looking for a way to override the lack of capabilities, but I have not had much success. Right now I'm just using the system mono typeface, but I want to use a custom fixed-width font.
Dialogs are weird as I think they create their own window which might not inherit the same context wrapper. Suffice to say I have not looked into it with much detail.
On Tue, 15 Sep 2015 18:52 Patrick Thomas [email protected] wrote:
The current "hacks" available to dialogs are as follows:
- Custom View
- Adjusting a dialog theme with a specified system typeface and a ContextThemeWrapper.
While you have CalligraphyContextWrapper.wrap(), it does not work with Dialogs for some reason. I've been looking for a way to override the lack of capabilities, but I have not had much success. Right now I'm just using the system mono typeface, but I want to use a custom fixed-width font.
— Reply to this email directly or view it on GitHub https://github.com/chrisjenx/Calligraphy/issues/164#issuecomment-140480907 .
You can change the font, just not to a custom one. It has to be a system font. I needed monospaced font for my ProgressDialog to make the formating look right, and the way I had to do it was a ContextThemeWrapper and a child style of Theme.Holo.Dialog using the "typeface" attribute set to the desired system font. However, for some reason using your wrapper and the custom attribute, doesn't work, as stated in this issue.
any progress here? Maybe any guide how to set custom font usign this library in ProgressDialog