Browse Source

0.0.50.beta37.pre
- CustomDialog 增加了 `setMaxWidth`、`setMaxHeight`、`setMinHeight`、`setMinWidth` 接口;
- 修复 FullScreenDialog 在特定情况下显示时会闪烁的问题;

Kongzue 1 month ago
parent
commit
daec22110e
2 changed files with 116 additions and 36 deletions
  1. 115 35
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java
  2. 1 1
      gradle.properties

+ 115 - 35
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -126,16 +126,6 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
         return new BottomDialog().setCustomView(onBindView);
     }
 
-    public BottomDialog(CharSequence title, CharSequence message) {
-        this.title = title;
-        this.message = message;
-    }
-
-    public BottomDialog(int titleResId, int messageResId) {
-        this.title = getString(titleResId);
-        this.message = getString(messageResId);
-    }
-
     public static BottomDialog show(CharSequence title, CharSequence message) {
         BottomDialog bottomDialog = new BottomDialog(title, message);
         bottomDialog.show();
@@ -148,18 +138,6 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
         return bottomDialog;
     }
 
-    public BottomDialog(CharSequence title, CharSequence message, OnBindView<BottomDialog> onBindView) {
-        this.title = title;
-        this.message = message;
-        this.onBindView = onBindView;
-    }
-
-    public BottomDialog(int titleResId, int messageResId, OnBindView<BottomDialog> onBindView) {
-        this.title = getString(titleResId);
-        this.message = getString(messageResId);
-        this.onBindView = onBindView;
-    }
-
     public static BottomDialog show(CharSequence title, CharSequence message, OnBindView<BottomDialog> onBindView) {
         BottomDialog bottomDialog = new BottomDialog(title, message, onBindView);
         bottomDialog.show();
@@ -172,6 +150,52 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
         return bottomDialog;
     }
 
+    public static BottomDialog show(CharSequence title, OnBindView<BottomDialog> onBindView) {
+        BottomDialog bottomDialog = new BottomDialog(title, onBindView);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public static BottomDialog show(int titleResId, OnBindView<BottomDialog> onBindView) {
+        BottomDialog bottomDialog = new BottomDialog(titleResId, onBindView);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public static BottomDialog show(OnBindView<BottomDialog> onBindView) {
+        BottomDialog bottomDialog = new BottomDialog(onBindView);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public static BottomDialog show(int titleResId, int messageResId, int okTextResId) {
+        BottomDialog bottomDialog = new BottomDialog(titleResId, messageResId, okTextResId);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public static BottomDialog show(int titleResId, int messageResId, int okTextResId, int cancelTextResId) {
+        BottomDialog bottomDialog = new BottomDialog(titleResId, messageResId, okTextResId, cancelTextResId);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public static BottomDialog show(int titleResId, int messageResId, int okTextResId, OnBindView<BottomDialog> onBindView) {
+        BottomDialog bottomDialog = new BottomDialog(titleResId, messageResId, okTextResId, onBindView);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public static BottomDialog show(int titleResId, int messageResId, int okTextResId, int cancelTextResId, OnBindView<BottomDialog> onBindView) {
+        BottomDialog bottomDialog = new BottomDialog(titleResId, messageResId, okTextResId, cancelTextResId, onBindView);
+        bottomDialog.show();
+        return bottomDialog;
+    }
+
+    public BottomDialog(OnBindView<BottomDialog> onBindView) {
+        this.onBindView = onBindView;
+    }
+
     public BottomDialog(CharSequence title, OnBindView<BottomDialog> onBindView) {
         this.title = title;
         this.onBindView = onBindView;
@@ -182,26 +206,82 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
         this.onBindView = onBindView;
     }
 
-    public static BottomDialog show(CharSequence title, OnBindView<BottomDialog> onBindView) {
-        BottomDialog bottomDialog = new BottomDialog(title, onBindView);
-        bottomDialog.show();
-        return bottomDialog;
+    public BottomDialog(CharSequence title, CharSequence message) {
+        this.title = title;
+        this.message = message;
     }
 
-    public static BottomDialog show(int titleResId, OnBindView<BottomDialog> onBindView) {
-        BottomDialog bottomDialog = new BottomDialog(titleResId, onBindView);
-        bottomDialog.show();
-        return bottomDialog;
+    public BottomDialog(int titleResId, int messageResId) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
     }
 
-    public BottomDialog(OnBindView<BottomDialog> onBindView) {
+    public BottomDialog(CharSequence title, CharSequence message, OnBindView<BottomDialog> onBindView) {
+        this.title = title;
+        this.message = message;
         this.onBindView = onBindView;
     }
 
-    public static BottomDialog show(OnBindView<BottomDialog> onBindView) {
-        BottomDialog bottomDialog = new BottomDialog(onBindView);
-        bottomDialog.show();
-        return bottomDialog;
+    public BottomDialog(int titleResId, int messageResId, OnBindView<BottomDialog> onBindView) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
+        this.onBindView = onBindView;
+    }
+
+    public BottomDialog(int titleResId, int messageResId, int okTextResId, int cancelTextResId) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
+        this.okText = getString(okTextResId);
+        this.cancelText = getString(cancelTextResId);
+    }
+
+    public BottomDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+    }
+
+    public BottomDialog(int titleResId, int messageResId, int okTextResId) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
+        this.okText = getString(okTextResId);
+    }
+
+    public BottomDialog(CharSequence title, CharSequence message, CharSequence okText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+    }
+
+    public BottomDialog(int titleResId, int messageResId, int okTextResId, OnBindView<BottomDialog> onBindView) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
+        this.okText = getString(okTextResId);
+        this.onBindView = onBindView;
+    }
+
+    public BottomDialog(CharSequence title, CharSequence message, CharSequence okText, OnBindView<BottomDialog> onBindView) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.onBindView = onBindView;
+    }
+
+    public BottomDialog(int titleResId, int messageResId, int okTextResId, int cancelTextResId, OnBindView<BottomDialog> onBindView) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
+        this.okText = getString(okTextResId);
+        this.cancelText = getString(cancelTextResId);
+        this.onBindView = onBindView;
+    }
+
+    public BottomDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, OnBindView<BottomDialog> onBindView) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+        this.onBindView = onBindView;
     }
 
     public BottomDialog show() {

+ 1 - 1
gradle.properties

@@ -19,7 +19,7 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.50.beta36
+BUILD_VERSION=0.0.50.beta37
 BUILD_VERSION_INT=50
 DIALOGX_STYLE_VERSION=5
 android.nonTransitiveRClass=true