This is an Android library, I call it MaterialDialog. It's very easy to use. Just new it, then the beautiful AlertDialog will show automatedly. It is artistic, conforms to Google Material Design. I hope that you will like it, and enjoys it. ^ ^
Import the library, then add it to your /settings.gradle
and /app/build.gradle
, if you don't know how to do it, you can read my blog for help.
Android Studio 简介及导入 jar 包和第三方开源库方法
It's very easy, just like this:
mMaterialDialog = new MaterialDialog(this);
mMaterialDialog.setTitle("MaterialDialog");
mMaterialDialog.setMessage("hello world!");
mMaterialDialog.setPositiveButton("OK", new View.OnClickListener() {
@Override
public void onClick(View v) {
mMaterialDialog.dismiss();
...
}
});
mMaterialDialog.setNegativeButton("CANCLE", new View.OnClickListener() {
@Override
public void onClick(View v) {
mMaterialDialog.dismiss();
...
}
});
With the first init, it will show automatedly. Or, you can init it and call the mMaterialDialog.show()
to show the dialog simply.
A student in mainland China. (^ ^ Thanks daimajia)
My blog: http://drakeet.me
More about me: http://drakeet.me/about