Prechádzať zdrojové kódy

0.0.46.beta3
- 除 CustomDialog 外增加设置方法 .setBackgroundRadius(float px):以方便直接修改对话框圆角,单位像素,此修改方法将裁剪对话框内容元素;
- 新增 DialogX.showDialogList(dialogArray[]) 可以按队列显示对话框,上一个对话框关闭时自动启动下一个对话框;

kongzue 3 rokov pred
rodič
commit
194bfc7bd2
20 zmenil súbory, kde vykonal 388 pridanie a 23 odobranie
  1. 1 1
      .idea/misc.xml
  2. 5 0
      DialogX/src/main/java/com/kongzue/dialogx/DialogX.java
  3. 32 3
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java
  4. 10 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java
  5. 2 3
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java
  6. 33 3
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java
  7. 6 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java
  8. 30 1
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java
  9. 30 1
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopMenu.java
  10. 28 2
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopNotification.java
  11. 28 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java
  12. 10 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/TipDialog.java
  13. 32 4
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java
  14. 26 2
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java
  15. 1 1
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnDialogButtonClickListener.java
  16. 1 1
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnInputDialogButtonClickListener.java
  17. 62 0
      DialogX/src/main/java/com/kongzue/dialogx/util/DialogListBuilder.java
  18. 35 0
      app/src/main/java/com/kongzue/dialogxdemo/activity/MainActivity.java
  19. 15 0
      app/src/main/res/layout/activity_main.xml
  20. 1 1
      gradle.properties

+ 1 - 1
.idea/misc.xml

@@ -35,7 +35,7 @@
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml" value="0.5411458333333333" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_custom.xml" value="0.5328205128205128" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_empty.xml" value="0.30648148148148147" />
-        <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_fullscreen.xml" value="0.1" />
+        <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_fullscreen.xml" value="0.33" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_fullscreen_dark.xml" value="0.5411458333333333" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_material.xml" value="0.390495867768595" />
         <entry key="..\:/WorkSpace/Android/DialogXDemo/DialogX/src/main/res/layout/layout_dialogx_material_dark.xml" value="0.5369791666666667" />

+ 5 - 0
DialogX/src/main/java/com/kongzue/dialogx/DialogX.java

@@ -9,6 +9,7 @@ import com.kongzue.dialogx.interfaces.BaseDialog;
 import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
 import com.kongzue.dialogx.interfaces.DialogXStyle;
 import com.kongzue.dialogx.style.MaterialStyle;
+import com.kongzue.dialogx.util.DialogListBuilder;
 import com.kongzue.dialogx.util.InputInfo;
 import com.kongzue.dialogx.util.TextInfo;
 
@@ -158,4 +159,8 @@ public class DialogX {
         final float scale = Resources.getSystem().getDisplayMetrics().density;
         return (int) (dpValue * scale + 0.5f);
     }
+    
+    public static DialogListBuilder showDialogList(BaseDialog... dialogs) {
+        return DialogListBuilder.create(dialogs).show();
+    }
 }

+ 32 - 3
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -3,11 +3,13 @@ package com.kongzue.dialogx.dialogs;
 import android.animation.ObjectAnimator;
 import android.animation.ValueAnimator;
 import android.app.Activity;
-import android.graphics.Color;
+import android.graphics.Outline;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Handler;
 import android.os.Looper;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
@@ -58,9 +60,10 @@ public class BottomDialog extends BaseDialog {
     protected OnDialogButtonClickListener<BottomDialog> cancelButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> okButtonClickListener;
     protected OnDialogButtonClickListener<BottomDialog> otherButtonClickListener;
+    protected OnBackgroundMaskClickListener<BottomDialog> onBackgroundMaskClickListener;
     protected BOOLEAN privateCancelable;
     protected boolean bkgInterceptTouch = true;
-    protected OnBackgroundMaskClickListener<BottomDialog> onBackgroundMaskClickListener;
+    protected float backgroundRadius = -1;
     
     protected TextInfo titleTextInfo;
     protected TextInfo messageTextInfo;
@@ -180,7 +183,7 @@ public class BottomDialog extends BaseDialog {
         return bottomDialog;
     }
     
-    public void show() {
+    public BottomDialog show() {
         super.beforeShow();
         if (getDialogView() == null) {
             int layoutId = isLightTheme() ? R.layout.layout_dialogx_bottom_material : R.layout.layout_dialogx_bottom_material_dark;
@@ -193,6 +196,7 @@ public class BottomDialog extends BaseDialog {
             if (dialogView != null) dialogView.setTag(me);
         }
         show(dialogView);
+        return this;
     }
     
     public void show(Activity activity) {
@@ -508,6 +512,21 @@ public class BottomDialog extends BaseDialog {
                     boxRoot.callOnClick();
                 }
             });
+            if (backgroundRadius > -1) {
+                GradientDrawable gradientDrawable = (GradientDrawable) bkg.getBackground();
+                if (gradientDrawable != null) gradientDrawable.setCornerRadii(new float[]{
+                        backgroundRadius, backgroundRadius, backgroundRadius, backgroundRadius, 0, 0, 0, 0
+                });
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    bkg.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), (int) (view.getHeight() + backgroundRadius), backgroundRadius);
+                        }
+                    });
+                    bkg.setClipToOutline(true);
+                }
+            }
             
             if (maskColor != -1) {
                 boxRoot.setBackgroundColor(maskColor);
@@ -1017,4 +1036,14 @@ public class BottomDialog extends BaseDialog {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
+    
+    public BottomDialog setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

+ 10 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomMenu.java

@@ -1139,4 +1139,14 @@ public class BottomMenu extends BottomDialog {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
+    
+    public BottomMenu setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

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

@@ -26,8 +26,6 @@ import com.kongzue.dialogx.interfaces.OnBindView;
 import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
 import com.kongzue.dialogx.util.views.MaxRelativeLayout;
 
-import java.lang.ref.WeakReference;
-
 /**
  * @author: Kongzue
  * @github: https://github.com/kongzue/
@@ -102,7 +100,7 @@ public class CustomDialog extends BaseDialog {
         return customDialog;
     }
     
-    public void show() {
+    public CustomDialog show() {
         super.beforeShow();
         if (getDialogView() == null) {
             dialogView = createView(R.layout.layout_dialogx_custom);
@@ -110,6 +108,7 @@ public class CustomDialog extends BaseDialog {
             if (dialogView != null) dialogView.setTag(me);
         }
         show(dialogView);
+        return this;
     }
     
     public void show(Activity activity) {

+ 33 - 3
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -3,10 +3,13 @@ package com.kongzue.dialogx.dialogs;
 import android.animation.ObjectAnimator;
 import android.animation.ValueAnimator;
 import android.app.Activity;
+import android.graphics.Outline;
 import android.graphics.Rect;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Handler;
 import android.os.Looper;
 import android.view.View;
+import android.view.ViewOutlineProvider;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.RelativeLayout;
 
@@ -45,6 +48,7 @@ public class FullScreenDialog extends BaseDialog {
     protected OnBindView<FullScreenDialog> onBindView;
     protected BOOLEAN privateCancelable;
     protected boolean hideZoomBackground;
+    protected float backgroundRadius = -1;
     
     protected DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback;
     protected OnBackgroundMaskClickListener<FullScreenDialog> onBackgroundMaskClickListener;
@@ -75,7 +79,7 @@ public class FullScreenDialog extends BaseDialog {
         return fullScreenDialog;
     }
     
-    public void show() {
+    public FullScreenDialog show() {
         super.beforeShow();
         if (getDialogView() == null) {
             dialogView = createView(isLightTheme() ? R.layout.layout_dialogx_fullscreen : R.layout.layout_dialogx_fullscreen_dark);
@@ -83,6 +87,7 @@ public class FullScreenDialog extends BaseDialog {
             if (dialogView != null) dialogView.setTag(me);
         }
         show(dialogView);
+        return this;
     }
     
     public void show(Activity activity) {
@@ -107,12 +112,12 @@ public class FullScreenDialog extends BaseDialog {
         public MaxRelativeLayout bkg;
         public RelativeLayout boxCustom;
         public ScrollController scrollView;
-    
+        
         public DialogImpl setScrollView(ScrollController scrollView) {
             this.scrollView = scrollView;
             return this;
         }
-    
+        
         public DialogImpl(View convertView) {
             if (convertView == null) return;
             imgZoomActivity = convertView.findViewById(R.id.img_zoom_activity);
@@ -272,6 +277,21 @@ public class FullScreenDialog extends BaseDialog {
             } else {
                 boxRoot.setOnClickListener(null);
             }
+            if (backgroundRadius > -1) {
+                GradientDrawable gradientDrawable = (GradientDrawable) bkg.getBackground();
+                if (gradientDrawable != null) gradientDrawable.setCornerRadii(new float[]{
+                        backgroundRadius, backgroundRadius, backgroundRadius, backgroundRadius, 0, 0, 0, 0
+                });
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    bkg.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), (int) (view.getHeight() + backgroundRadius), backgroundRadius);
+                        }
+                    });
+                    bkg.setClipToOutline(true);
+                }
+            }
             
             if (onBindView != null) {
                 onBindView.bindParent(boxCustom, me);
@@ -540,4 +560,14 @@ public class FullScreenDialog extends BaseDialog {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
+    
+    public FullScreenDialog setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

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

@@ -603,4 +603,10 @@ public class InputDialog extends MessageDialog {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
+    
+    public InputDialog setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
 }

+ 30 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -2,6 +2,8 @@ package com.kongzue.dialogx.dialogs;
 
 import android.animation.ValueAnimator;
 import android.app.Activity;
+import android.graphics.Outline;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Handler;
 import android.os.Looper;
 import android.text.InputFilter;
@@ -9,6 +11,7 @@ import android.text.InputType;
 import android.text.method.LinkMovementMethod;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
@@ -79,6 +82,7 @@ public class MessageDialog extends BaseDialog {
     protected String inputText;
     protected String inputHintText;
     protected int maskColor = -1;
+    protected float backgroundRadius = -1;
     
     protected TextInfo titleTextInfo;
     protected TextInfo messageTextInfo;
@@ -207,7 +211,7 @@ public class MessageDialog extends BaseDialog {
     
     protected DialogImpl dialogImpl;
     
-    public void show() {
+    public MessageDialog show() {
         super.beforeShow();
         if (getDialogView() == null) {
             int layoutId = style.layout(isLightTheme());
@@ -218,6 +222,7 @@ public class MessageDialog extends BaseDialog {
             if (dialogView != null) dialogView.setTag(me);
         }
         show(dialogView);
+        return this;
     }
     
     public void show(Activity activity) {
@@ -274,6 +279,7 @@ public class MessageDialog extends BaseDialog {
             btnSelectNegative = convertView.findViewById(R.id.btn_selectNegative);
             btnSelectPositive = convertView.findViewById(R.id.btn_selectPositive);
             init();
+            
             dialogImpl = this;
             refreshView();
         }
@@ -492,6 +498,19 @@ public class MessageDialog extends BaseDialog {
                 boxRoot.setBackgroundColor(maskColor);
                 boxRoot.setBkgAlpha(0f);
             }
+            if (backgroundRadius > -1) {
+                GradientDrawable gradientDrawable = (GradientDrawable) bkg.getBackground();
+                if (gradientDrawable != null) gradientDrawable.setCornerRadius(backgroundRadius);
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    bkg.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), backgroundRadius);
+                        }
+                    });
+                    bkg.setClipToOutline(true);
+                }
+            }
             
             showText(txtDialogTitle, title);
             showText(txtDialogTip, message);
@@ -1153,4 +1172,14 @@ public class MessageDialog extends BaseDialog {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
+    
+    public MessageDialog setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

+ 30 - 1
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopMenu.java

@@ -3,6 +3,8 @@ package com.kongzue.dialogx.dialogs;
 import static android.view.View.OVER_SCROLL_NEVER;
 
 import android.animation.ValueAnimator;
+import android.graphics.Outline;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Build;
 import android.os.Handler;
 import android.os.Looper;
@@ -10,6 +12,7 @@ import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.view.ViewTreeObserver;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.Animation;
@@ -70,6 +73,7 @@ public class PopMenu extends BaseDialog {
     protected int height = -1;                                              //指定菜单高度
     protected TextInfo menuTextInfo;
     protected boolean offScreen = false;                                    //超出屏幕
+    protected float backgroundRadius = -1;
     
     protected int alignGravity = -1;                                        //指定菜单相对 baseView 的位置
     
@@ -193,7 +197,7 @@ public class PopMenu extends BaseDialog {
         return popMenu;
     }
     
-    public void show() {
+    public PopMenu show() {
         super.beforeShow();
         if (getDialogView() == null) {
             int layoutId = isLightTheme() ? R.layout.layout_dialogx_popmenu_material : R.layout.layout_dialogx_popmenu_material_dark;
@@ -238,6 +242,7 @@ public class PopMenu extends BaseDialog {
                 }
             });
         }
+        return this;
     }
     
     protected PopMenuArrayAdapter menuListAdapter;
@@ -592,6 +597,20 @@ public class PopMenu extends BaseDialog {
                 boxRoot.setClickable(false);
             }
             
+            if (backgroundRadius > -1) {
+                GradientDrawable gradientDrawable = (GradientDrawable) boxBody.getBackground();
+                if (gradientDrawable != null) gradientDrawable.setCornerRadius(backgroundRadius);
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    boxBody.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), backgroundRadius);
+                        }
+                    });
+                    boxBody.setClipToOutline(true);
+                }
+            }
+            
             if (onBindView != null && onBindView.getCustomView() != null) {
                 onBindView.bindParent(boxCustom, me);
                 boxCustom.setVisibility(View.VISIBLE);
@@ -942,4 +961,14 @@ public class PopMenu extends BaseDialog {
         this.theme = theme;
         return this;
     }
+    
+    public PopMenu setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

+ 28 - 2
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopNotification.java

@@ -3,19 +3,21 @@ package com.kongzue.dialogx.dialogs;
 import android.animation.ValueAnimator;
 import android.app.Activity;
 import android.graphics.Bitmap;
+import android.graphics.Outline;
 import android.graphics.Rect;
 import android.graphics.drawable.Drawable;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Build;
 import android.os.Handler;
 import android.os.Looper;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.ImageView;
-import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
@@ -37,7 +39,6 @@ import com.kongzue.dialogx.util.PopValueAnimator;
 import com.kongzue.dialogx.util.TextInfo;
 import com.kongzue.dialogx.util.views.BlurView;
 import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
-import com.kongzue.dialogx.util.views.MaxLinearLayout;
 import com.kongzue.dialogx.util.views.MaxRelativeLayout;
 
 import java.util.ArrayList;
@@ -75,6 +76,7 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
     protected OnDialogButtonClickListener<PopNotification> onPopTipClickListener;
     protected boolean autoTintIconInLightOrDarkMode = true;
     protected BOOLEAN tintIcon;
+    protected float backgroundRadius = -1;
     
     protected int iconResId;
     protected Bitmap iconBitmap;
@@ -652,6 +654,20 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
                 boxCustom.setVisibility(View.GONE);
             }
             
+            if (backgroundRadius > -1) {
+                GradientDrawable gradientDrawable = (GradientDrawable) boxBody.getBackground();
+                if (gradientDrawable != null) gradientDrawable.setCornerRadius(backgroundRadius);
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    boxBody.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), backgroundRadius);
+                        }
+                    });
+                    boxBody.setClipToOutline(true);
+                }
+            }
+            
             showText(txtDialogxPopTitle, title);
             showText(txtDialogxPopMessage, message);
             showText(txtDialogxButton, buttonText);
@@ -1253,4 +1269,14 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
         refreshUI();
         return this;
     }
+    
+    public PopNotification setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

+ 28 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java

@@ -2,11 +2,14 @@ package com.kongzue.dialogx.dialogs;
 
 import android.animation.ValueAnimator;
 import android.app.Activity;
+import android.graphics.Outline;
 import android.graphics.Rect;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Build;
 import android.os.Handler;
 import android.os.Looper;
 import android.view.View;
+import android.view.ViewOutlineProvider;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
@@ -67,6 +70,7 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
     protected OnDialogButtonClickListener<PopTip> onButtonClickListener;
     protected OnDialogButtonClickListener<PopTip> onPopTipClickListener;
     protected BOOLEAN tintIcon;
+    protected float backgroundRadius = -1;
     
     protected int iconResId;
     protected CharSequence message;
@@ -580,6 +584,20 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
                 imgDialogxPopIcon.setVisibility(View.GONE);
             }
             
+            if (backgroundRadius > -1) {
+                GradientDrawable gradientDrawable = (GradientDrawable) boxBody.getBackground();
+                if (gradientDrawable != null) gradientDrawable.setCornerRadius(backgroundRadius);
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    boxBody.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), backgroundRadius);
+                        }
+                    });
+                    boxBody.setClipToOutline(true);
+                }
+            }
+            
             if (onPopTipClickListener != null) {
                 boxBody.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -1098,4 +1116,14 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
         refreshUI();
         return this;
     }
+    
+    public PopTip setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

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

@@ -181,4 +181,14 @@ public class TipDialog extends WaitDialog {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
+    
+    public TipDialog setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

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

@@ -4,10 +4,13 @@ import android.animation.ValueAnimator;
 import android.app.Activity;
 import android.content.Context;
 import android.graphics.Color;
+import android.graphics.Outline;
+import android.graphics.drawable.GradientDrawable;
 import android.os.Handler;
 import android.os.Looper;
 import android.view.View;
 import android.view.ViewGroup;
+import android.view.ViewOutlineProvider;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.Animation;
 import android.view.animation.AnimationUtils;
@@ -54,6 +57,7 @@ public class WaitDialog extends BaseDialog {
     protected OnBindView<WaitDialog> onBindView;
     protected int customEnterAnimResId;
     protected int customExitAnimResId;
+    protected float backgroundRadius = -1;
     
     public enum TYPE {
         NONE,
@@ -449,6 +453,20 @@ public class WaitDialog extends BaseDialog {
                 progressView.progress(waitProgress);
                 oldProgress = waitProgress;
             }
+            if (backgroundRadius > -1) {
+                if (blurView != null) {
+                    blurView.setRadiusPx(backgroundRadius);
+                }
+                if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+                    bkg.setOutlineProvider(new ViewOutlineProvider() {
+                        @Override
+                        public void getOutline(View view, Outline outline) {
+                            outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), backgroundRadius);
+                        }
+                    });
+                    bkg.setClipToOutline(true);
+                }
+            }
             
             showText(txtInfo, message);
             useTextInfo(txtInfo, messageTextInfo);
@@ -1007,24 +1025,34 @@ public class WaitDialog extends BaseDialog {
         return this;
     }
     
-    public WaitDialog setMessageContent(CharSequence message){
+    public WaitDialog setMessageContent(CharSequence message) {
         this.message = message;
         refreshUI();
         return this;
     }
     
-    public WaitDialog setMessageContent(int messageResId){
+    public WaitDialog setMessageContent(int messageResId) {
         this.message = getString(messageResId);
         refreshUI();
         return this;
     }
     
-    public CharSequence getMessageContent(){
+    public CharSequence getMessageContent() {
         return message;
     }
     
-    public WaitDialog setTipType(TYPE type){
+    public WaitDialog setTipType(TYPE type) {
         showTip(type);
         return this;
     }
+    
+    public WaitDialog setBackgroundRadius(float radiusPx) {
+        backgroundRadius = radiusPx;
+        refreshUI();
+        return this;
+    }
+    
+    public float getBackgroundRadius() {
+        return backgroundRadius;
+    }
 }

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

@@ -19,7 +19,6 @@ import android.view.WindowInsets;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
 import android.widget.FrameLayout;
-import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import androidx.annotation.NonNull;
@@ -31,10 +30,10 @@ import androidx.lifecycle.LifecycleOwner;
 
 import com.kongzue.dialogx.DialogX;
 import com.kongzue.dialogx.R;
-import com.kongzue.dialogx.dialogs.PopTip;
 import com.kongzue.dialogx.impl.ActivityLifecycleImpl;
 import com.kongzue.dialogx.impl.DialogFragmentImpl;
 import com.kongzue.dialogx.util.ActivityRunnable;
+import com.kongzue.dialogx.util.DialogListBuilder;
 import com.kongzue.dialogx.util.DialogXFloatingWindowActivity;
 import com.kongzue.dialogx.util.TextInfo;
 import com.kongzue.dialogx.util.WindowUtil;
@@ -67,6 +66,7 @@ public abstract class BaseDialog {
     protected WeakReference<DialogFragmentImpl> ownDialogFragmentImpl;
     protected DialogX.IMPL_MODE dialogImplMode = DialogX.implIMPLMode;
     protected WeakReference<DialogXFloatingWindowActivity> floatingWindowActivity;
+    private WeakReference<DialogListBuilder> dialogListBuilder;
     
     public static void init(Context context) {
         if (context == null) {
@@ -385,6 +385,9 @@ public abstract class BaseDialog {
                 }, true);
                 break;
         }
+        if (baseDialog.getDialogListBuilder() != null && !baseDialog.getDialogListBuilder().isEmpty()) {
+            baseDialog.getDialogListBuilder().showNext();
+        }
     }
     
     private static void addDialogToRunningList(BaseDialog baseDialog) {
@@ -811,4 +814,25 @@ public abstract class BaseDialog {
         mMainHandler = new WeakReference<>(new Handler(Looper.getMainLooper()));
         return mMainHandler.get();
     }
+    
+    public DialogListBuilder getDialogListBuilder() {
+        if (dialogListBuilder == null) {
+            return null;
+        }
+        return dialogListBuilder.get();
+    }
+    
+    public void setDialogListBuilder(DialogListBuilder dialogListBuilder) {
+        this.dialogListBuilder = new WeakReference<>(dialogListBuilder);
+    }
+    
+    public void cleanDialogList() {
+        this.dialogListBuilder = null;
+    }
+    
+    public boolean isPreShow() {
+        return preShow;
+    }
+    
+    public abstract <D extends BaseDialog> D show();
 }

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

@@ -11,6 +11,6 @@ import android.view.View;
  */
 public interface OnDialogButtonClickListener<D extends BaseDialog> extends BaseOnDialogClickCallback{
     
-    boolean onClick(D baseDialog, View v);
+    boolean onClick(D dialog, View v);
     
 }

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

@@ -13,5 +13,5 @@ import com.kongzue.dialogx.dialogs.MessageDialog;
  */
 public interface OnInputDialogButtonClickListener<D extends BaseDialog> extends BaseOnDialogClickCallback{
     
-    boolean onClick(D baseDialog, View v, String inputStr);
+    boolean onClick(D dialog, View v, String inputStr);
 }

+ 62 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/DialogListBuilder.java

@@ -0,0 +1,62 @@
+package com.kongzue.dialogx.util;
+
+import com.kongzue.dialogx.interfaces.BaseDialog;
+
+import java.util.ArrayList;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2022/8/8 15:08
+ */
+public class DialogListBuilder {
+    
+    ArrayList<BaseDialog> dialogs;
+    
+    public static DialogListBuilder create(BaseDialog... dialogs) {
+        DialogListBuilder builder = new DialogListBuilder();
+        for (BaseDialog d : dialogs) {
+            builder.add(d);
+        }
+        return builder;
+    }
+    
+    public DialogListBuilder add(BaseDialog dialog) {
+        if (dialogs == null) {
+            dialogs = new ArrayList<>();
+        }
+        if (dialog.isShow() || dialog.isPreShow()) {
+            return this;
+        }
+        dialog.setDialogListBuilder(this);
+        dialogs.add(dialog);
+        return this;
+    }
+    
+    public DialogListBuilder show() {
+        if (dialogs == null || dialogs.isEmpty()) {
+            return this;
+        }
+        dialogs.get(0).show();
+        return this;
+    }
+    
+    public void showNext() {
+        if (dialogs == null || dialogs.isEmpty()) {
+            return;
+        }
+        dialogs.remove(dialogs.get(0));
+        if (!dialogs.isEmpty()) {
+            dialogs.get(0).show();
+        }
+    }
+    
+    public boolean isEmpty() {
+        if (dialogs == null) {
+            return true;
+        }
+        return dialogs.isEmpty();
+    }
+}

+ 35 - 0
app/src/main/java/com/kongzue/dialogxdemo/activity/MainActivity.java

@@ -140,6 +140,7 @@ public class MainActivity extends BaseActivity {
     private TextView btnContextMenu;
     private TextView btnSelectMenu;
     private TextView btnShowBreak;
+    private TextView btnListDialog;
     private TextView txtVer;
     
     @Override
@@ -198,6 +199,7 @@ public class MainActivity extends BaseActivity {
         btnContextMenu = findViewById(R.id.btn_contextMenu);
         btnSelectMenu = findViewById(R.id.btn_selectMenu);
         btnShowBreak = findViewById(R.id.btn_showBreak);
+        btnListDialog = findViewById(R.id.btn_listDialog);
         txtVer = findViewById(R.id.txt_ver);
     }
     
@@ -750,6 +752,39 @@ public class MainActivity extends BaseActivity {
                 jump(MainActivity.class, new JumpParameter().put("showBreak", true).put("fromActivity", getInstanceKey()));
             }
         });
+    
+        btnListDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                DialogX.showDialogList(
+                        MessageDialog.build().setTitle("提示").setMessage("这是一组消息对话框队列").setOkButton("开始").setCancelButton("取消")
+                                .setCancelButton(new OnDialogButtonClickListener<MessageDialog>() {
+                                    @Override
+                                    public boolean onClick(MessageDialog dialog, View v) {
+                                        dialog.cleanDialogList();
+                                        return false;
+                                    }
+                                }),
+                        PopTip.build().setMessage("每个对话框会依次显示"),
+                        PopNotification.build().setTitle("通知提示").setMessage("直到上一个对话框消失"),
+                        InputDialog.build().setTitle("请注意").setMessage("你必须使用 .build() 方法构建,并保证不要自己执行 .show() 方法").setInputText("输入文字").setOkButton("知道了"),
+                        TipDialog.build().setMessageContent("准备结束...").setTipType(WaitDialog.TYPE.SUCCESS),
+                        BottomDialog.build().setTitle("结束").setMessage("下滑以结束旅程,祝你编码愉快!").setCustomView(new OnBindView<BottomDialog>(R.layout.layout_custom_dialog) {
+                            @Override
+                            public void onBind(BottomDialog dialog, View v) {
+                                ImageView btnOk;
+                                btnOk = v.findViewById(R.id.btn_ok);
+                                btnOk.setOnClickListener(new View.OnClickListener() {
+                                    @Override
+                                    public void onClick(View v) {
+                                        dialog.dismiss();
+                                    }
+                                });
+                            }
+                        })
+                );
+            }
+        });
         
         btnFullScreenDialogLogin.setOnClickListener(new View.OnClickListener() {
             

+ 15 - 0
app/src/main/res/layout/activity_main.xml

@@ -946,6 +946,21 @@
                     android:textSize="13dp"
                     android:textStyle="bold" />
 
+                <TextView
+                    android:id="@+id/btn_listDialog"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_margin="5dp"
+                    android:background="@drawable/rect_button"
+                    android:paddingLeft="15dp"
+                    android:paddingTop="10dp"
+                    android:paddingRight="15dp"
+                    android:paddingBottom="10dp"
+                    android:text="队列对话框"
+                    android:textColor="@color/white"
+                    android:textSize="13dp"
+                    android:textStyle="bold" />
+
             </LinearLayout>
 
             <TextView

+ 1 - 1
gradle.properties

@@ -19,5 +19,5 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.46.beta2
+BUILD_VERSION=0.0.46.beta3
 BUILD_VERSION_INT=45