A library that shows a beautiful and customizable Material-based dialog with header. API 14+ required.
.positiveButton()
, .negativeButton()
and .neutralButton()
to get the buttons of the dialog.Kotlin release 🎉
Kotlin release 🎉
Style.HEADER_WITH_TITLE
..setIconAnimation(R.anim.your_animation)
to set a custom animation for the dialog icon. A zoom in-out animation will be used by default. Thanks to @chkfung.DialogFragment
. An example is available at the sample app.Builder
has been rewritten. See the guide below to migrate your existing 1.x code.setPositive(...)
, setNegative(...)
and setNeutral(...)
have been deprecated. You should now use setPositiveText(string)
, setPositiveText(int)
, onPositive(callback)
...withAnimation(boolean)
method has been removed.Builder
The dialogs are now initialized using MaterialStyledDialog.Builder
. Checkout this basic examples:
new MaterialStyledDialog.Builder(this)
.setTitle("Awesome!")
.setDescription("What can we improve? Your feedback is always welcome.")
.show();
or
MaterialStyledDialog dialog = new MaterialStyledDialog.Builder(this)
.setTitle("Awesome!")
.setDescription("What can we improve? Your feedback is always welcome.")
.build();
...
dialog.show();
The previous methods setPositive(...)
, setNegative(...)
and setNeutral(...)
have been deprecated. You should use the next ones:
new MaterialStyledDialog.Builder(this)
.setTitle("Awesome!")
.setDescription("What can we improve? Your feedback is always welcome.")
.setPositiveText(R.string.button)
.onPositive(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
Log.d("MaterialStyledDialogs", "Do something!");
})
//.setNegativeText(...)
//.onNegative(...)
//.setNeutralText(...)
//.onNeutral(...)
.show();
.setHeaderScaleType()
. Default: ScaleType.CENTER_CROP
. Thanks to @colinrtwhite..setHeaderColorInt()
to allow setting header an @ColorInt
. Thanks to @colinrtwhite.autoDismiss()
. If the method is false
, then you must manually dismiss the dialogs when using the button callbacks. Default is true
.Fixed wrong margin when using a custom view without title nor description.