kongzue преди 4 години
родител
ревизия
78eef192d0
променени са 35 файла, в които са добавени 1390 реда и са изтрити 261 реда
  1. 8 0
      .idea/compiler.xml
  2. 1 0
      .idea/gradle.xml
  3. 6 0
      .idea/vcs.xml
  4. 2 1
      DialogX/build.gradle
  5. BIN
      DialogX/libs/DialogXInterface.jar
  6. 83 10
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java
  7. 65 2
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java
  8. 47 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/TipDialog.java
  9. 310 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java
  10. 8 7
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java
  11. 20 0
      DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java
  12. 44 14
      DialogX/src/main/java/com/kongzue/dialogx/util/views/BlurView.java
  13. 11 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java
  14. 1 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java
  15. 467 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/ProgressView.java
  16. 69 0
      DialogX/src/main/res/layout/layout_dialogx_wait.xml
  17. 5 0
      DialogX/src/main/res/values/attrs.xml
  18. 2 0
      DialogX/src/main/res/values/colors.xml
  19. 1 1
      DialogXIOSStyle/build.gradle
  20. 0 66
      DialogXIOSStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  21. 20 1
      DialogXIOSStyle/src/main/java/com/kongzue/dialogx/style/IOSStyle.java
  22. 2 2
      DialogXIOSStyle/src/main/res/values/colors.xml
  23. 1 0
      DialogXInterface/.gitignore
  24. 8 0
      DialogXInterface/build.gradle
  25. 12 8
      DialogXInterface/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  26. 1 1
      DialogXKongzueStyle/build.gradle
  27. 0 66
      DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  28. 20 0
      DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/style/KongzueStyle.java
  29. 1 7
      DialogXMIUIStyle/build.gradle
  30. 0 66
      DialogXMIUIStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  31. 20 0
      DialogXMIUIStyle/src/main/java/com/kongzue/dialogx/style/MIUIStyle.java
  32. 1 1
      README.md
  33. 91 4
      app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java
  34. 62 4
      app/src/main/res/layout/activity_main.xml
  35. 1 0
      settings.gradle

+ 8 - 0
.idea/compiler.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel>
+      <module name="DialogXInterface" target="1.7" />
+    </bytecodeTargetLevel>
+  </component>
+</project>

+ 1 - 0
.idea/gradle.xml

@@ -13,6 +13,7 @@
             <option value="$PROJECT_DIR$" />
             <option value="$PROJECT_DIR$/DialogX" />
             <option value="$PROJECT_DIR$/DialogXIOSStyle" />
+            <option value="$PROJECT_DIR$/DialogXInterface" />
             <option value="$PROJECT_DIR$/DialogXKongzueStyle" />
             <option value="$PROJECT_DIR$/DialogXMIUIStyle" />
             <option value="$PROJECT_DIR$/app" />

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>

+ 2 - 1
DialogX/build.gradle

@@ -25,5 +25,6 @@ android {
 
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
-    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'androidx.appcompat:appcompat:1.2.0+'
+    api files('libs\\DialogXInterface.jar')
 }

BIN
DialogX/libs/DialogXInterface.jar


+ 83 - 10
DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java

@@ -1,7 +1,7 @@
 package com.kongzue.dialogx.dialogs;
 
 import com.kongzue.dialogx.interfaces.OnBackPressedListener;
-import com.kongzue.dialogx.interfaces.OnDialogButtonClickListener;
+import com.kongzue.dialogx.interfaces.OnInputDialogButtonClickListener;
 import com.kongzue.dialogx.interfaces.OnInputDialogButtonClickListener;
 import com.kongzue.dialogx.util.InputInfo;
 import com.kongzue.dialogx.util.TextInfo;
@@ -19,12 +19,22 @@ public class InputDialog extends MessageDialog {
         me = this;
     }
     
+    public static InputDialog build() {
+        return new InputDialog();
+    }
+    
     public InputDialog(CharSequence title, CharSequence message, CharSequence okText) {
         this.title = title;
         this.message = message;
         this.okText = okText;
     }
     
+    public static InputDialog show(CharSequence title, CharSequence message, CharSequence okText) {
+        InputDialog inputDialog = new InputDialog(title, message, okText);
+        inputDialog.show();
+        return inputDialog;
+    }
+    
     public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
         this.title = title;
         this.message = message;
@@ -32,6 +42,12 @@ public class InputDialog extends MessageDialog {
         this.cancelText = cancelText;
     }
     
+    public static InputDialog show(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
+        InputDialog inputDialog = new InputDialog(title, message, okText, cancelText);
+        inputDialog.show();
+        return inputDialog;
+    }
+    
     public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, String inputText) {
         this.title = title;
         this.message = message;
@@ -40,6 +56,12 @@ public class InputDialog extends MessageDialog {
         this.inputText = inputText;
     }
     
+    public static InputDialog show(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, String inputText) {
+        InputDialog inputDialog = new InputDialog(title, message, okText, cancelText, inputText);
+        inputDialog.show();
+        return inputDialog;
+    }
+    
     public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText) {
         this.title = title;
         this.message = message;
@@ -48,6 +70,12 @@ public class InputDialog extends MessageDialog {
         this.otherText = otherText;
     }
     
+    public static InputDialog show(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText) {
+        InputDialog inputDialog = new InputDialog(title, message, okText, cancelText, otherText);
+        inputDialog.show();
+        return inputDialog;
+    }
+    
     public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText, String inputText) {
         this.title = title;
         this.message = message;
@@ -57,6 +85,12 @@ public class InputDialog extends MessageDialog {
         this.inputText = inputText;
     }
     
+    public static InputDialog show(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText, String inputText) {
+        InputDialog inputDialog = new InputDialog(title, message, okText, cancelText, otherText, inputText);
+        inputDialog.show();
+        return inputDialog;
+    }
+    
     public CharSequence getOkButton() {
         return okText;
     }
@@ -67,6 +101,19 @@ public class InputDialog extends MessageDialog {
         return this;
     }
     
+    public InputDialog setOkButton(OnInputDialogButtonClickListener okButtonClickListener) {
+        this.okButtonClickListener = okButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public InputDialog setOkButton(CharSequence okText, OnInputDialogButtonClickListener okButtonClickListener) {
+        this.okText = okText;
+        this.okButtonClickListener = okButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
     public CharSequence getCancelButton() {
         return cancelText;
     }
@@ -77,6 +124,19 @@ public class InputDialog extends MessageDialog {
         return this;
     }
     
+    public InputDialog setCancelButton(OnInputDialogButtonClickListener cancelButtonClickListener) {
+        this.cancelButtonClickListener = cancelButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public InputDialog setCancelButton(CharSequence cancelText, OnInputDialogButtonClickListener cancelButtonClickListener) {
+        this.cancelText = cancelText;
+        this.cancelButtonClickListener = cancelButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
     public CharSequence getOtherButton() {
         return otherText;
     }
@@ -87,31 +147,44 @@ public class InputDialog extends MessageDialog {
         return this;
     }
     
-    public OnDialogButtonClickListener getOkButtonClickListener() {
-        return okButtonClickListener;
+    public InputDialog setOtherButton(OnInputDialogButtonClickListener otherButtonClickListener) {
+        this.otherButtonClickListener = otherButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public InputDialog setOtherButton(CharSequence otherText, OnInputDialogButtonClickListener otherButtonClickListener) {
+        this.otherText = otherText;
+        this.otherButtonClickListener = otherButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public OnInputDialogButtonClickListener getOkButtonClickListener() {
+        return (OnInputDialogButtonClickListener) okButtonClickListener;
     }
     
-    public InputDialog setOkButtonClickListener(OnDialogButtonClickListener okButtonClickListener) {
+    public InputDialog setOkButtonClickListener(OnInputDialogButtonClickListener okButtonClickListener) {
         this.okButtonClickListener = okButtonClickListener;
         refreshUI();
         return this;
     }
     
-    public OnDialogButtonClickListener getCancelButtonClickListener() {
-        return cancelButtonClickListener;
+    public OnInputDialogButtonClickListener getCancelButtonClickListener() {
+        return (OnInputDialogButtonClickListener) cancelButtonClickListener;
     }
     
-    public InputDialog setCancelButtonClickListener(OnDialogButtonClickListener cancelButtonClickListener) {
+    public InputDialog setCancelButtonClickListener(OnInputDialogButtonClickListener cancelButtonClickListener) {
         this.cancelButtonClickListener = cancelButtonClickListener;
         refreshUI();
         return this;
     }
     
-    public OnDialogButtonClickListener getOtherButtonClickListener() {
-        return otherButtonClickListener;
+    public OnInputDialogButtonClickListener getOtherButtonClickListener() {
+        return (OnInputDialogButtonClickListener) otherButtonClickListener;
     }
     
-    public InputDialog setOtherButtonClickListener(OnDialogButtonClickListener otherButtonClickListener) {
+    public InputDialog setOtherButtonClickListener(OnInputDialogButtonClickListener otherButtonClickListener) {
         this.otherButtonClickListener = otherButtonClickListener;
         refreshUI();
         return this;

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

@@ -72,12 +72,22 @@ public class MessageDialog extends BaseDialog {
     
     protected int buttonOrientation;
     
+    public static MessageDialog build() {
+        return new MessageDialog();
+    }
+    
     public MessageDialog(CharSequence title, CharSequence message, CharSequence okText) {
         this.title = title;
         this.message = message;
         this.okText = okText;
     }
     
+    public static MessageDialog show(CharSequence title, CharSequence message, CharSequence okText) {
+        MessageDialog messageDialog = new MessageDialog(title, message, okText);
+        messageDialog.show();
+        return messageDialog;
+    }
+    
     public MessageDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
         this.title = title;
         this.message = message;
@@ -85,6 +95,12 @@ public class MessageDialog extends BaseDialog {
         this.cancelText = cancelText;
     }
     
+    public static MessageDialog show(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
+        MessageDialog messageDialog = new MessageDialog(title, message, okText, cancelText);
+        messageDialog.show();
+        return messageDialog;
+    }
+    
     public MessageDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText) {
         this.title = title;
         this.message = message;
@@ -93,6 +109,12 @@ public class MessageDialog extends BaseDialog {
         this.otherText = otherText;
     }
     
+    public static MessageDialog show(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText) {
+        MessageDialog messageDialog = new MessageDialog(title, message, okText, cancelText, otherText);
+        messageDialog.show();
+        return messageDialog;
+    }
+    
     protected DialogImpl dialogImpl;
     
     public void show() {
@@ -391,7 +413,7 @@ public class MessageDialog extends BaseDialog {
                     return false;
                 }
             });
-            btnSelectNegative.setOnClickListener(new View.OnClickListener() {
+            btnSelectPositive.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
                     if (okButtonClickListener != null) {
@@ -410,7 +432,7 @@ public class MessageDialog extends BaseDialog {
                     }
                 }
             });
-            btnSelectPositive.setOnClickListener(new View.OnClickListener() {
+            btnSelectNegative.setOnClickListener(new View.OnClickListener() {
                 @Override
                 public void onClick(View v) {
                     if (cancelButtonClickListener != null) {
@@ -503,6 +525,19 @@ public class MessageDialog extends BaseDialog {
         return this;
     }
     
+    public MessageDialog setOkButton(OnDialogButtonClickListener okButtonClickListener) {
+        this.okButtonClickListener = okButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public MessageDialog setOkButton(CharSequence okText, OnDialogButtonClickListener okButtonClickListener) {
+        this.okText = okText;
+        this.okButtonClickListener = okButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
     public CharSequence getCancelButton() {
         return cancelText;
     }
@@ -513,6 +548,19 @@ public class MessageDialog extends BaseDialog {
         return this;
     }
     
+    public MessageDialog setCancelButton(OnDialogButtonClickListener cancelButtonClickListener) {
+        this.cancelButtonClickListener = cancelButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public MessageDialog setCancelButton(CharSequence cancelText, OnDialogButtonClickListener cancelButtonClickListener) {
+        this.cancelText = cancelText;
+        this.cancelButtonClickListener = cancelButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
     public CharSequence getOtherButton() {
         return otherText;
     }
@@ -523,6 +571,19 @@ public class MessageDialog extends BaseDialog {
         return this;
     }
     
+    public MessageDialog setOtherButton(OnDialogButtonClickListener otherButtonClickListener) {
+        this.otherButtonClickListener = otherButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public MessageDialog setOtherButton(CharSequence otherText, OnDialogButtonClickListener otherButtonClickListener) {
+        this.otherText = otherText;
+        this.otherButtonClickListener = otherButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
     public OnDialogButtonClickListener getOkButtonClickListener() {
         return okButtonClickListener;
     }
@@ -639,6 +700,7 @@ public class MessageDialog extends BaseDialog {
     
     public MessageDialog setCancelable(boolean cancelable) {
         this.cancelable = cancelable;
+        refreshUI();
         return this;
     }
     
@@ -648,6 +710,7 @@ public class MessageDialog extends BaseDialog {
     
     public MessageDialog setOnBackPressedListener(OnBackPressedListener onBackPressedListener) {
         this.onBackPressedListener = onBackPressedListener;
+        refreshUI();
         return this;
     }
 }

+ 47 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/TipDialog.java

@@ -0,0 +1,47 @@
+package com.kongzue.dialogx.dialogs;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/28 23:53
+ */
+public class TipDialog extends WaitDialog {
+    
+    public static TipDialog show(CharSequence message) {
+        TipDialog tipDialog = new TipDialog();
+        tipDialog.message = message;
+        tipDialog.show();
+        return tipDialog;
+    }
+    
+    private TipDialog() {
+        super();
+    }
+    
+    public static WaitDialog show(CharSequence message, TYPE tip) {
+        DialogImpl dialogImpl = me().dialogImpl;
+        me().message = message;
+        if (dialogImpl != null) {
+            dialogImpl.showTip(tip);
+        } else {
+            me().showTip(message, tip);
+        }
+        return me();
+    }
+    
+    public static WaitDialog show(CharSequence message, TYPE tip, long duration) {
+        DialogImpl dialogImpl = me().dialogImpl;
+        me().message = message;
+        me().tipShowDuration = duration;
+        if (dialogImpl != null) {
+            dialogImpl.showTip(tip);
+        } else {
+            me().showTip(message, tip);
+        }
+        return me();
+    }
+}

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

@@ -0,0 +1,310 @@
+package com.kongzue.dialogx.dialogs;
+
+import android.animation.Animator;
+import android.graphics.Color;
+import android.view.View;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.DecelerateInterpolator;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.kongzue.dialogx.R;
+import com.kongzue.dialogx.impl.AnimatorListenerEndCallBack;
+import com.kongzue.dialogx.interfaces.BaseDialog;
+import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
+import com.kongzue.dialogx.util.views.BlurView;
+import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
+import com.kongzue.dialogx.util.views.MaxRelativeLayout;
+import com.kongzue.dialogx.util.views.ProgressView;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/27 14:50
+ */
+public class WaitDialog extends BaseDialog {
+    
+    public enum TYPE {
+        NONE,
+        SUCCESS,
+        WARNING,
+        ERROR
+    }
+    
+    protected static WeakReference<WaitDialog> me;
+    protected CharSequence message;
+    protected long tipShowDuration = 1500;
+    protected float waitProgress = -1;
+    
+    private DialogLifecycleCallback<WaitDialog> dialogLifecycleCallback;
+    
+    protected WaitDialog() {
+        me = new WeakReference<>(this);
+    }
+    
+    public static WaitDialog show(CharSequence message) {
+        DialogImpl dialogImpl = me().dialogImpl;
+        me().message = message;
+        if (dialogImpl != null) {
+            setMessage(message);
+            return me();
+        } else {
+            WaitDialog waitDialog = new WaitDialog();
+            waitDialog.message = message;
+            waitDialog.show();
+            return waitDialog;
+        }
+    }
+    
+    public static WaitDialog show(CharSequence message,float progress) {
+        DialogImpl dialogImpl = me().dialogImpl;
+        me().message = message;
+        if (dialogImpl != null) {
+            setMessage(message);
+            me().setProgress(progress);
+            return me();
+        } else {
+            WaitDialog waitDialog = new WaitDialog();
+            waitDialog.message = message;
+            waitDialog.show();
+            waitDialog.setProgress(progress);
+            return waitDialog;
+        }
+    }
+    
+    public static WaitDialog show(float progress) {
+        DialogImpl dialogImpl = me().dialogImpl;
+        if (dialogImpl != null) {
+            me().setProgress(progress);
+            return me();
+        } else {
+            WaitDialog waitDialog = new WaitDialog();
+            waitDialog.show();
+            waitDialog.setProgress(progress);
+            return waitDialog;
+        }
+    }
+    
+    public float getProgress() {
+        return waitProgress;
+    }
+    
+    public WaitDialog setProgress(float waitProgress) {
+        this.waitProgress = waitProgress;
+        refreshUI();
+        return this;
+    }
+    
+    private View dialogView;
+    
+    public WaitDialog show() {
+        dialogView = createView(R.layout.layout_dialogx_wait);
+        dialogImpl = new DialogImpl(dialogView);
+        show(dialogView);
+        return this;
+    }
+    
+    protected DialogImpl dialogImpl;
+    
+    class DialogImpl {
+        DialogXBaseRelativeLayout boxRoot;
+        MaxRelativeLayout bkg;
+        BlurView blurView;
+        RelativeLayout boxProgress;
+        ProgressView progressView;
+        RelativeLayout boxCustomView;
+        TextView txtInfo;
+        
+        public DialogImpl(View convertView) {
+            boxRoot = convertView.findViewById(R.id.box_root);
+            bkg = convertView.findViewById(R.id.bkg);
+            blurView = convertView.findViewById(R.id.blurView);
+            boxProgress = convertView.findViewById(R.id.box_progress);
+            progressView = convertView.findViewById(R.id.progressView);
+            boxCustomView = convertView.findViewById(R.id.box_customView);
+            txtInfo = convertView.findViewById(R.id.txt_info);
+            init();
+            refreshView();
+        }
+        
+        private void init() {
+            blurView.setRadiusPx(dip2px(15));
+            boxRoot.setClickable(true);
+            //txtInfo.getPaint().setFakeBoldText(true);
+            
+            boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
+                @Override
+                public void onShow() {
+                    isShow = true;
+                    boxRoot.setAlpha(0f);
+                    bkg.post(new Runnable() {
+                        @Override
+                        public void run() {
+                            int enterAnimResId = R.anim.anim_dialogx_default_enter;
+                            Animation enterAnim = AnimationUtils.loadAnimation(getContext(), enterAnimResId);
+                            enterAnim.setInterpolator(new DecelerateInterpolator());
+                            bkg.startAnimation(enterAnim);
+                            
+                            boxRoot.animate().setDuration(enterAnim.getDuration()).alpha(1f).setInterpolator(new DecelerateInterpolator()).setDuration(300).setListener(null);
+                            
+                            getDialogLifecycleCallback().onShow(me());
+                        }
+                    });
+                }
+                
+                @Override
+                public void onDismiss() {
+                    isShow = false;
+                    dialogImpl = null;
+                    getDialogLifecycleCallback().onDismiss(me());
+                    me.clear();
+                }
+            });
+            
+            if (readyTipType != null) {
+                progressView.noLoading();
+                progressView.postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        showTip(readyTipType);
+                    }
+                }, 100);
+            }
+        }
+        
+        private float oldProgress;
+        
+        private void refreshView() {
+            if (style.overrideWaitTipRes() != null) {
+                int overrideBackgroundColorRes = style.overrideWaitTipRes().overrideBackgroundColorRes(isLightTheme());
+                if (overrideBackgroundColorRes == 0) {
+                    overrideBackgroundColorRes = isLightTheme() ? R.color.dialogxWaitBkgDark : R.color.dialogxWaitBkgLight;
+                }
+                blurView.setOverlayColor(getResources().getColor(overrideBackgroundColorRes));
+                int overrideTextColorRes = style.overrideWaitTipRes().overrideTextColorRes(isLightTheme());
+                if (overrideTextColorRes == 0) {
+                    overrideTextColorRes = isLightTheme() ? R.color.white : R.color.black;
+                }
+                txtInfo.setTextColor(getResources().getColor(overrideTextColorRes));
+                progressView.setColor(getResources().getColor(overrideTextColorRes));
+                blurView.setUseBlur(style.overrideWaitTipRes().blurBackground());
+            } else {
+                if (isLightTheme()) {
+                    blurView.setOverlayColor(getResources().getColor(R.color.dialogxWaitBkgDark));
+                    progressView.setColor(Color.WHITE);
+                    txtInfo.setTextColor(Color.WHITE);
+                } else {
+                    blurView.setOverlayColor(getResources().getColor(R.color.dialogxWaitBkgLight));
+                    progressView.setColor(Color.BLACK);
+                    txtInfo.setTextColor(Color.BLACK);
+                }
+            }
+            
+            if (waitProgress >= 0 && waitProgress <= 1 && oldProgress != waitProgress) {
+                progressView.progress(waitProgress);
+                oldProgress = waitProgress;
+            }
+            
+            showText(txtInfo, message);
+        }
+        
+        public void doDismiss(View v) {
+            if (v != null) v.setEnabled(false);
+            
+            int exitAnimResId = R.anim.anim_dialogx_default_exit;
+            Animation enterAnim = AnimationUtils.loadAnimation(getContext(), exitAnimResId);
+            enterAnim.setInterpolator(new AccelerateInterpolator());
+            bkg.startAnimation(enterAnim);
+            
+            boxRoot.animate().setDuration(300).alpha(0f).setInterpolator(new AccelerateInterpolator()).setDuration(enterAnim.getDuration()).setListener(new AnimatorListenerEndCallBack() {
+                @Override
+                public void onAnimationEnd(Animator animation) {
+                    dismiss(dialogView);
+                }
+            });
+        }
+        
+        public void showTip(TYPE tip) {
+            if (progressView == null) return;
+            switch (tip) {
+                case NONE:
+                    progressView.loading();
+                    return;
+                case SUCCESS:
+                    progressView.success();
+                    break;
+                case WARNING:
+                    progressView.warning();
+                    break;
+                case ERROR:
+                    progressView.error();
+                    break;
+            }
+            progressView.whenShowTick(new Runnable() {
+                @Override
+                public void run() {
+                    refreshView();
+                    progressView.postDelayed(new Runnable() {
+                        @Override
+                        public void run() {
+                            doDismiss(null);
+                        }
+                    }, tipShowDuration);
+                }
+            });
+        }
+    }
+    
+    public void refreshUI() {
+        if (dialogImpl == null) return;
+        dialogImpl.refreshView();
+    }
+    
+    public void doDismiss() {
+        if (dialogImpl == null) return;
+        dialogImpl.doDismiss(null);
+    }
+    
+    public static void dismiss() {
+        me().doDismiss();
+    }
+    
+    protected static WaitDialog me() {
+        if (me == null || me.get() == null) me = new WeakReference<>(new WaitDialog());
+        return me.get();
+    }
+    
+    protected TYPE readyTipType;
+    
+    protected void showTip(CharSequence message, TYPE type) {
+        this.message = message;
+        readyTipType = type;
+        show();
+    }
+    
+    public static CharSequence getMessage() {
+        return me().message;
+    }
+    
+    public static WaitDialog setMessage(CharSequence message) {
+        me().message = message;
+        me().refreshUI();
+        return me();
+    }
+    
+    public DialogLifecycleCallback<WaitDialog> getDialogLifecycleCallback() {
+        return dialogLifecycleCallback == null ? new DialogLifecycleCallback<WaitDialog>() {
+        } : dialogLifecycleCallback;
+    }
+    
+    public WaitDialog setDialogLifecycleCallback(DialogLifecycleCallback<WaitDialog> dialogLifecycleCallback) {
+        this.dialogLifecycleCallback = dialogLifecycleCallback;
+        return this;
+    }
+}

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

@@ -31,14 +31,14 @@ import static com.kongzue.dialogx.DialogX.DEBUGMODE;
 public class BaseDialog {
     
     private static WeakReference<FrameLayout> rootFrameLayout;
-    private static WeakReference<Context> applicationContextWeakReference;
+    private static WeakReference<Activity> contextWeakReference;
     
     public static void init(Context context) {
-        applicationContextWeakReference = new WeakReference<>(context.getApplicationContext());
         ActivityLifecycleImpl.init(context, new ActivityLifecycleImpl.onActivityResumeCallBack() {
             @Override
             public void getActivity(Activity activity) {
                 try {
+                    contextWeakReference = new WeakReference<>(activity);
                     rootFrameLayout = new WeakReference<>((FrameLayout) activity.getWindow().getDecorView().findViewById(android.R.id.content));
                 } catch (Exception e) {
                     error("DialogX.init: 初始化异常,找不到Activity的根布局");
@@ -68,8 +68,8 @@ public class BaseDialog {
     }
     
     public static Context getContext() {
-        if (applicationContextWeakReference == null) return null;
-        return applicationContextWeakReference.get();
+        if (contextWeakReference == null) return null;
+        return contextWeakReference.get();
     }
     
     protected boolean cancelable = true;
@@ -82,7 +82,7 @@ public class BaseDialog {
     public BaseDialog() {
         style = DialogX.globalStyle;
         theme = DialogX.globalTheme;
-        autoShowInputKeyboard=  DialogX.autoShowInputKeyboard;
+        autoShowInputKeyboard = DialogX.autoShowInputKeyboard;
     }
     
     public View createView(int layoutId) {
@@ -135,7 +135,7 @@ public class BaseDialog {
         return splitView;
     }
     
-    protected View createVerticalSplitView(int color,int height) {
+    protected View createVerticalSplitView(int color, int height) {
         View splitView = new View(getContext());
         splitView.setBackgroundColor(color);
         LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(1, dip2px(height));
@@ -168,11 +168,12 @@ public class BaseDialog {
         return (int) (dpValue * scale + 0.5f);
     }
     
-    public boolean isLightTheme(){
+    public boolean isLightTheme() {
         return theme == DialogX.THEME.LIGHT;
     }
     
     public static FrameLayout getRootFrameLayout() {
+        if (rootFrameLayout == null) return null;
         return rootFrameLayout.get();
     }
 }

+ 20 - 0
DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java

@@ -98,4 +98,24 @@ public class MaterialStyle implements DialogXStyle {
             }
         };
     }
+    
+    @Override
+    public WaitTipRes overrideWaitTipRes() {
+        return new WaitTipRes() {
+            @Override
+            public boolean blurBackground() {
+                return false;
+            }
+            
+            @Override
+            public int overrideBackgroundColorRes(boolean light) {
+                return 0;
+            }
+            
+            @Override
+            public int overrideTextColorRes(boolean light) {
+                return light ? R.color.white : R.color.black;
+            }
+        };
+    }
 }

+ 44 - 14
DialogX/src/main/java/com/kongzue/dialogx/util/views/BlurView.java

@@ -28,8 +28,6 @@ import com.kongzue.dialogx.DialogX;
 import com.kongzue.dialogx.R;
 import com.kongzue.dialogx.interfaces.BaseDialog;
 
-import static com.kongzue.dialogx.DialogX.DEBUGMODE;
-
 public class BlurView extends View {
     private float mDownsampleFactor; // default 4
     private int mOverlayColor; // default #aaffffff
@@ -169,7 +167,7 @@ public class BlurView extends View {
         float downsampleFactor = mDownsampleFactor;
         
         if (mDirty || mRenderScript == null) {
-            if (supportRenderScript) {
+            if (supportRenderScript && useBlur) {
                 if (mRenderScript == null) {
                     try {
                         mRenderScript = RenderScript.create(getContext());
@@ -242,6 +240,7 @@ public class BlurView extends View {
     private final ViewTreeObserver.OnPreDrawListener preDrawListener = new ViewTreeObserver.OnPreDrawListener() {
         @Override
         public boolean onPreDraw() {
+            clean();
             final int[] locations = new int[2];
             Bitmap oldBmp = mBlurredBitmap;
             View decor = mDecorView;
@@ -279,6 +278,7 @@ public class BlurView extends View {
                 
                 blur(mBitmapToBlur, mBlurredBitmap);
                 
+                cleanFlag = false;
                 if (redrawBitmap || mDifferentRoot) {
                     invalidate();
                 }
@@ -303,7 +303,7 @@ public class BlurView extends View {
     @Override
     protected void onAttachedToWindow() {
         super.onAttachedToWindow();
-        mDecorView = BaseDialog.getRootFrameLayout();
+        mDecorView = ((Activity) BaseDialog.getContext()).getWindow().getDecorView();
         if (mDecorView != null) {
             mDecorView.getViewTreeObserver().addOnPreDrawListener(preDrawListener);
             mDifferentRoot = mDecorView.getRootView() != getRootView();
@@ -326,20 +326,41 @@ public class BlurView extends View {
     
     @Override
     public void draw(Canvas canvas) {
-        if (mIsRendering) {
-            // Quit here, don't draw views above me
-            //throw STOP_EXCEPTION;
-        } else if (RENDERING_COUNT > 0) {
-            // Doesn't support blurview overlap on another blurview
+        if (!useBlur) {
+            Paint cutPaint = new Paint();
+            cutPaint.setAntiAlias(true);
+            cutPaint.setColor(removeAlphaColor(mOverlayColor));
+            mRectF.right = getWidth();
+            mRectF.bottom = getHeight();
+            canvas.drawRoundRect(mRectF, mXRadius, mYRadius, cutPaint);
         } else {
-            super.draw(canvas);
+            if (mIsRendering) {
+                // Quit here, don't draw views above me
+                //throw STOP_EXCEPTION;
+            } else if (RENDERING_COUNT > 0) {
+                // Doesn't support blurview overlap on another blurview
+            } else {
+                super.draw(canvas);
+            }
         }
+        
+    }
+    
+    private boolean cleanFlag = false;
+    
+    private void clean() {
+        cleanFlag = true;
+        invalidate();
     }
     
     @Override
     protected void onDraw(Canvas canvas) {
         super.onDraw(canvas);
-        drawBlurredBitmap(canvas, mBlurredBitmap, mOverlayColor);
+        if (cleanFlag) {
+            canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
+        } else {
+            drawBlurredBitmap(canvas, mBlurredBitmap, mOverlayColor);
+        }
     }
     
     /**
@@ -360,7 +381,7 @@ public class BlurView extends View {
                 mRectDst.bottom = getHeight();
                 cacheCanvas.drawBitmap(blurredBitmap, mRectSrc, mRectDst, null);
             }
-            cacheCanvas.drawColor(supportRenderScript ? overlayColor : removeAlphaColor(overlayColor));
+            cacheCanvas.drawColor((supportRenderScript && useBlur) ? overlayColor : removeAlphaColor(overlayColor));
             
             //Rounded corner
             mRectF.right = getWidth();
@@ -385,6 +406,17 @@ public class BlurView extends View {
     }
     
     private static boolean supportRenderScript = false;
+    private boolean useBlur = true;
+    
+    public boolean isUseBlur() {
+        return useBlur;
+    }
+    
+    public BlurView setUseBlur(boolean useBlur) {
+        this.useBlur = useBlur;
+        invalidate();
+        return this;
+    }
     
     private static int removeAlphaColor(@ColorInt int color) {
         int alpha = 255;
@@ -407,8 +439,6 @@ public class BlurView extends View {
                     BlurView.class.getClassLoader().loadClass(RenderScript.class.getCanonicalName());
                     supportRenderScript = true;
                 } catch (Throwable e) {
-                    error("\n错误!\nRenderScript支持库未启用,要启用模糊效果,请在您的app的Gradle配置文件中添加以下语句:" +
-                            "\nandroid { \n...\n  defaultConfig { \n    ...\n    renderscriptTargetApi 17 \n    renderscriptSupportModeEnabled true \n  }\n}");
                     supportRenderScript = false;
                 }
             }

+ 11 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java

@@ -1,6 +1,8 @@
 package com.kongzue.dialogx.util.views;
 
 import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Rect;
 import android.os.Build;
 import android.util.AttributeSet;
 import android.util.Log;
@@ -52,6 +54,9 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
     private void init() {
         setFocusableInTouchMode(true);
         requestFocus();
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && getRootWindowInsets()!=null) {
+            onApplyWindowInsets(getRootWindowInsets());
+        }
     }
     
     @Override
@@ -118,6 +123,12 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
         setPadding(left, top, right, bottom);
     }
     
+    @Override
+    protected boolean fitSystemWindows(Rect insets) {
+        paddingView(insets.left,insets.top,insets.right,insets.bottom);
+        return true;
+    }
+    
     @Override
     public WindowInsets onApplyWindowInsets(WindowInsets windowInsets) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {

+ 1 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java

@@ -2,6 +2,7 @@ package com.kongzue.dialogx.util.views;
 
 import android.content.Context;
 import android.content.res.TypedArray;
+import android.graphics.Canvas;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.View;

+ 467 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/ProgressView.java

@@ -0,0 +1,467 @@
+package com.kongzue.dialogx.util.views;
+
+import android.animation.TimeInterpolator;
+import android.animation.ValueAnimator;
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.RectF;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.HapticFeedbackConstants;
+import android.view.View;
+import android.view.animation.AccelerateDecelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
+import android.view.animation.LinearInterpolator;
+
+import androidx.annotation.Nullable;
+
+import com.kongzue.dialogx.R;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/27 16:16
+ * @license: Apache License 2.0
+ */
+public class ProgressView extends View {
+    
+    public static final int STATUS_LOADING = 0;
+    public static final int STATUS_SUCCESS = 1;
+    public static final int STATUS_WARNING = 2;
+    public static final int STATUS_ERROR = 3;
+    public static final int STATUS_PROGRESSING = 4;
+    
+    private int status = STATUS_LOADING;
+    
+    private int width = 5;
+    private int color = Color.WHITE;
+    
+    public ProgressView(Context context) {
+        super(context);
+        init(null);
+    }
+    
+    public ProgressView(Context context, @Nullable AttributeSet attrs) {
+        super(context, attrs);
+        init(attrs);
+    }
+    
+    public ProgressView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init(attrs);
+    }
+    
+    public ProgressView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+        init(attrs);
+    }
+    
+    private ValueAnimator rotateAnimator;
+    private ValueAnimator followAnimator;
+    
+    private float currentRotateDegrees;
+    private float followRotateDegrees;
+    
+    //跟随点度数做正弦值变化,halfSweepAMinValue为最低相较目标点度数差值,halfSweepAMaxValue为最大相较目标点度数差值
+    private float halfSweepAMaxValue = 180;
+    private float halfSweepAMinValue = 80;
+    //正弦函数的半径
+    private float halfSweepA;
+    
+    Paint mPaint = new Paint();
+    
+    private boolean isInited = false;
+    
+    private void init(AttributeSet attrs) {
+        synchronized (ProgressView.class) {
+            if (isInited) {
+                return;
+            }
+            isInited = true;
+            if (attrs != null) {
+                TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.ProgressView);
+                width = a.getDimensionPixelSize(R.styleable.ProgressView_progressStrokeWidth, 5);
+                color = a.getDimensionPixelSize(R.styleable.ProgressView_progressStrokeColor, color);
+                
+                a.recycle();
+            }
+            
+            mPaint.setAntiAlias(true);
+            mPaint.setStyle(Paint.Style.STROKE);
+            mPaint.setStrokeWidth(width);
+            mPaint.setStrokeCap(Paint.Cap.ROUND);
+            mPaint.setColor(color);
+            
+            if (!isInEditMode()) {
+                halfSweepA = (halfSweepAMaxValue - halfSweepAMinValue) / 2;
+                
+                rotateAnimator = ValueAnimator.ofFloat(0, 365);
+                rotateAnimator.setDuration(1000);
+                rotateAnimator.setInterpolator(new LinearInterpolator());
+                rotateAnimator.setRepeatCount(-1);
+                rotateAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                    @Override
+                    public void onAnimationUpdate(ValueAnimator animation) {
+                        currentRotateDegrees = (float) animation.getAnimatedValue();
+                        invalidate();
+                    }
+                });
+                
+                followAnimator = ValueAnimator.ofFloat(0, 365);
+                followAnimator.setDuration(1500);
+                followAnimator.setInterpolator(new LinearInterpolator());
+                followAnimator.setRepeatCount(-1);
+                followAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                    @Override
+                    public void onAnimationUpdate(ValueAnimator animation) {
+                        followRotateDegrees = (float) animation.getAnimatedValue();
+                    }
+                });
+                
+                followAnimator.start();
+                rotateAnimator.start();
+            }
+        }
+    }
+    
+    //旋转圆的中心坐标
+    private float mCenterX;
+    private float mCenterY;
+    //半径
+    private float mRadius = 100;
+    private RectF oval;
+    
+    @Override
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        super.onSizeChanged(w, h, oldw, oldh);
+        mCenterX = w * 1f / 2;
+        mCenterY = h * 1f / 2;
+        mRadius = Math.min(getWidth(), getHeight()) / 2 - width / 2;
+        oval = new RectF(mCenterX - mRadius, mCenterY - mRadius, mCenterX + mRadius, mCenterY + mRadius);
+    }
+    
+    protected float oldAnimAngle;
+    private int successStep = 0;
+    
+    @Override
+    protected void onDraw(Canvas canvas) {
+        if (isInEditMode()) {
+            canvas.drawArc(oval, 0, 365, false, mPaint);
+            return;
+        }
+        if (noShowLoading) {
+            canvas.drawArc(oval, 0, 365, false, mPaint);
+            successStep = 2;
+            drawDoneMark(status, canvas);
+            return;
+        }
+        
+        float sweepAngle = (float) (halfSweepA * Math.sin(Math.toRadians(followRotateDegrees))) + halfSweepA + halfSweepAMinValue / 2;
+        switch (status) {
+            case STATUS_LOADING:
+                canvas.drawArc(oval, currentRotateDegrees, -sweepAngle, false, mPaint);
+                break;
+            case STATUS_SUCCESS:
+            case STATUS_WARNING:
+            case STATUS_ERROR:
+                switch (successStep) {
+                    case 0:
+                        canvas.drawArc(oval, currentRotateDegrees, -sweepAngle, false, mPaint);
+                        if ((currentRotateDegrees - sweepAngle) > 270) {
+                            successStep = 1;
+                        }
+                        break;
+                    case 1:
+                        float aimAngle = currentRotateDegrees > 270 ? currentRotateDegrees - 270 : 90 + currentRotateDegrees;
+                        canvas.drawArc(oval, 270, aimAngle, false, mPaint);
+                        if (oldAnimAngle > aimAngle && oldAnimAngle > 300) {
+                            successStep = 2;
+                            canvas.drawArc(oval, 0, 360, false, mPaint);
+                            break;
+                        }
+                        oldAnimAngle = aimAngle;
+                        break;
+                    case 2:
+                        canvas.drawArc(oval, 0, 360, false, mPaint);
+                        drawDoneMark(status, canvas);
+                        break;
+                }
+                break;
+            case STATUS_PROGRESSING:
+                canvas.drawArc(oval, -90, currentRotateDegrees, false, mPaint);
+                if (currentRotateDegrees == 365 && waitProgressingRunnable != null) {
+                    waitProgressingRunnable.run();
+                    waitProgressingRunnable = null;
+                }
+                break;
+        }
+    }
+    
+    private void drawDoneMark(int status, Canvas canvas) {
+        if (rotateAnimator.getInterpolator() != interpolator) {
+            rotateAnimator.setInterpolator(interpolator);
+        }
+        if (tickShowRunnable != null) {
+            tickShowRunnable.run();
+            performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
+            tickShowRunnable = null;
+        }
+        switch (status) {
+            case STATUS_SUCCESS:
+                showSuccessTick(canvas);
+                break;
+            case STATUS_WARNING:
+                showWarningTick(canvas);
+                break;
+            case STATUS_ERROR:
+                showErrorTick(canvas);
+                break;
+        }
+    }
+    
+    private int line1X = 0;
+    private int line1Y = 0;
+    private int line2X = 0;
+    private int line2Y = 0;
+    
+    private int tickStep = 0;
+    
+    //绘制对号
+    private void showSuccessTick(Canvas canvas) {
+        int tickLeftPoint = (int) (mCenterX - mRadius * 1 / 2);
+        int tickTurnLeftPoint = (int) (mCenterX - mRadius / 10);
+        int tickRightPoint = (int) (mRadius * 0.99f);
+        int speed = 2;
+        switch (tickStep) {
+            case 0:
+                if (tickLeftPoint + line1X < tickTurnLeftPoint) {
+                    line1X = line1X + speed;
+                    line1Y = line1Y + speed;
+                } else {
+                    line2X = line1X;
+                    line2Y = line1Y;
+                    tickStep = 1;
+                }
+                break;
+            case 1:
+                if (line2X < tickRightPoint) {
+                    line2X = line2X + 4;
+                    line2Y = line2Y - 5;
+                }
+                break;
+        }
+        canvas.drawLine(tickLeftPoint, mCenterY, tickLeftPoint + line1X, mCenterY + line1Y, mPaint);
+        canvas.drawLine(tickLeftPoint + line1X, mCenterY + line1Y, tickLeftPoint + line2X, mCenterY + line2Y, mPaint);
+        
+        postInvalidateDelayed(1);
+    }
+    
+    //绘制感叹号
+    private void showWarningTick(Canvas canvas) {
+        int tickLeftPoint = (int) mCenterX;
+        int line1StartY = (int) (mCenterY - mRadius * 1 / 2);
+        int line1EndY = (int) (mCenterY + mRadius * 1 / 8);
+        int line2StartY = (int) (mCenterY + mRadius * 3 / 7);
+        int speed = 4;
+        switch (tickStep) {
+            case 0:
+                if (line1Y < line1EndY - line1StartY) {
+                    line1Y = line1Y + speed;
+                } else {
+                    line1Y = line1EndY - line1StartY;
+                    tickStep = 1;
+                }
+                break;
+            case 1:
+                if (line2Y != line2StartY) {
+                    canvas.drawLine(tickLeftPoint, line2StartY, tickLeftPoint, line2StartY + 1, mPaint);
+                }
+                break;
+        }
+        canvas.drawLine(tickLeftPoint, line1StartY, tickLeftPoint, line1StartY + line1Y, mPaint);
+        postInvalidateDelayed(tickStep == 1 ? 100 : 1);
+    }
+    
+    //绘制错误符号
+    private void showErrorTick(Canvas canvas) {
+        int tickLeftPoint = (int) (mCenterX - mRadius * 4 / 10);
+        int tickRightPoint = (int) (mCenterX + mRadius * 4 / 10);
+        int tickTopPoint = (int) (mCenterY - mRadius * 4 / 10);
+        int speed = 4;
+        
+        switch (tickStep) {
+            case 0:
+                if (tickRightPoint - line1X > tickLeftPoint) {
+                    line1X = line1X + speed;
+                    line1Y = line1Y + speed;
+                } else {
+                    tickStep = 1;
+                    canvas.drawLine(tickRightPoint, tickTopPoint, tickRightPoint - line1X, tickTopPoint + line1Y, mPaint);
+                    postInvalidateDelayed(150);
+                    return;
+                }
+                break;
+            case 1:
+                if (tickLeftPoint + line2X < tickRightPoint) {
+                    line2X = line2X + speed;
+                    line2Y = line2Y + speed;
+                }
+                canvas.drawLine(tickLeftPoint, tickTopPoint, tickLeftPoint + line2X, tickTopPoint + line2Y, mPaint);
+                break;
+        }
+        canvas.drawLine(tickRightPoint, tickTopPoint, tickRightPoint - line1X, tickTopPoint + line1Y, mPaint);
+        postInvalidateDelayed(1);
+    }
+    
+    private TimeInterpolator interpolator;
+    private Runnable waitProgressingRunnable;
+    
+    public void success() {
+        if (status == STATUS_PROGRESSING) {
+            progress(1f);
+            waitProgressingRunnable = new Runnable() {
+                @Override
+                public void run() {
+                    tickStep = 0;
+                    successStep = 2;
+                    interpolator = new AccelerateDecelerateInterpolator();
+                    status = STATUS_SUCCESS;
+                }
+            };
+            return;
+        }
+        tickStep = 0;
+        interpolator = new AccelerateDecelerateInterpolator();
+        status = STATUS_SUCCESS;
+        invalidate();
+    }
+    
+    public void warning() {
+        if (status == STATUS_PROGRESSING) {
+            progress(1f);
+            waitProgressingRunnable = new Runnable() {
+                @Override
+                public void run() {
+                    tickStep = 0;
+                    successStep = 2;
+                    interpolator = new DecelerateInterpolator(2);
+                    status = STATUS_WARNING;
+                }
+            };
+            return;
+        }
+        tickStep = 0;
+        interpolator = new DecelerateInterpolator(2);
+        status = STATUS_WARNING;
+        invalidate();
+    }
+    
+    public void error() {
+        if (status == STATUS_PROGRESSING) {
+            progress(1f);
+            waitProgressingRunnable = new Runnable() {
+                @Override
+                public void run() {
+                    tickStep = 0;
+                    successStep = 2;
+                    interpolator = new DecelerateInterpolator(2);
+                    status = STATUS_ERROR;
+                }
+            };
+            return;
+        }
+        tickStep = 0;
+        interpolator = new DecelerateInterpolator(2);
+        status = STATUS_ERROR;
+        invalidate();
+    }
+    
+    public void progress(float progress) {
+        if (rotateAnimator != null) rotateAnimator.cancel();
+        
+        rotateAnimator = ValueAnimator.ofFloat(currentRotateDegrees, 365 * progress);
+        rotateAnimator.setDuration(1000);
+        rotateAnimator.setInterpolator(new DecelerateInterpolator(2));
+        rotateAnimator.setRepeatCount(0);
+        rotateAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+            @Override
+            public void onAnimationUpdate(ValueAnimator animation) {
+                currentRotateDegrees = (float) animation.getAnimatedValue();
+                invalidate();
+            }
+        });
+        rotateAnimator.start();
+        status = STATUS_PROGRESSING;
+    }
+    
+    private Runnable tickShowRunnable;
+    
+    public ProgressView whenShowTick(Runnable runnable) {
+        tickShowRunnable = runnable;
+        return this;
+    }
+    
+    public void loading() {
+        noShowLoading = false;
+        oldAnimAngle = 0;
+        successStep = 0;
+        line1X = 0;
+        line1Y = 0;
+        line2X = 0;
+        line2Y = 0;
+        if (rotateAnimator != null) rotateAnimator.cancel();
+        rotateAnimator = ValueAnimator.ofFloat(0, 365);
+        rotateAnimator.setDuration(1000);
+        rotateAnimator.setInterpolator(new LinearInterpolator());
+        rotateAnimator.setRepeatCount(-1);
+        rotateAnimator.setInterpolator(new LinearInterpolator());
+        status = STATUS_LOADING;
+        rotateAnimator.start();
+    }
+    
+    public int getStatus() {
+        return status;
+    }
+    
+    @Override
+    protected void onDetachedFromWindow() {
+        if (rotateAnimator != null) {
+            rotateAnimator.cancel();
+        }
+        if (followAnimator != null) {
+            followAnimator.cancel();
+        }
+        super.onDetachedFromWindow();
+    }
+    
+    public int getStrokeWidth() {
+        return width;
+    }
+    
+    public ProgressView setStrokeWidth(int width) {
+        this.width = width;
+        if (mPaint != null) mPaint.setStrokeWidth(width);
+        return this;
+    }
+    
+    public int getColor() {
+        return color;
+    }
+    
+    public ProgressView setColor(int color) {
+        this.color = color;
+        if (mPaint != null) mPaint.setColor(color);
+        return this;
+    }
+    
+    private boolean noShowLoading;
+    
+    public void noLoading() {
+        noShowLoading = true;
+    }
+}

+ 69 - 0
DialogX/src/main/res/layout/layout_dialogx_wait.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black40"
+    android:orientation="vertical">
+
+    <com.kongzue.dialogx.util.views.MaxRelativeLayout
+        android:id="@+id/bkg"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerInParent="true"
+        android:minWidth="125dp"
+        android:minHeight="125dp">
+
+        <com.kongzue.dialogx.util.views.BlurView
+            android:id="@+id/blurView"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:tag="blurView" />
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:gravity="center_horizontal"
+            android:paddingTop="1.5dp"
+            android:orientation="vertical">
+
+            <RelativeLayout
+                android:id="@+id/box_progress"
+                android:layout_width="65dp"
+                android:layout_height="65dp">
+
+                <com.kongzue.dialogx.util.views.ProgressView
+                    android:id="@+id/progressView"
+                    android:layout_width="65dp"
+                    android:layout_height="65dp"
+                    android:layout_centerInParent="true"
+                    app:progressStrokeWidth="2dp" />
+
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:id="@+id/box_customView"
+                android:layout_width="65dp"
+                android:layout_height="65dp"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_info"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:gravity="center"
+                android:maxLines="3"
+                android:text="Please Wait"
+                android:textColor="@color/white"
+                android:textSize="14dp" />
+
+        </LinearLayout>
+
+    </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 5 - 0
DialogX/src/main/res/values/attrs.xml

@@ -13,4 +13,9 @@
         <attr name="xRadius" format="dimension"/>
         <attr name="yRadius" format="dimension"/>
     </declare-styleable>
+
+    <declare-styleable name="ProgressView">
+        <attr name="progressStrokeWidth" format="dimension"/>
+        <attr name="progressStrokeColor" format="color"/>
+    </declare-styleable>
 </resources>

+ 2 - 0
DialogX/src/main/res/values/colors.xml

@@ -31,4 +31,6 @@
     <color name="white10">#1Affffff</color>
 
     <color name="dialogxMaterialDarkDialogBkgColor">#343434</color>
+    <color name="dialogxWaitBkgLight">#CCF4F5F6</color>
+    <color name="dialogxWaitBkgDark">#D1161616</color>
 </resources>

+ 1 - 1
DialogXIOSStyle/build.gradle

@@ -20,5 +20,5 @@ android {
 
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
-
+    implementation project(path: ':DialogXInterface')
 }

+ 0 - 66
DialogXIOSStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -1,66 +0,0 @@
-package com.kongzue.dialogx.interfaces;
-
-/**
- * @author: Kongzue
- * @github: https://github.com/kongzue/
- * @homepage: http://kongzue.com/
- * @mail: myzcxhh@live.cn
- * @createTime: 2020/9/26 13:14
- */
-public interface DialogXStyle {
-    
-    int styleVer = 1;
-    
-    int BUTTON_OK = 1;
-    int BUTTON_CANCEL = 2;
-    int BUTTON_OTHER = 3;
-    int SPACE = 4;
-    int SPLIT = 5;
-    
-    int layout(boolean light);
-    
-    int enterAnimResId();
-    
-    int exitAnimResId();
-    
-    int[] verticalButtonOrder();
-    
-    int[] horizontalButtonOrder();
-    
-    int splitWidthPx();
-    
-    int splitColorRes(boolean light);
-    
-    BlurBackgroundSetting blurSettings();
-    
-    HorizontalButtonRes overrideHorizontalButtonRes();
-    
-    VerticalButtonRes overrideVerticalButtonRes();
-    
-    interface BlurBackgroundSetting {
-        
-        boolean blurBackground();
-        
-        int blurForwardColorRes(boolean light);
-        
-        int blurBackgroundRoundRadiusPx();
-    }
-    
-    interface HorizontalButtonRes {
-        
-        int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
-    }
-    
-    interface VerticalButtonRes {
-        
-        int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
-    }
-}

+ 20 - 1
DialogXIOSStyle/src/main/java/com/kongzue/dialogx/style/IOSStyle.java

@@ -3,7 +3,6 @@ package com.kongzue.dialogx.style;
 import android.content.res.Resources;
 
 import com.kongzue.dialogx.interfaces.DialogXStyle;
-import com.kongzue.dialogx.iostheme.BuildConfig;
 import com.kongzue.dialogx.iostheme.R;
 
 import java.util.HashMap;
@@ -127,4 +126,24 @@ public class IOSStyle implements DialogXStyle {
             }
         };
     }
+    
+    @Override
+    public WaitTipRes overrideWaitTipRes() {
+        return new WaitTipRes() {
+            @Override
+            public boolean blurBackground() {
+                return true;
+            }
+            
+            @Override
+            public int overrideBackgroundColorRes(boolean light) {
+                return 0;
+            }
+            
+            @Override
+            public int overrideTextColorRes(boolean light) {
+                return light?R.color.white:R.color.black;
+            }
+        };
+    }
 }

+ 2 - 2
DialogXIOSStyle/src/main/res/values/colors.xml

@@ -36,6 +36,6 @@
     <color name="dialogxIOSSplitDark">#4e4e50</color>
     <color name="dialogxIOSBlue">#007aff</color>
     <color name="dialogxButtonIOSLightPress">#0f000000</color>
-    <color name="dialogxIOSBkgLight">#D1F4F5F6</color>
-    <color name="dialogxIOSBkgDark">#DB161616</color>
+    <color name="dialogxIOSBkgLight">#CCF4F5F6</color>
+    <color name="dialogxIOSBkgDark">#D1161616</color>
 </resources>

+ 1 - 0
DialogXInterface/.gitignore

@@ -0,0 +1 @@
+/build

+ 8 - 0
DialogXInterface/build.gradle

@@ -0,0 +1,8 @@
+apply plugin: 'java-library'
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+}
+
+sourceCompatibility = "1.7"
+targetCompatibility = "1.7"

+ 12 - 8
DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java → DialogXInterface/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -1,12 +1,5 @@
 package com.kongzue.dialogx.interfaces;
 
-/**
- * @author: Kongzue
- * @github: https://github.com/kongzue/
- * @homepage: http://kongzue.com/
- * @mail: myzcxhh@live.cn
- * @createTime: 2020/9/26 13:14
- */
 public interface DialogXStyle {
     
     int styleVer = 1;
@@ -37,6 +30,8 @@ public interface DialogXStyle {
     
     VerticalButtonRes overrideVerticalButtonRes();
     
+    WaitTipRes overrideWaitTipRes();
+    
     interface BlurBackgroundSetting {
         
         boolean blurBackground();
@@ -63,4 +58,13 @@ public interface DialogXStyle {
         
         int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
     }
-}
+    
+    interface WaitTipRes {
+        
+        boolean blurBackground();
+        
+        int overrideBackgroundColorRes(boolean light);
+        
+        int overrideTextColorRes(boolean light);
+    }
+}

+ 1 - 1
DialogXKongzueStyle/build.gradle

@@ -20,5 +20,5 @@ android {
 
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
-
+    implementation project(path: ':DialogXInterface')
 }

+ 0 - 66
DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -1,66 +0,0 @@
-package com.kongzue.dialogx.interfaces;
-
-/**
- * @author: Kongzue
- * @github: https://github.com/kongzue/
- * @homepage: http://kongzue.com/
- * @mail: myzcxhh@live.cn
- * @createTime: 2020/9/26 13:14
- */
-public interface DialogXStyle {
-    
-    int styleVer = 1;
-    
-    int BUTTON_OK = 1;
-    int BUTTON_CANCEL = 2;
-    int BUTTON_OTHER = 3;
-    int SPACE = 4;
-    int SPLIT = 5;
-    
-    int layout(boolean light);
-    
-    int enterAnimResId();
-    
-    int exitAnimResId();
-    
-    int[] verticalButtonOrder();
-    
-    int[] horizontalButtonOrder();
-    
-    int splitWidthPx();
-    
-    int splitColorRes(boolean light);
-    
-    BlurBackgroundSetting blurSettings();
-    
-    HorizontalButtonRes overrideHorizontalButtonRes();
-    
-    VerticalButtonRes overrideVerticalButtonRes();
-    
-    interface BlurBackgroundSetting {
-        
-        boolean blurBackground();
-        
-        int blurForwardColorRes(boolean light);
-        
-        int blurBackgroundRoundRadiusPx();
-    }
-    
-    interface HorizontalButtonRes {
-        
-        int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
-    }
-    
-    interface VerticalButtonRes {
-        
-        int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
-    }
-}

+ 20 - 0
DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/style/KongzueStyle.java

@@ -68,4 +68,24 @@ public class KongzueStyle implements DialogXStyle {
     public VerticalButtonRes overrideVerticalButtonRes() {
         return null;
     }
+    
+    @Override
+    public WaitTipRes overrideWaitTipRes() {
+        return new WaitTipRes() {
+            @Override
+            public boolean blurBackground() {
+                return false;
+            }
+            
+            @Override
+            public int overrideBackgroundColorRes(boolean light) {
+                return 0;
+            }
+            
+            @Override
+            public int overrideTextColorRes(boolean light) {
+                return light?R.color.white:R.color.black;
+            }
+        };
+    }
 }

+ 1 - 7
DialogXMIUIStyle/build.gradle

@@ -9,8 +9,6 @@ android {
         versionCode 1
         versionName "1.0"
 
-        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
-        consumerProguardFiles "consumer-rules.pro"
     }
 
     buildTypes {
@@ -23,9 +21,5 @@ android {
 
 dependencies {
     implementation fileTree(dir: "libs", include: ["*.jar"])
-    implementation 'androidx.appcompat:appcompat:1.2.0'
-    testImplementation 'junit:junit:4.12'
-    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
-    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
-
+    implementation project(path: ':DialogXInterface')
 }

+ 0 - 66
DialogXMIUIStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -1,66 +0,0 @@
-package com.kongzue.dialogx.interfaces;
-
-/**
- * @author: Kongzue
- * @github: https://github.com/kongzue/
- * @homepage: http://kongzue.com/
- * @mail: myzcxhh@live.cn
- * @createTime: 2020/9/26 13:14
- */
-public interface DialogXStyle {
-    
-    int styleVer = 1;
-    
-    int BUTTON_OK = 1;
-    int BUTTON_CANCEL = 2;
-    int BUTTON_OTHER = 3;
-    int SPACE = 4;
-    int SPLIT = 5;
-    
-    int layout(boolean light);
-    
-    int enterAnimResId();
-    
-    int exitAnimResId();
-    
-    int[] verticalButtonOrder();
-    
-    int[] horizontalButtonOrder();
-    
-    int splitWidthPx();
-    
-    int splitColorRes(boolean light);
-    
-    BlurBackgroundSetting blurSettings();
-    
-    HorizontalButtonRes overrideHorizontalButtonRes();
-    
-    VerticalButtonRes overrideVerticalButtonRes();
-    
-    interface BlurBackgroundSetting {
-        
-        boolean blurBackground();
-        
-        int blurForwardColorRes(boolean light);
-        
-        int blurBackgroundRoundRadiusPx();
-    }
-    
-    interface HorizontalButtonRes {
-        
-        int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
-    }
-    
-    interface VerticalButtonRes {
-        
-        int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
-        
-        int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
-    }
-}

+ 20 - 0
DialogXMIUIStyle/src/main/java/com/kongzue/dialogx/style/MIUIStyle.java

@@ -68,4 +68,24 @@ public class MIUIStyle implements DialogXStyle {
     public VerticalButtonRes overrideVerticalButtonRes() {
         return null;
     }
+    
+    @Override
+    public WaitTipRes overrideWaitTipRes() {
+        return new WaitTipRes() {
+            @Override
+            public boolean blurBackground() {
+                return false;
+            }
+            
+            @Override
+            public int overrideBackgroundColorRes(boolean light) {
+                return 0;
+            }
+            
+            @Override
+            public int overrideTextColorRes(boolean light) {
+                return light ? R.color.white : R.color.black;
+            }
+        };
+    }
 }

+ 1 - 1
README.md

@@ -5,7 +5,7 @@ DialogX 无需依赖 context 启动对话框,使用更加方便。
 
 DialogX 采用分离设计,默认自带 Material 主题,可选引入 IOS、Kongzue 等其他风格主题,大大减小 App 体积。
 
-更低的耦合度,无论对话框是否正在显示,请肆意执行的 Activity 关闭逻辑,而无需担心引发 WindowLeaked 错误。
+更低的耦合度,无论对话框是否正在显示,请肆意执行的 Activity 关闭逻辑,而无需担心引发 WindowLeaked 错误。
 
 目前开发进度:51% [========== · · · · · · · · · · ]
 

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

@@ -14,10 +14,13 @@ import com.kongzue.baseframework.interfaces.DarkNavigationBarTheme;
 import com.kongzue.baseframework.interfaces.DarkStatusBarTheme;
 import com.kongzue.baseframework.interfaces.Layout;
 import com.kongzue.baseframework.interfaces.NavigationBarBackgroundColorRes;
+import com.kongzue.baseframework.util.CycleRunner;
 import com.kongzue.baseframework.util.JumpParameter;
 import com.kongzue.dialogx.DialogX;
 import com.kongzue.dialogx.dialogs.InputDialog;
 import com.kongzue.dialogx.dialogs.MessageDialog;
+import com.kongzue.dialogx.dialogs.TipDialog;
+import com.kongzue.dialogx.dialogs.WaitDialog;
 import com.kongzue.dialogx.style.IOSStyle;
 import com.kongzue.dialogx.style.KongzueStyle;
 import com.kongzue.dialogx.style.MIUIStyle;
@@ -47,7 +50,11 @@ public class MainActivity extends BaseActivity {
     private TextView btnSelectDialog;
     private TextView btnInputDialog;
     private TextView btnWaitDialog;
-    private TextView btnTipDialog;
+    private TextView btnWaitAndTipDialog;
+    private TextView btnTipSuccess;
+    private TextView btnTipWarning;
+    private TextView btnTipError;
+    private TextView btnTipProgress;
     private TextView btnModalDialog;
     private TextView btnShowBreak;
     private TextView btnNotify;
@@ -81,7 +88,11 @@ public class MainActivity extends BaseActivity {
         btnSelectDialog = findViewById(R.id.btn_selectDialog);
         btnInputDialog = findViewById(R.id.btn_inputDialog);
         btnWaitDialog = findViewById(R.id.btn_waitDialog);
-        btnTipDialog = findViewById(R.id.btn_tipDialog);
+        btnWaitAndTipDialog = findViewById(R.id.btn_waitAndTipDialog);
+        btnTipSuccess = findViewById(R.id.btn_tipSuccess);
+        btnTipWarning = findViewById(R.id.btn_tipWarning);
+        btnTipError = findViewById(R.id.btn_tipError);
+        btnTipProgress = findViewById(R.id.btn_tipProgress);
         btnModalDialog = findViewById(R.id.btn_modalDialog);
         btnShowBreak = findViewById(R.id.btn_showBreak);
         btnNotify = findViewById(R.id.btn_notify);
@@ -102,6 +113,10 @@ public class MainActivity extends BaseActivity {
         DialogX.globalStyle = IOSStyle.style();
     }
     
+    //用于模拟进度提示
+    private CycleRunner cycleRunner;
+    private float progress = 0;
+    
     @Override
     public void setEvents() {
         grpTheme.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@@ -148,9 +163,9 @@ public class MainActivity extends BaseActivity {
         btnSelectDialog.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                new MessageDialog("将“爱奇艺”移至App资源库还是删除该App?", "移动App会将它从主屏幕移除并保留其所有数据。", "删除App", "取消", "移至App资源库")
+                new MessageDialog("多选对话框", "移动App会将它从主屏幕移除并保留其所有数据。", "删除App", "取消", "移至App资源库")
                         .setButtonOrientation(LinearLayout.VERTICAL)
-                        //.setOkTextInfo(new TextInfo().setFontColor(Color.parseColor("#EB5545")))
+                        .setOkTextInfo(new TextInfo().setFontColor(Color.parseColor("#EB5545")))
                         .show();
             }
         });
@@ -161,6 +176,78 @@ public class MainActivity extends BaseActivity {
                 new InputDialog("标题", "正文内容", "确定", "取消", "正在输入的文字").setCancelable(false).show();
             }
         });
+        
+        btnWaitDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                WaitDialog.show("Please Wait!");
+                runDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        WaitDialog.dismiss();
+                    }
+                }, 2000);
+            }
+        });
+        
+        btnWaitAndTipDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                WaitDialog.show("Please Wait!");
+                runDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        TipDialog.show("Success!", WaitDialog.TYPE.SUCCESS);
+                    }
+                }, 2000);
+            }
+        });
+        
+        btnTipSuccess.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                TipDialog.show("Success!", WaitDialog.TYPE.SUCCESS);
+            }
+        });
+        
+        btnTipWarning.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                TipDialog.show("Warning!", WaitDialog.TYPE.WARNING);
+            }
+        });
+        
+        btnTipError.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                TipDialog.show("Error!", WaitDialog.TYPE.ERROR);
+            }
+        });
+        
+        btnTipProgress.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                progress = 0;
+                WaitDialog.show("连接服务器...");
+                runOnMainDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        cycleRunner = runOnMainCycle(new Runnable() {
+                            @Override
+                            public void run() {
+                                progress = progress + 0.1f;
+                                if (progress < 1f) {
+                                    WaitDialog.show("正在加载" + ((int) (progress * 100)) + "%", progress);
+                                } else {
+                                    TipDialog.show("加载完成", WaitDialog.TYPE.SUCCESS);
+                                    cycleRunner.cancel();
+                                }
+                            }
+                        }, 1000, 1000);
+                    }
+                }, 3000);
+            }
+        });
     }
     
     @Override

+ 62 - 4
app/src/main/res/layout/activity_main.xml

@@ -69,8 +69,8 @@
                         android:layout_width="45dp"
                         android:layout_height="match_parent"
                         android:paddingHorizontal="10dp"
-                        android:visibility="gone"
-                        android:src="@mipmap/img_share" />
+                        android:src="@mipmap/img_share"
+                        android:visibility="gone" />
 
                 </LinearLayout>
 
@@ -285,7 +285,7 @@
                         android:textStyle="bold" />
 
                     <TextView
-                        android:id="@+id/btn_tipDialog"
+                        android:id="@+id/btn_waitAndTipDialog"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_margin="5dp"
@@ -299,6 +299,65 @@
 
                 </LinearLayout>
 
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/btn_tipSuccess"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:background="@drawable/rect_button"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="10dp"
+                        android:text="完成"
+                        android:textColor="@color/white"
+                        android:textSize="13dp"
+                        android:textStyle="bold" />
+
+                    <TextView
+                        android:id="@+id/btn_tipWarning"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:background="@drawable/rect_button"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="10dp"
+                        android:text="警告"
+                        android:textColor="@color/white"
+                        android:textSize="13dp"
+                        android:textStyle="bold" />
+
+                    <TextView
+                        android:id="@+id/btn_tipError"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:background="@drawable/rect_button"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="10dp"
+                        android:text="错误"
+                        android:textColor="@color/white"
+                        android:textSize="13dp"
+                        android:textStyle="bold" />
+
+                    <TextView
+                        android:id="@+id/btn_tipProgress"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_margin="5dp"
+                        android:background="@drawable/rect_button"
+                        android:paddingHorizontal="15dp"
+                        android:paddingVertical="10dp"
+                        android:text="模拟进度"
+                        android:textColor="@color/white"
+                        android:textSize="13dp"
+                        android:textStyle="bold" />
+
+                </LinearLayout>
+
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -562,5 +621,4 @@
         </ScrollView>
 
     </LinearLayout>
-
 </RelativeLayout>

+ 1 - 0
settings.gradle

@@ -1,3 +1,4 @@
+include ':DialogXInterface'
 include ':DialogXMIUIStyle'
 include ':DialogXKongzueStyle'
 include ':DialogXIOSStyle'