Browse Source

0.0.39.beta5

kongzue 4 years ago
parent
commit
f743524b4a

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

@@ -79,7 +79,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().message = message;
         me().showType = -1;
-        if (dialogImpl != null) {
+        if (dialogImpl != null && dialogImpl.progressView != null) {
             dialogImpl.progressView.loading();
             setMessage(message);
             return me();
@@ -95,7 +95,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().message = message;
         me().showType = -1;
-        if (dialogImpl != null && dialogImpl.bkg.getContext() == activity) {
+        if (dialogImpl != null&& dialogImpl.progressView != null && dialogImpl.bkg.getContext() == activity) {
             dialogImpl.progressView.loading();
             setMessage(message);
             return me();
@@ -111,7 +111,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().preMessage(messageResId);
         me().showType = -1;
-        if (dialogImpl != null) {
+        if (dialogImpl != null&& dialogImpl.progressView != null) {
             dialogImpl.progressView.loading();
             setMessage(messageResId);
             return me();
@@ -127,7 +127,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().preMessage(messageResId);
         me().showType = -1;
-        if (dialogImpl != null && dialogImpl.bkg.getContext() == activity) {
+        if (dialogImpl != null&& dialogImpl.progressView != null && dialogImpl.bkg.getContext() == activity) {
             dialogImpl.progressView.loading();
             setMessage(messageResId);
             return me();
@@ -143,7 +143,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().showType = -1;
         me().preMessage(message);
-        if (dialogImpl != null) {
+        if (dialogImpl != null&& dialogImpl.progressView != null) {
             setMessage(message);
             me().setProgress(progress);
             return me();
@@ -160,7 +160,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().showType = -1;
         me().preMessage(message);
-        if (dialogImpl != null && dialogImpl.bkg.getContext() == activity) {
+        if (dialogImpl != null && dialogImpl.progressView != null&& dialogImpl.bkg.getContext() == activity) {
             setMessage(message);
             me().setProgress(progress);
             return me();
@@ -177,7 +177,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().showType = -1;
         me().preMessage(messageResId);
-        if (dialogImpl != null) {
+        if (dialogImpl != null&& dialogImpl.progressView != null) {
             setMessage(messageResId);
             me().setProgress(progress);
             return me();
@@ -194,7 +194,7 @@ public class WaitDialog extends BaseDialog {
         DialogImpl dialogImpl = me().dialogImpl;
         me().showType = -1;
         me().preMessage(messageResId);
-        if (dialogImpl != null && dialogImpl.bkg.getContext() == activity) {
+        if (dialogImpl != null&& dialogImpl.progressView != null && dialogImpl.bkg.getContext() == activity) {
             setMessage(messageResId);
             me().setProgress(progress);
             return me();
@@ -210,7 +210,7 @@ public class WaitDialog extends BaseDialog {
     public static WaitDialog show(Activity activity, float progress) {
         DialogImpl dialogImpl = me().dialogImpl;
         me().showType = -1;
-        if (dialogImpl != null && dialogImpl.bkg.getContext() == activity) {
+        if (dialogImpl != null&& dialogImpl.progressView != null && dialogImpl.bkg.getContext() == activity) {
             me().setProgress(progress);
             return me();
         } else {
@@ -224,7 +224,7 @@ public class WaitDialog extends BaseDialog {
     public static WaitDialog show(float progress) {
         DialogImpl dialogImpl = me().dialogImpl;
         me().showType = -1;
-        if (dialogImpl != null) {
+        if (dialogImpl != null&& dialogImpl.progressView != null) {
             me().setProgress(progress);
             return me();
         } else {
@@ -300,7 +300,7 @@ public class WaitDialog extends BaseDialog {
             this.layoutResId = layoutResId;
         }
         
-        public void lazyCreate(){
+        public void lazyCreate() {
             dialogView = createView(layoutResId);
             boxRoot = dialogView.findViewById(R.id.box_root);
             bkg = dialogView.findViewById(R.id.bkg);

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

@@ -298,7 +298,10 @@ public abstract class BaseDialog {
     }
     
     public static FrameLayout getRootFrameLayout() {
-        if (rootFrameLayout == null) return null;
+        if (rootFrameLayout == null) {
+            error("DialogX 未初始化。\n请检查是否在启动对话框前进行初始化操作,使用以下代码进行初始化:\nDialogX.init(context);\n\n另外建议您前往查看 DialogX 的文档进行使用:https://github.com/kongzue/DialogX");
+            return null;
+        }
         return rootFrameLayout.get();
     }
     

+ 3 - 3
app/build.gradle

@@ -31,9 +31,9 @@ dependencies {
     implementation 'androidx.appcompat:appcompat:1.2.0'
     implementation 'com.github.kongzue:BaseFramework:6.7.9.5'
 
-    implementation 'com.github.kongzue.DialogX:DialogXIOSStyle:0.0.39.beta4'
-    implementation 'com.github.kongzue.DialogX:DialogXKongzueStyle:0.0.39.beta4'
-    implementation 'com.github.kongzue.DialogX:DialogXMIUIStyle:0.0.39.beta4'
+    implementation 'com.github.kongzue.DialogX:DialogXIOSStyle:0.0.39.debug4'
+    implementation 'com.github.kongzue.DialogX:DialogXKongzueStyle:0.0.39.debug4'
+    implementation 'com.github.kongzue.DialogX:DialogXMIUIStyle:0.0.39.debug4'
 
     implementation 'com.github.kongzue:DialogXStyle-Snackbar:1.0.6'
     //implementation 'com.github.kongzue.dialogx:DialogX:0.0.37'

+ 1 - 1
gradle.properties

@@ -18,5 +18,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.39.debug4
+BUILD_VERSION=0.0.39.beta5
 BUILD_VERSION_INT=38