Преглед на файлове

Added a convenience method .show to the builder

Egor N преди 10 години
родител
ревизия
734f4c5e72
променени са 1 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 7 1
      library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

+ 7 - 1
library/src/main/java/com/afollestad/materialdialogs/MaterialDialog.java

@@ -847,6 +847,12 @@ public class MaterialDialog extends DialogBase implements View.OnClickListener,
         public MaterialDialog build() {
             return new MaterialDialog(this);
         }
+        
+        public MaterialDialog show() {
+            MaterialDialog dialog = new MaterialDialog(this);
+            dialog.show();
+            return dialog;
+        }
     }
 
 
@@ -1019,4 +1025,4 @@ public class MaterialDialog extends DialogBase implements View.OnClickListener,
     public static interface FullCallback extends Callback {
         void onNeutral(MaterialDialog dialog);
     }
-}
+}