Browse Source

Title will no longer be switched for content if title is provided but content isn't. Also removed old deprecated method that no one should still be using.

Aidan Follestad 10 years ago
parent
commit
15d9220298

+ 3 - 1
library/src/main/java/com/afollestad/materialdialogs/DialogInit.java

@@ -133,7 +133,7 @@ class DialogInit {
         }
 
         // Setup content
-        if (dialog.content != null) {
+        if (dialog.content != null && builder.content != null) {
             dialog.content.setText(builder.content);
             dialog.content.setMovementMethod(new LinkMovementMethod());
             dialog.setTypeface(dialog.content, builder.regularFont);
@@ -151,6 +151,8 @@ class DialogInit {
                 final int contentColor = DialogUtils.resolveColor(dialog.getContext(), R.attr.md_content_color, fallback);
                 dialog.content.setTextColor(contentColor);
             }
+        } else if (dialog.content != null) {
+            dialog.content.setVisibility(View.GONE);
         }
 
         // Load default list item text color

+ 6 - 19
library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

@@ -1305,19 +1305,6 @@ public class MaterialDialog extends DialogBase implements
             return this;
         }
 
-        /**
-         * Sets a custom {@link android.widget.ListAdapter} for the dialog's list
-         *
-         * @param adapter The adapter to set to the list.
-         * @return This Builder object to allow for chaining of calls to set methods
-         * @deprecated Use {@link #adapter(ListAdapter, ListCallback)} instead.
-         */
-        @Deprecated
-        public Builder adapter(@NonNull ListAdapter adapter) {
-            this.adapter = adapter;
-            return this;
-        }
-
         /**
          * Sets a custom {@link android.widget.ListAdapter} for the dialog's list
          *
@@ -1371,12 +1358,12 @@ public class MaterialDialog extends DialogBase implements
         }
 
         public MaterialDialog build() {
-            if ((content == null || content.toString().trim().length() == 0) &&
-                    title != null && (items == null || items.length == 0) &&
-                    customView == null && adapter == null) {
-                this.content = this.title;
-                this.title = null;
-            }
+//            if ((content == null || content.toString().trim().length() == 0) &&
+//                    title != null && (items == null || items.length == 0) &&
+//                    customView == null && adapter == null) {
+//                this.content = this.title;
+//                this.title = null;
+//            }
             return new MaterialDialog(this);
         }