I'd like to change the default button styling on an alert dialog.
The standard Alert Dialog Fragment (in Android L) looks like this:
I'd like the right button to be styled as a normal button instead of a borderless button. Google itself seems to use this pattern in various dialogs, such as:
Does anyone know if this is possible, without recreating the whole dialog from scratch?
You can style the button in the theme with attributes:
android:buttonBarPositiveButtonStyle
,android:buttonBarNegativeButtonStyle
, andandroid:buttonBarNeutralButtonStyle
.Ok, the issue is solved automagically by updating to the (just released) release 21. Now the buttons are automatically in primary color :-)
EDIT: They are not in primary color, but in Android's basic turquoise..
This solution is for changing button color with material effect in
AppCompatDialogFragment
.Style file - v21
Style file