Browse Source

update 0.0.28 ver.

kongzue 4 years ago
parent
commit
10264499fd

+ 6 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -64,6 +64,7 @@ public class BottomDialog extends BaseDialog {
     protected OnDialogButtonClickListener<BottomDialog> cancelButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> cancelButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> okButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> okButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> otherButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> otherButtonClickListener;
+    protected BOOLEAN privateCancelable;
     
     
     protected TextInfo titleTextInfo;
     protected TextInfo titleTextInfo;
     protected TextInfo messageTextInfo;
     protected TextInfo messageTextInfo;
@@ -571,14 +572,17 @@ public class BottomDialog extends BaseDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;
     }
     }
     
     
     public BottomDialog setCancelable(boolean cancelable) {
     public BottomDialog setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
+        this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         refreshUI();
         return this;
         return this;
     }
     }

+ 5 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java

@@ -610,14 +610,17 @@ public class BottomMenu extends BottomDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;
     }
     }
     
     
     public BottomMenu setCancelable(boolean cancelable) {
     public BottomMenu setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
+        this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         refreshUI();
         return this;
         return this;
     }
     }

+ 6 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java

@@ -44,6 +44,7 @@ public class CustomDialog extends BaseDialog {
     protected boolean autoUnsafePlacePadding = true;
     protected boolean autoUnsafePlacePadding = true;
     private View dialogView;
     private View dialogView;
     protected int maskColor = Color.TRANSPARENT;
     protected int maskColor = Color.TRANSPARENT;
+    protected BOOLEAN privateCancelable;
     
     
     public enum ALIGN {
     public enum ALIGN {
         CENTER,
         CENTER,
@@ -277,14 +278,17 @@ public class CustomDialog extends BaseDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;
     }
     }
     
     
     public CustomDialog setCancelable(boolean cancelable) {
     public CustomDialog setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
+        this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         refreshUI();
         return this;
         return this;
     }
     }

+ 6 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -46,6 +46,7 @@ public class FullScreenDialog extends BaseDialog {
     
     
     public static BOOLEAN overrideCancelable;
     public static BOOLEAN overrideCancelable;
     protected OnBindView<FullScreenDialog> onBindView;
     protected OnBindView<FullScreenDialog> onBindView;
+    protected BOOLEAN privateCancelable;
     
     
     protected DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback;
     protected DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback;
     
     
@@ -289,14 +290,17 @@ public class FullScreenDialog extends BaseDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;
     }
     }
     
     
     public FullScreenDialog setCancelable(boolean cancelable) {
     public FullScreenDialog setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
+        this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         refreshUI();
         return this;
         return this;
     }
     }

+ 6 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java

@@ -428,14 +428,18 @@ public class InputDialog extends MessageDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;
     }
     }
     
     
     public InputDialog setCancelable(boolean cancelable) {
     public InputDialog setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
+        this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
+        refreshUI();
         return this;
         return this;
     }
     }
     
     

+ 6 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -52,6 +52,7 @@ public class MessageDialog extends BaseDialog {
     public static BOOLEAN overrideCancelable;
     public static BOOLEAN overrideCancelable;
     protected OnBindView<MessageDialog> onBindView;
     protected OnBindView<MessageDialog> onBindView;
     protected MessageDialog me = this;
     protected MessageDialog me = this;
+    protected BOOLEAN privateCancelable;
     
     
     private DialogLifecycleCallback<MessageDialog> dialogLifecycleCallback;
     private DialogLifecycleCallback<MessageDialog> dialogLifecycleCallback;
     
     
@@ -875,14 +876,17 @@ public class MessageDialog extends BaseDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;
     }
     }
     
     
     public MessageDialog setCancelable(boolean cancelable) {
     public MessageDialog setCancelable(boolean cancelable) {
-        this.cancelable = cancelable;
+        this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         refreshUI();
         return this;
         return this;
     }
     }

+ 5 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java

@@ -58,6 +58,7 @@ public class WaitDialog extends BaseDialog {
     protected int showType = -1;        //-1:Waitdialog 状态标示符,其余为 TipDialog 状态标示
     protected int showType = -1;        //-1:Waitdialog 状态标示符,其余为 TipDialog 状态标示
     protected TextInfo messageTextInfo;
     protected TextInfo messageTextInfo;
     protected int maskColor = -1;
     protected int maskColor = -1;
+    protected BOOLEAN privateCancelable;
     
     
     private DialogLifecycleCallback<WaitDialog> dialogLifecycleCallback;
     private DialogLifecycleCallback<WaitDialog> dialogLifecycleCallback;
     protected DialogLifecycleCallback<WaitDialog> tipDialogLifecycleCallback;
     protected DialogLifecycleCallback<WaitDialog> tipDialogLifecycleCallback;
@@ -448,7 +449,10 @@ public class WaitDialog extends BaseDialog {
     }
     }
     
     
     public boolean isCancelable() {
     public boolean isCancelable() {
-        if (overrideCancelable != null && overrideCancelable != BOOLEAN.NONE) {
+        if (privateCancelable != null) {
+            return privateCancelable == BOOLEAN.TRUE;
+        }
+        if (overrideCancelable != null) {
             return overrideCancelable == BOOLEAN.TRUE;
             return overrideCancelable == BOOLEAN.TRUE;
         }
         }
         return cancelable;
         return cancelable;

+ 1 - 1
DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java

@@ -241,6 +241,6 @@ public class BaseDialog {
     }
     }
     
     
     public enum BOOLEAN {
     public enum BOOLEAN {
-        NONE, TRUE, FALSE
+        TRUE, FALSE
     }
     }
 }
 }

+ 2 - 2
README.md

@@ -106,7 +106,7 @@ DialogX 采用了主题分离结构,主框架仅包含 Material 设计风格
 想要在您的项目引入 DialogX,您需要在 app 的 build.gradle 文件中找到 `dependencies{}` 代码块,并在其中加入以下语句:
 想要在您的项目引入 DialogX,您需要在 app 的 build.gradle 文件中找到 `dependencies{}` 代码块,并在其中加入以下语句:
 
 
 ```
 ```
-implementation 'com.kongzue.dialogx:DialogX:0.0.27'
+implementation 'com.kongzue.dialogx:DialogX:0.0.28'
 ```
 ```
 
 
 若有需要,也可以手动配置 Maven:
 若有需要,也可以手动配置 Maven:
@@ -115,7 +115,7 @@ implementation 'com.kongzue.dialogx:DialogX:0.0.27'
 <dependency>
 <dependency>
   <groupId>com.kongzue.dialogx</groupId>
   <groupId>com.kongzue.dialogx</groupId>
   <artifactId>DialogX</artifactId>
   <artifactId>DialogX</artifactId>
-  <version>0.0.27</version>
+  <version>0.0.28</version>
   <type>pom</type>
   <type>pom</type>
 </dependency>
 </dependency>
 ```
 ```

+ 2 - 2
app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java

@@ -231,7 +231,7 @@ public class MainActivity extends BaseActivity {
         btnMessageDialog.setOnClickListener(new View.OnClickListener() {
         btnMessageDialog.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View view) {
             public void onClick(View view) {
-                MessageDialog.show("自动切换回源输入法", "自动切换回源输入法自动切换回源输入法自动切换回源输入法自动切换回源输入法", "确定").setOkButton(new OnDialogButtonClickListener<MessageDialog>() {
+                MessageDialog.show("标题", "这里是正文内容。", "确定").setOkButton(new OnDialogButtonClickListener<MessageDialog>() {
                     @Override
                     @Override
                     public boolean onClick(MessageDialog baseDialog, View v) {
                     public boolean onClick(MessageDialog baseDialog, View v) {
                         PopTip.show("点击确定按钮");
                         PopTip.show("点击确定按钮");
@@ -373,7 +373,7 @@ public class MainActivity extends BaseActivity {
                 }, 3000);
                 }, 3000);
             }
             }
         });
         });
-        
+    
         btnBottomDialog.setOnClickListener(new View.OnClickListener() {
         btnBottomDialog.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             public void onClick(View v) {

+ 2 - 2
gradle.properties

@@ -18,5 +18,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 android.enableJetifier=true
 
 
-BUILD_VERSION=0.0.27
-BUILD_VERSION_INT=27
+BUILD_VERSION=0.0.28
+BUILD_VERSION_INT=28