瀏覽代碼

Content is replaced by title if no content is specified in a regular dialog (not a list or custom view dialog).

Aidan Follestad 10 年之前
父節點
當前提交
6a38309de9
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

+ 5 - 0
library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

@@ -1478,6 +1478,11 @@ public class MaterialDialog extends DialogBase implements View.OnClickListener {
         }
 
         public MaterialDialog build() {
+            if ((content == null || content.toString().trim().length() == 0) &&
+                    title != null && (items == null || items.length == 0) && customView == null) {
+                this.content = this.title;
+                this.title = null;
+            }
             return new MaterialDialog(this);
         }