I am trying to migrate from default android AlertDialog
to the new one included in appCompat-22.1
So far I understand you only have to import android.sup
When creating the AlertDialog
you can set a theme to use.
Example - Creating the Dialog
AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.MyAlertDialogStyle);
builder.setTitle("AppCompatDialog");
builder.setMessage("Lorem ipsum dolor...");
builder.setPositiveButton("OK", null);
builder.setNegativeButton("Cancel", null);
builder.show();
styles.xml - Custom style
Result
Edit
In order to change the Appearance of the Title, you can do the following. First add a new style:
afterwards simply reference this style in your MyAlertDialogStyle
:
This way you can define a different textColor
for the message via android:textColorPrimary
and a different for the title via the style.