Google Material 風格Android對話框:Material Dialog

jopen 10年前發布 | 132K 次閱讀 Android開發 移動開發 Material Dialog

這是一個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.baiduhome.net/lib/view/home/1415171087340

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!