Google Material 风格Android对话框:Material Dialog

jopen 10年前

这是一个Android库,用于Google Material 风格Android对话框。使用简单。

Screenshots

Google Material 风格Android对话框:Material DialogGoogle Material 风格Android对话框:Material Dialog Google Material 风格Android对话框:Material DialogGoogle Material 风格Android对话框:Material Dialog

You can also change the background with a image what you like. it's very easy!:

Google Material 风格Android对话框:Material DialogGoogle Material 风格Android对话框:Material Dialog

And with the v1.0.6, you can use the setContentView() to change the message view to your custom view.

Example:

Google Material 风格Android对话框:Material Dialog

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();          ...      }  });    mMaterialDialog.show();    // You can change the message anytime. before show  mMaterialDialog.setTitle("提示");  mMaterialDialog.show();  // You can change the message anytime. after show  mMaterialDialog.setMessage("你好,世界~");

项目主页:http://www.open-open.com/lib/view/home/1415171087340