I have read lots of articles, here and elsewhere about customizing AlertDialogs, and those created by AlertDialog.Builder.
The approach that I’m using at the moment is injecting my AlertDialog.Builder with a ContextThemeWrapper. This ContextThemeWrapper is configured to read from a custom style that inherits from Theme.Dialog.
My customization requirements are quite straightforward:
- Change the title bar background colour from the default navy/black version
- Change the font type and size of both title and buttons
I’ve had a look in the default themes.xml and styles.xml but I don’t see where to configure number 1 in particular…can someone let me know how this is done?
Also, some of the solutions I’ve seen involve inflating a layout and then setting this using AlertDialog.Builder.setView()…if I was to customize using this way then how do I design the views for positive and negative buttons?
Thanks
Sorry, alert dialogs are not really intended to be themed like that. They are basically the most concrete thing you can do — a canned appearance for standard common situations.
If you want to have a dialog with a customized appearance, you should just start with the Dialog class.