Browse Source

0.0.48.beta23
- 根据合理化建议,对 DialogXAnimInterface 完全自定义主题接口进行调整,从此版本起,不再需要“动画进度回调”,对话框将自动根据实际情况执行 dismiss 等操作,更新后去掉参数 `ObjectRunnable<Float> animProgress`,将增加提供 `ViewGroup dialogBodyView` 直接讲对话框内容实例化元素提供给开发者;
- 修复部分对话框组件可能因动画回调存在的隐形问题导致无法正常关闭,例如此前的 WaitDialog 就存在此问题,上述调整也是为了修复此问题由评估后做出的调整。

另外请注意:
⚠️ 以下非公开的内部组件或方法将在未来的版本废弃:
- BaseDialog.getContext()
- com.kongzue.dialogx.util.views.BlurView

Kongzue 2 years ago
parent
commit
900fa97a86

+ 49 - 56
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -206,12 +206,7 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
         if (isHide && getDialogView() != null && isShow) {
             if (hideWithExitAnim && getDialogImpl() != null) {
                 getDialogView().setVisibility(View.VISIBLE);
-                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, new ObjectRunnable<Float>() {
-                    @Override
-                    public void run(Float value) {
-                        getDialogImpl().boxRoot.setBkgAlpha(value);
-                    }
-                });
+                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, getDialogImpl().bkg);
             } else {
                 getDialogView().setVisibility(View.VISIBLE);
             }
@@ -451,18 +446,17 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
             boxBkg.post(new Runnable() {
                 @Override
                 public void run() {
-                    getDialogXAnimImpl().doShowAnim(BottomDialog.this, new ObjectRunnable<Float>() {
-                        @Override
-                        public void run(Float value) {
-                            boxRoot.setBkgAlpha(value);
-                            if (value == 1f) {
-                                bottomDialogTouchEventInterceptor = new BottomDialogTouchEventInterceptor(me, dialogImpl);
-                            }
-                        }
-                    });
+                    getDialogXAnimImpl().doShowAnim(BottomDialog.this, bkg);
                 }
             });
 
+            runOnMainDelay(new Runnable() {
+                @Override
+                public void run() {
+                    bottomDialogTouchEventInterceptor = new BottomDialogTouchEventInterceptor(me, dialogImpl);
+                }
+            }, getEnterAnimationDuration());
+
             onDialogInit();
         }
 
@@ -627,31 +621,20 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
             if (!dismissAnimFlag) {
                 dismissAnimFlag = true;
 
-                getDialogXAnimImpl().doExitAnim(BottomDialog.this, new ObjectRunnable<Float>() {
-                    @Override
-                    public void run(Float animatedValue) {
-                        if (boxRoot != null) {
-                            boxRoot.setBkgAlpha(animatedValue);
-                        }
-                        if (animatedValue == 0) {
-                            if (boxRoot != null) {
-                                boxRoot.setVisibility(View.GONE);
-                            }
-                            dismiss(dialogView);
-                        }
-                    }
-                });
+                getDialogXAnimImpl().doExitAnim(BottomDialog.this, bkg);
 
                 runOnMainDelay(new Runnable() {
                     @Override
                     public void run() {
+                        if (boxRoot != null) {
+                            boxRoot.setVisibility(View.GONE);
+                        }
+                        dismiss(dialogView);
                     }
-                }, exitAnimDurationTemp);
+                }, getExitAnimationDuration());
             }
         }
 
-        long exitAnimDurationTemp = 300;
-
         public void preDismiss() {
             if (isCancelable()) {
                 if (getDialogLifecycleCallback() instanceof BottomDialogSlideEventLifecycleCallback) {
@@ -679,8 +662,8 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
             if (dialogXAnimImpl == null) {
                 dialogXAnimImpl = new DialogXAnimInterface<BottomDialog>() {
                     @Override
-                    public void doShowAnim(BottomDialog dialog, ObjectRunnable<Float> animProgress) {
-                        long enterAnimDurationTemp = 300;
+                    public void doShowAnim(BottomDialog dialog, ViewGroup dialogBodyView) {
+                        long enterAnimDurationTemp = getEnterAnimationDuration();
 
                         float customDialogTop = 0;
                         if (dialog.isAllowInterceptTouch()) {
@@ -700,12 +683,6 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
 
                         //上移动画
                         ObjectAnimator enterAnim = ObjectAnimator.ofFloat(boxBkg, "y", getRootFrameLayout().getMeasuredHeight(), bkgEnterAimY = boxRoot.getUnsafePlace().top + customDialogTop);
-                        if (overrideEnterDuration >= 0) {
-                            enterAnimDurationTemp = overrideEnterDuration;
-                        }
-                        if (enterAnimDuration >= 0) {
-                            enterAnimDurationTemp = enterAnimDuration;
-                        }
                         enterAnim.setDuration(enterAnimDurationTemp);
                         enterAnim.setAutoCancel(true);
                         enterAnim.setInterpolator(new DecelerateInterpolator(2f));
@@ -717,20 +694,15 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
                         bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                             @Override
                             public void onAnimationUpdate(ValueAnimator animation) {
-                                animProgress.run((Float) animation.getAnimatedValue());
+                                boxRoot.setBkgAlpha((Float) animation.getAnimatedValue());
                             }
                         });
                         bkgAlpha.start();
                     }
 
                     @Override
-                    public void doExitAnim(BottomDialog dialog, ObjectRunnable<Float> animProgress) {
-                        if (overrideExitDuration >= 0) {
-                            exitAnimDurationTemp = overrideExitDuration;
-                        }
-                        if (exitAnimDuration >= 0) {
-                            exitAnimDurationTemp = exitAnimDuration;
-                        }
+                    public void doExitAnim(BottomDialog dialog, ViewGroup dialogBodyView) {
+                        long exitAnimDurationTemp = getExitAnimationDuration();
 
                         ObjectAnimator exitAnim = ObjectAnimator.ofFloat(boxBkg, "y", boxBkg.getY(), boxBkg.getHeight());
                         exitAnim.setDuration(exitAnimDurationTemp);
@@ -741,7 +713,7 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
                         bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                             @Override
                             public void onAnimationUpdate(ValueAnimator animation) {
-                                animProgress.run((Float) animation.getAnimatedValue());
+                                boxRoot.setBkgAlpha((Float) animation.getAnimatedValue());
                             }
                         });
                         bkgAlpha.start();
@@ -750,6 +722,28 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
             }
             return dialogXAnimImpl;
         }
+
+        public long getExitAnimationDuration() {
+            long exitAnimDurationTemp = 300;
+            if (overrideExitDuration >= 0) {
+                exitAnimDurationTemp = overrideExitDuration;
+            }
+            if (exitAnimDuration != -1) {
+                exitAnimDurationTemp = exitAnimDuration;
+            }
+            return exitAnimDurationTemp;
+        }
+
+        public long getEnterAnimationDuration() {
+            long enterAnimDurationTemp = 300;
+            if (overrideEnterDuration >= 0) {
+                enterAnimDurationTemp = overrideEnterDuration;
+            }
+            if (enterAnimDuration >= 0) {
+                enterAnimDurationTemp = enterAnimDuration;
+            }
+            return enterAnimDurationTemp;
+        }
     }
 
     public void refreshUI() {
@@ -1110,17 +1104,16 @@ public class BottomDialog extends BaseDialog implements DialogXBaseBottomDialog
         hideWithExitAnim = true;
         isHide = true;
         if (getDialogImpl() != null) {
-            getDialogImpl().getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
+            getDialogImpl().getDialogXAnimImpl().doExitAnim(me, getDialogImpl().bkg);
+
+            runOnMainDelay(new Runnable() {
                 @Override
-                public void run(Float value) {
-                    if (getDialogImpl().boxRoot != null) {
-                        getDialogImpl().boxRoot.setBkgAlpha(value);
-                    }
-                    if (value == 0 && getDialogView() != null) {
+                public void run() {
+                    if (getDialogView() != null) {
                         getDialogView().setVisibility(View.GONE);
                     }
                 }
-            });
+            }, getDialogImpl().getExitAnimationDuration());
         }
     }
 

+ 184 - 182
DialogX/src/main/java/com/kongzue/dialogx/dialogs/CustomDialog.java

@@ -14,6 +14,7 @@ import android.view.animation.DecelerateInterpolator;
 import android.widget.RelativeLayout;
 
 import androidx.annotation.ColorInt;
+import androidx.annotation.Nullable;
 import androidx.lifecycle.Lifecycle;
 
 import com.kongzue.dialogx.DialogX;
@@ -38,7 +39,7 @@ import com.kongzue.dialogx.util.views.MaxRelativeLayout;
  * @createTime: 2020/10/20 11:59
  */
 public class CustomDialog extends BaseDialog {
-    
+
     public static int overrideEnterDuration = -1;
     public static int overrideExitDuration = -1;
     public static int overrideEnterAnimRes = 0;
@@ -59,14 +60,14 @@ public class CustomDialog extends BaseDialog {
     protected boolean bkgInterceptTouch = true;
     protected OnBackgroundMaskClickListener<CustomDialog> onBackgroundMaskClickListener;
     protected DialogXAnimInterface<CustomDialog> dialogXAnimImpl;
-    
+
     protected View baseView;
     protected int alignViewGravity = -1;                                    //指定菜单相对 baseView 的位置
     protected int width = -1;                                               //指定菜单宽度
     protected int height = -1;                                              //指定菜单高度
     protected int[] baseViewLoc;
     protected int[] marginRelativeBaseView = new int[4];
-    
+
     public enum ALIGN {
         CENTER,
         TOP,
@@ -86,47 +87,41 @@ public class CustomDialog extends BaseDialog {
         RIGHT_TOP,
         RIGHT_BOTTOM
     }
-    
+
     protected CustomDialog() {
         super();
     }
-    
+
     public static CustomDialog build() {
         return new CustomDialog();
     }
-    
+
     public static CustomDialog build(OnBindView<CustomDialog> onBindView) {
         return new CustomDialog().setCustomView(onBindView);
     }
-    
+
     public CustomDialog(OnBindView<CustomDialog> onBindView) {
         this.onBindView = onBindView;
     }
-    
+
     public static CustomDialog show(OnBindView<CustomDialog> onBindView) {
         CustomDialog customDialog = new CustomDialog(onBindView);
         customDialog.show();
         return customDialog;
     }
-    
+
     public static CustomDialog show(OnBindView<CustomDialog> onBindView, ALIGN align) {
         CustomDialog customDialog = new CustomDialog(onBindView);
         customDialog.align = align;
         customDialog.show();
         return customDialog;
     }
-    
+
     public CustomDialog show() {
         if (isHide && getDialogView() != null && isShow) {
             if (hideWithExitAnim && getDialogImpl() != null && getDialogImpl().boxCustom != null) {
                 getDialogView().setVisibility(View.VISIBLE);
-                getDialogImpl().getDialogXAnimImpl().doShowAnim(CustomDialog.this, new ObjectRunnable<Float>() {
-                    @Override
-                    public void run(Float animProgress) {
-                        float value = animProgress;
-                        getDialogImpl().boxRoot.setBkgAlpha(value);
-                    }
-                });
+                getDialogImpl().getDialogXAnimImpl().doShowAnim(CustomDialog.this, getDialogImpl().boxCustom);
                 getDialogImpl().boxCustom.setVisibility(View.VISIBLE);
                 getDialogImpl().boxCustom.startAnimation(getEnterAnimation());
             } else {
@@ -143,7 +138,7 @@ public class CustomDialog extends BaseDialog {
         show(dialogView);
         return this;
     }
-    
+
     public CustomDialog show(Activity activity) {
         super.beforeShow();
         if (getDialogView() == null) {
@@ -154,25 +149,25 @@ public class CustomDialog extends BaseDialog {
         show(activity, dialogView);
         return this;
     }
-    
+
     private ViewTreeObserver viewTreeObserver;
     private ViewTreeObserver.OnDrawListener baseViewDrawListener;
-    
+
     public class DialogImpl implements DialogConvertViewInterface {
-        
+
         public DialogXBaseRelativeLayout boxRoot;
         public MaxRelativeLayout boxCustom;
-        
+
         public DialogImpl(View convertView) {
             if (convertView == null) return;
             boxRoot = convertView.findViewById(R.id.box_root);
             boxCustom = convertView.findViewById(R.id.box_custom);
-            
+
             init();
             dialogImpl = this;
             refreshView();
         }
-        
+
         @Override
         public void init() {
             if (baseViewLoc == null && baseView != null) {
@@ -187,16 +182,16 @@ public class CustomDialog extends BaseDialog {
                 public void onShow() {
                     isShow = true;
                     preShow = false;
-                    
+
                     setLifecycleState(Lifecycle.State.CREATED);
-                    
+
                     getDialogLifecycleCallback().onShow(me);
                     CustomDialog.this.onShow(me);
                     onDialogShow();
-                    
+
                     boxCustom.setVisibility(View.GONE);
                 }
-                
+
                 @Override
                 public void onDismiss() {
                     isShow = false;
@@ -208,7 +203,7 @@ public class CustomDialog extends BaseDialog {
                     System.gc();
                 }
             });
-            
+
             boxRoot.setOnBackPressedListener(new DialogXBaseRelativeLayout.PrivateBackPressedListener() {
                 @Override
                 public boolean onBackPressed() {
@@ -224,33 +219,25 @@ public class CustomDialog extends BaseDialog {
                     return true;
                 }
             });
-            
+
             boxRoot.post(new Runnable() {
                 @Override
                 public void run() {
-                    getDialogXAnimImpl().doShowAnim(CustomDialog.this, new ObjectRunnable<Float>() {
-                        @Override
-                        public void run(Float animProgress) {
-                            float value = animProgress;
-                            if (boxRoot != null) {
-                                boxRoot.setBkgAlpha(value);
-                            }
-                        }
-                    });
+                    getDialogXAnimImpl().doShowAnim(CustomDialog.this, boxCustom);
                     if (getDialogImpl().boxCustom != null) {
                         getDialogImpl().boxCustom.setVisibility(View.VISIBLE);
                     }
-                    
+
                     setLifecycleState(Lifecycle.State.RESUMED);
                 }
             });
-            
+
             onDialogInit();
         }
-        
+
         boolean initSetCustomViewLayoutListener = false;
         ALIGN alignCache;
-        
+
         @Override
         public void refreshView() {
             if (boxRoot == null || getOwnActivity() == null) {
@@ -264,7 +251,7 @@ public class CustomDialog extends BaseDialog {
                         rlp = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
                         boxCustom.setLayoutParams(rlp);
                     }
-                    
+
                     Runnable onLayoutChangeRunnable = new Runnable() {
                         @Override
                         public void run() {
@@ -282,7 +269,7 @@ public class CustomDialog extends BaseDialog {
                                     calX = (baseViewLeft + baseView.getMeasuredWidth() / 2 - boxCustom.getWidth() / 2);
                                     calY = (baseViewTop + baseView.getMeasuredHeight() / 2 - boxCustom.getHeight() / 2);
                                 }
-                                
+
                                 if (isAlignBaseViewGravity(Gravity.TOP)) {
                                     calY = baseViewTop - boxCustom.getHeight() - marginRelativeBaseView[3];
                                 }
@@ -299,15 +286,15 @@ public class CustomDialog extends BaseDialog {
                                 int heightCache = height == 0 ? baseView.getHeight() : height;
                                 baseViewLoc[2] = widthCache > 0 ? widthCache : baseViewLoc[2];
                                 baseViewLoc[3] = heightCache > 0 ? heightCache : baseViewLoc[3];
-                                
+
                                 if (calX != 0 && calX != boxCustom.getX()) boxCustom.setX(calX);
                                 if (calY != 0 && calY != boxCustom.getY()) boxCustom.setY(calY);
-                                
+
                                 onGetBaseViewLoc(baseViewLoc);
                             }
                         }
                     };
-                    
+
                     viewTreeObserver = boxCustom.getViewTreeObserver();
                     viewTreeObserver.addOnDrawListener(baseViewDrawListener = new ViewTreeObserver.OnDrawListener() {
                         @Override
@@ -394,7 +381,7 @@ public class CustomDialog extends BaseDialog {
                     boxCustom.setLayoutParams(rlp);
                 }
             }
-            
+
             boxRoot.setAutoUnsafePlacePadding(autoUnsafePlacePadding);
             if (bkgInterceptTouch) {
                 if (isCancelable()) {
@@ -412,30 +399,28 @@ public class CustomDialog extends BaseDialog {
             } else {
                 boxRoot.setClickable(false);
             }
-            
+
             if (onBindView != null && onBindView.getCustomView() != null && boxCustom != null) {
                 onBindView.bindParent(boxCustom, me);
             }
-            
+
             if (boxCustom != null) {
                 if (width != -1) {
                     boxCustom.setMaxWidth(width);
                     boxCustom.setMinimumWidth(width);
                 }
-                
+
                 if (height != -1) {
                     boxCustom.setMaxHeight(height);
                     boxCustom.setMinimumHeight(height);
                 }
             }
-            
+
             boxRoot.setBackgroundColor(getMaskColor());
-            
+
             onDialogRefreshUI();
         }
-        
-        long exitAnimDurationTemp = -1;
-        
+
         @Override
         public void doDismiss(View v) {
             if (v != null) v.setEnabled(false);
@@ -444,65 +429,61 @@ public class CustomDialog extends BaseDialog {
                 boxCustom.post(new Runnable() {
                     @Override
                     public void run() {
-                        getDialogXAnimImpl().doExitAnim(CustomDialog.this, new ObjectRunnable<Float>() {
-                            
+                        getDialogXAnimImpl().doExitAnim(CustomDialog.this, boxCustom);
+                        runOnMainDelay(new Runnable() {
                             @Override
-                            public void run(Float animProgress) {
-                                float value = animProgress;
-                                if (boxRoot != null) {
-                                    boxRoot.setBkgAlpha(value);
-                                }
-                                if (value == 0) {
-                                    if (boxRoot != null) boxRoot.setVisibility(View.GONE);
-                                    if (baseViewDrawListener != null) {
-                                        if (viewTreeObserver != null) {
-                                            removeDrawListener(viewTreeObserver, baseViewDrawListener);
-                                        } else {
-                                            if (boxCustom != null) {
-                                                removeDrawListener(boxCustom.getViewTreeObserver(), baseViewDrawListener);
-                                            }
+                            public void run() {
+                                if (boxRoot != null) boxRoot.setVisibility(View.GONE);
+                                if (baseViewDrawListener != null) {
+                                    if (viewTreeObserver != null) {
+                                        removeDrawListener(viewTreeObserver, baseViewDrawListener);
+                                    } else {
+                                        if (boxCustom != null) {
+                                            removeDrawListener(boxCustom.getViewTreeObserver(), baseViewDrawListener);
                                         }
-                                        baseViewDrawListener = null;
-                                        viewTreeObserver = null;
                                     }
-                                    dismiss(dialogView);
+                                    baseViewDrawListener = null;
+                                    viewTreeObserver = null;
                                 }
+                                dismiss(dialogView);
                             }
-                        });
+                        }, getExitAnimationDuration(null));
                     }
                 });
             }
         }
-        
+
         protected DialogXAnimInterface<CustomDialog> getDialogXAnimImpl() {
             if (dialogXAnimImpl == null) {
                 dialogXAnimImpl = new DialogXAnimInterface<CustomDialog>() {
                     @Override
-                    public void doShowAnim(CustomDialog customDialog, ObjectRunnable<Float> animProgress) {
+                    public void doShowAnim(CustomDialog customDialog, ViewGroup dialogBodyView) {
                         if (getDialogImpl() == null || getDialogImpl().boxCustom == null) {
                             return;
                         }
                         Animation enterAnim = getEnterAnimation();
+                        long enterAnimationDuration = getEnterAnimationDuration(enterAnim);
+                        enterAnim.setDuration(enterAnimationDuration);
                         if (boxCustom != null) {
                             boxCustom.setVisibility(View.VISIBLE);
                             boxCustom.startAnimation(enterAnim);
                         }
-                        
+
                         if (maskColor != Color.TRANSPARENT) boxRoot.setBackgroundColor(maskColor);
-                        
+
                         ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
-                        bkgAlpha.setDuration(enterAnim.getDuration());
+                        bkgAlpha.setDuration(enterAnimationDuration);
                         bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                             @Override
                             public void onAnimationUpdate(ValueAnimator animation) {
-                                animProgress.run((Float) animation.getAnimatedValue());
+                                boxRoot.setBkgAlpha((Float) animation.getAnimatedValue());
                             }
                         });
                         bkgAlpha.start();
                     }
-                    
+
                     @Override
-                    public void doExitAnim(CustomDialog customDialog, ObjectRunnable<Float> animProgress) {
+                    public void doExitAnim(CustomDialog customDialog, ViewGroup dialogBodyView) {
                         if (getDialogImpl() == null || getDialogImpl().boxCustom == null) {
                             return;
                         }
@@ -513,26 +494,23 @@ public class CustomDialog extends BaseDialog {
                         if (exitAnimResId != 0) {
                             exitAnimResIdTemp = exitAnimResId;
                         }
-                        
+
+                        long exitAnimDurationTemp;
                         if (boxCustom != null) {
                             Animation exitAnim = AnimationUtils.loadAnimation(getOwnActivity() == null ? boxCustom.getContext() : getOwnActivity(), exitAnimResIdTemp);
-                            exitAnimDurationTemp = exitAnim.getDuration();
-                            if (overrideExitDuration >= 0) {
-                                exitAnimDurationTemp = overrideExitDuration;
-                            }
-                            if (exitAnimDuration >= 0) {
-                                exitAnimDurationTemp = exitAnimDuration;
-                            }
+                            exitAnimDurationTemp = getExitAnimationDuration(exitAnim);
                             exitAnim.setDuration(exitAnimDurationTemp);
                             boxCustom.startAnimation(exitAnim);
+                        } else {
+                            exitAnimDurationTemp = getExitAnimationDuration(null);
                         }
-                        
+
                         ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1f, 0f);
                         bkgAlpha.setDuration(exitAnimDurationTemp);
                         bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                             @Override
                             public void onAnimationUpdate(ValueAnimator animation) {
-                                animProgress.run((Float) animation.getAnimatedValue());
+                                boxRoot.setBkgAlpha((Float) animation.getAnimatedValue());
                             }
                         });
                         bkgAlpha.start();
@@ -541,8 +519,36 @@ public class CustomDialog extends BaseDialog {
             }
             return dialogXAnimImpl;
         }
+
+        public long getExitAnimationDuration(@Nullable Animation defaultExitAnim) {
+            if (defaultExitAnim == null && boxCustom.getAnimation() != null) {
+                defaultExitAnim = boxCustom.getAnimation();
+            }
+            long exitAnimDurationTemp = (defaultExitAnim == null || defaultExitAnim.getDuration() == 0) ? 300 : defaultExitAnim.getDuration();
+            if (overrideExitDuration >= 0) {
+                exitAnimDurationTemp = overrideExitDuration;
+            }
+            if (exitAnimDuration != -1) {
+                exitAnimDurationTemp = exitAnimDuration;
+            }
+            return exitAnimDurationTemp;
+        }
+
+        public long getEnterAnimationDuration(@Nullable Animation defaultEnterAnim) {
+            if (defaultEnterAnim == null && boxCustom.getAnimation() != null) {
+                defaultEnterAnim = boxCustom.getAnimation();
+            }
+            long enterAnimDurationTemp = (defaultEnterAnim == null || defaultEnterAnim.getDuration() == 0) ? 300 : defaultEnterAnim.getDuration();
+            if (overrideEnterDuration >= 0) {
+                enterAnimDurationTemp = overrideEnterDuration;
+            }
+            if (enterAnimDuration >= 0) {
+                enterAnimDurationTemp = enterAnimDuration;
+            }
+            return enterAnimDurationTemp;
+        }
     }
-    
+
     private void removeDrawListener(ViewTreeObserver viewTreeObserver, ViewTreeObserver.OnDrawListener listener) {
         if (viewTreeObserver == null || listener == null || !viewTreeObserver.isAlive()) {
             return;
@@ -552,7 +558,7 @@ public class CustomDialog extends BaseDialog {
         } catch (Exception e) {
         }
     }
-    
+
     private Animation getEnterAnimation() {
         Animation enterAnim;
         if (enterAnimResId == R.anim.anim_dialogx_default_enter &&
@@ -610,15 +616,15 @@ public class CustomDialog extends BaseDialog {
         enterAnim.setDuration(enterAnimDurationTemp);
         return enterAnim;
     }
-    
+
     protected void onGetBaseViewLoc(int[] baseViewLoc) {
     }
-    
+
     @Override
     public String dialogKey() {
         return getClass().getSimpleName() + "(" + Integer.toHexString(hashCode()) + ")";
     }
-    
+
     public void refreshUI() {
         if (getDialogImpl() == null) return;
         runOnMain(new Runnable() {
@@ -628,7 +634,7 @@ public class CustomDialog extends BaseDialog {
             }
         });
     }
-    
+
     public void dismiss() {
         runOnMain(new Runnable() {
             @Override
@@ -638,38 +644,38 @@ public class CustomDialog extends BaseDialog {
             }
         });
     }
-    
+
     public DialogLifecycleCallback<CustomDialog> getDialogLifecycleCallback() {
         return dialogLifecycleCallback == null ? new DialogLifecycleCallback<CustomDialog>() {
         } : dialogLifecycleCallback;
     }
-    
+
     public CustomDialog setDialogLifecycleCallback(DialogLifecycleCallback<CustomDialog> dialogLifecycleCallback) {
         this.dialogLifecycleCallback = dialogLifecycleCallback;
         if (isShow) dialogLifecycleCallback.onShow(me);
         return this;
     }
-    
+
     public OnBackPressedListener<CustomDialog> getOnBackPressedListener() {
         return (OnBackPressedListener<CustomDialog>) onBackPressedListener;
     }
-    
+
     public CustomDialog setOnBackPressedListener(OnBackPressedListener<CustomDialog> onBackPressedListener) {
         this.onBackPressedListener = onBackPressedListener;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setStyle(DialogXStyle style) {
         this.style = style;
         return this;
     }
-    
+
     public CustomDialog setTheme(DialogX.THEME theme) {
         this.theme = theme;
         return this;
     }
-    
+
     public boolean isCancelable() {
         if (privateCancelable != null) {
             return privateCancelable == BOOLEAN.TRUE;
@@ -679,112 +685,112 @@ public class CustomDialog extends BaseDialog {
         }
         return cancelable;
     }
-    
+
     public CustomDialog setCancelable(boolean cancelable) {
         this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog.DialogImpl getDialogImpl() {
         return dialogImpl;
     }
-    
+
     public CustomDialog setCustomView(OnBindView<CustomDialog> onBindView) {
         this.onBindView = onBindView;
         refreshUI();
         return this;
     }
-    
+
     public View getCustomView() {
         if (onBindView == null) return null;
         return onBindView.getCustomView();
     }
-    
+
     public CustomDialog removeCustomView() {
         this.onBindView.clean();
         refreshUI();
         return this;
     }
-    
+
     public int getEnterAnimResId() {
         return enterAnimResId;
     }
-    
+
     public CustomDialog setEnterAnimResId(int enterAnimResId) {
         this.enterAnimResId = enterAnimResId;
         return this;
     }
-    
+
     public int getExitAnimResId() {
         return exitAnimResId;
     }
-    
+
     public CustomDialog setExitAnimResId(int exitAnimResId) {
         this.exitAnimResId = exitAnimResId;
         return this;
     }
-    
+
     public CustomDialog setAnimResId(int enterAnimResId, int exitAnimResId) {
         this.enterAnimResId = enterAnimResId;
         this.exitAnimResId = exitAnimResId;
         return this;
     }
-    
+
     public ALIGN getAlign() {
         return align;
     }
-    
+
     public CustomDialog setAlign(ALIGN align) {
         this.align = align;
         refreshUI();
         return this;
     }
-    
+
     public boolean isAutoUnsafePlacePadding() {
         return autoUnsafePlacePadding;
     }
-    
+
     public CustomDialog setAutoUnsafePlacePadding(boolean autoUnsafePlacePadding) {
         this.autoUnsafePlacePadding = autoUnsafePlacePadding;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setFullScreen(boolean fullscreen) {
         this.autoUnsafePlacePadding = !autoUnsafePlacePadding;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setMaskColor(@ColorInt int maskColor) {
         this.maskColor = maskColor;
         refreshUI();
         return this;
     }
-    
+
     public int getMaskColor() {
         return maskColor;
     }
-    
+
     public long getEnterAnimDuration() {
         return enterAnimDuration;
     }
-    
+
     public CustomDialog setEnterAnimDuration(long enterAnimDuration) {
         this.enterAnimDuration = enterAnimDuration;
         return this;
     }
-    
+
     public long getExitAnimDuration() {
         return exitAnimDuration;
     }
-    
+
     public CustomDialog setExitAnimDuration(long exitAnimDuration) {
         this.exitAnimDuration = exitAnimDuration;
         return this;
     }
-    
+
     @Override
     public void restartDialog() {
         if (dialogView != null) {
@@ -807,16 +813,16 @@ public class CustomDialog extends BaseDialog {
         if (getDialogImpl() != null && getDialogImpl().boxCustom != null) {
             getDialogImpl().boxCustom.removeAllViews();
         }
-        
+
         enterAnimDuration = 0;
         dialogView = createView(R.layout.layout_dialogx_custom);
         dialogImpl = new DialogImpl(dialogView);
         if (dialogView != null) dialogView.setTag(me);
         show(dialogView);
     }
-    
+
     private boolean isHide;
-    
+
     public void hide() {
         isHide = true;
         hideWithExitAnim = false;
@@ -824,54 +830,50 @@ public class CustomDialog extends BaseDialog {
             getDialogView().setVisibility(View.GONE);
         }
     }
-    
+
     protected boolean hideWithExitAnim;
-    
+
     public void hideWithExitAnim() {
         hideWithExitAnim = true;
         isHide = true;
         if (getDialogImpl() != null) {
-            getDialogImpl().getDialogXAnimImpl().doExitAnim(CustomDialog.this, new ObjectRunnable<Float>() {
+            getDialogImpl().getDialogXAnimImpl().doExitAnim(CustomDialog.this, getDialogImpl().boxCustom);
+
+            runOnMainDelay(new Runnable() {
                 @Override
-                public void run(Float animProgress) {
-                    float value = animProgress;
-                    if (getDialogImpl().boxRoot != null) {
-                        getDialogImpl().boxRoot.setBkgAlpha(value);
-                    }
-                    if (value == 0) {
-                        if (getDialogView() != null) {
-                            getDialogView().setVisibility(View.GONE);
-                        }
+                public void run() {
+                    if (getDialogView() != null) {
+                        getDialogView().setVisibility(View.GONE);
                     }
                 }
-            });
+            }, getDialogImpl().getExitAnimationDuration(null));
         }
     }
-    
+
     @Override
     protected void shutdown() {
         dismiss();
     }
-    
+
     public CustomDialog setDialogImplMode(DialogX.IMPL_MODE dialogImplMode) {
         this.dialogImplMode = dialogImplMode;
         return this;
     }
-    
+
     public boolean isBkgInterceptTouch() {
         return bkgInterceptTouch;
     }
-    
+
     public CustomDialog setBkgInterceptTouch(boolean bkgInterceptTouch) {
         this.bkgInterceptTouch = bkgInterceptTouch;
         refreshUI();
         return this;
     }
-    
+
     public int getAlignBaseViewGravity() {
         return alignViewGravity;
     }
-    
+
     /**
      * 判断是否有设置对应的位置关系
      *
@@ -881,7 +883,7 @@ public class CustomDialog extends BaseDialog {
     public boolean isAlignBaseViewGravity(int gravity) {
         return (alignViewGravity & gravity) == gravity;
     }
-    
+
     public CustomDialog setAlignBaseViewGravity(View baseView, int alignGravity) {
         this.baseView = baseView;
         this.alignViewGravity = alignGravity;
@@ -890,7 +892,7 @@ public class CustomDialog extends BaseDialog {
         setFullScreen(true);
         return this;
     }
-    
+
     public CustomDialog setAlignBaseView(View baseView) {
         this.baseView = baseView;
         baseViewLoc = new int[4];
@@ -898,7 +900,7 @@ public class CustomDialog extends BaseDialog {
         setFullScreen(true);
         return this;
     }
-    
+
     public CustomDialog setAlignBaseViewGravity(int alignGravity) {
         this.alignViewGravity = alignGravity;
         if (baseView != null) {
@@ -908,79 +910,79 @@ public class CustomDialog extends BaseDialog {
         setFullScreen(true);
         return this;
     }
-    
+
     public CustomDialog setAlignBaseViewGravity(View baseView, int alignGravity, int marginLeft,
                                                 int marginTop, int marginRight, int marginBottom) {
         this.marginRelativeBaseView = new int[]{marginLeft, marginTop, marginRight, marginBottom};
         refreshUI();
         return setAlignBaseViewGravity(baseView, alignGravity);
     }
-    
+
     public int[] getBaseViewMargin() {
         return marginRelativeBaseView;
     }
-    
+
     public CustomDialog setBaseViewMargin(int[] marginRelativeBaseView) {
         this.marginRelativeBaseView = marginRelativeBaseView;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setBaseViewMargin(int marginLeft, int marginTop,
                                           int marginRight, int marginBottom) {
         this.marginRelativeBaseView = new int[]{marginLeft, marginTop, marginRight, marginBottom};
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setBaseViewMarginLeft(int marginLeft) {
         this.marginRelativeBaseView[0] = marginLeft;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setBaseViewMarginTop(int marginTop) {
         this.marginRelativeBaseView[1] = marginTop;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setBaseViewMarginRight(int marginRight) {
         this.marginRelativeBaseView[2] = marginRight;
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setBaseViewMarginBottom(int marginBottom) {
         this.marginRelativeBaseView[3] = marginBottom;
         refreshUI();
         return this;
     }
-    
+
     public int getBaseViewMarginLeft(int marginLeft) {
         return this.marginRelativeBaseView[0];
     }
-    
+
     public int getBaseViewMarginTop(int marginLeft) {
         return this.marginRelativeBaseView[1];
     }
-    
+
     public int getBaseViewMarginRight(int marginLeft) {
         return this.marginRelativeBaseView[2];
     }
-    
+
     public int getBaseViewMarginBottom(int marginLeft) {
         return this.marginRelativeBaseView[3];
     }
-    
+
     public View getBaseView() {
         return baseView;
     }
-    
+
     public int getWidth() {
         return width;
     }
-    
+
     /**
      * 设置对话框 UI 宽度(单位:像素)
      *
@@ -992,11 +994,11 @@ public class CustomDialog extends BaseDialog {
         refreshUI();
         return this;
     }
-    
+
     public int getHeight() {
         return height;
     }
-    
+
     /**
      * 设置对话框 UI 高度(单位:像素)
      *
@@ -1008,37 +1010,37 @@ public class CustomDialog extends BaseDialog {
         refreshUI();
         return this;
     }
-    
+
     public OnBackgroundMaskClickListener<CustomDialog> getOnBackgroundMaskClickListener() {
         return onBackgroundMaskClickListener;
     }
-    
+
     public CustomDialog setOnBackgroundMaskClickListener(OnBackgroundMaskClickListener<CustomDialog> onBackgroundMaskClickListener) {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
-    
+
     public DialogXAnimInterface<CustomDialog> getDialogXAnimImpl() {
         return dialogXAnimImpl;
     }
-    
+
     public CustomDialog setDialogXAnimImpl(DialogXAnimInterface<CustomDialog> dialogXAnimImpl) {
         this.dialogXAnimImpl = dialogXAnimImpl;
         return this;
     }
-    
+
     public CustomDialog setRootPadding(int padding) {
         this.screenPaddings = new int[]{padding, padding, padding, padding};
         refreshUI();
         return this;
     }
-    
+
     public CustomDialog setRootPadding(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) {
         this.screenPaddings = new int[]{paddingLeft, paddingTop, paddingRight, paddingBottom};
         refreshUI();
         return this;
     }
-    
+
     /**
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
@@ -1051,9 +1053,9 @@ public class CustomDialog extends BaseDialog {
      * }
      */
     public void onShow(CustomDialog dialog) {
-    
+
     }
-    
+
     /**
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
@@ -1075,6 +1077,6 @@ public class CustomDialog extends BaseDialog {
      */
     //用于使用 new 构建实例时,override 的生命周期事件
     public void onDismiss(CustomDialog dialog) {
-    
+
     }
 }

+ 65 - 62
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -13,11 +13,13 @@ import android.os.Looper;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewOutlineProvider;
+import android.view.animation.Animation;
 import android.view.animation.DecelerateInterpolator;
 import android.widget.RelativeLayout;
 
 import androidx.annotation.ColorInt;
 import androidx.annotation.ColorRes;
+import androidx.annotation.Nullable;
 import androidx.lifecycle.Lifecycle;
 
 import com.kongzue.dialogx.DialogX;
@@ -94,7 +96,7 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
         if (isHide && getDialogView() != null && isShow) {
             if (hideWithExitAnim && getDialogImpl() != null) {
                 getDialogView().setVisibility(View.VISIBLE);
-                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, null);
+                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, getDialogImpl().bkg);
             } else {
                 getDialogView().setVisibility(View.VISIBLE);
             }
@@ -161,7 +163,6 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
         }
 
         public float bkgEnterAimY = -1;
-        private long enterAnimDurationTemp = 300;
         protected int enterY;
 
         public float getEnterY() {
@@ -214,21 +215,13 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
             });
 
             fullScreenDialogTouchEventInterceptor = new FullScreenDialogTouchEventInterceptor(me, dialogImpl);
-
-            enterAnimDurationTemp = 300;
-            if (overrideEnterDuration >= 0) {
-                enterAnimDurationTemp = overrideEnterDuration;
-            }
-            if (enterAnimDuration >= 0) {
-                enterAnimDurationTemp = enterAnimDuration;
-            }
             boxRoot.setBkgAlpha(0f);
 
             bkg.setY(boxRoot.getHeight());
             boxRoot.post(new Runnable() {
                 @Override
                 public void run() {
-                    getDialogXAnimImpl().doShowAnim(me, null);
+                    getDialogXAnimImpl().doShowAnim(me, bkg);
                     setLifecycleState(Lifecycle.State.RESUMED);
                 }
             });
@@ -268,31 +261,6 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
             return false;
         }
 
-        private boolean enterAnimRunning = true;
-
-        private void showEnterAnim() {
-            makeEnterY();
-            bkgEnterAimY = boxRoot.getSafeHeight() - enterY;
-            if (bkgEnterAimY < 0) bkgEnterAimY = 0;
-            ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", boxRoot.getHeight(), bkgEnterAimY);
-            enterAnim.setDuration(enterAnimDurationTemp);
-            enterAnim.setInterpolator(new DecelerateInterpolator());
-            enterAnim.start();
-            bkg.setVisibility(View.VISIBLE);
-
-            ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
-            bkgAlpha.setDuration(enterAnimDurationTemp);
-            bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
-                @Override
-                public void onAnimationUpdate(ValueAnimator animation) {
-                    float value = (float) animation.getAnimatedValue();
-                    boxRoot.setBkgAlpha(value);
-                    enterAnimRunning = !(value == 1f);
-                }
-            });
-            bkgAlpha.start();
-        }
-
         private void makeEnterY() {
             int customViewHeight = boxCustom.getHeight();
 
@@ -381,20 +349,17 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
 
             if (!dismissAnimFlag) {
                 dismissAnimFlag = true;
-                getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
+                getDialogXAnimImpl().doExitAnim(me, bkg);
+
+                runOnMainDelay(new Runnable() {
                     @Override
-                    public void run(Float value) {
+                    public void run() {
                         if (boxRoot != null) {
-                            boxRoot.setBkgAlpha(value);
-                        }
-                        if (value == 0) {
-                            if (boxRoot != null) {
-                                boxRoot.setVisibility(View.GONE);
-                            }
-                            dismiss(dialogView);
+                            boxRoot.setVisibility(View.GONE);
                         }
+                        dismiss(dialogView);
                     }
-                });
+                }, getExitAnimationDuration());
             }
         }
 
@@ -416,23 +381,39 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
             }
         }
 
+        private boolean enterAnimRunning = true;
+
         protected DialogXAnimInterface<FullScreenDialog> getDialogXAnimImpl() {
             if (dialogXAnimImpl == null) {
                 dialogXAnimImpl = new DialogXAnimInterface<FullScreenDialog>() {
                     @Override
-                    public void doShowAnim(FullScreenDialog dialog, ObjectRunnable<Float> animProgress) {
-                        showEnterAnim();
+                    public void doShowAnim(FullScreenDialog dialog, ViewGroup dialogBodyView) {
+                        long enterAnimDurationTemp = getEnterAnimationDuration();
+                        makeEnterY();
+                        bkgEnterAimY = boxRoot.getSafeHeight() - enterY;
+                        if (bkgEnterAimY < 0) bkgEnterAimY = 0;
+                        ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", boxRoot.getHeight(), bkgEnterAimY);
+                        enterAnim.setDuration(enterAnimDurationTemp);
+                        enterAnim.setInterpolator(new DecelerateInterpolator());
+                        enterAnim.start();
+                        bkg.setVisibility(View.VISIBLE);
+
+                        ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
+                        bkgAlpha.setDuration(enterAnimDurationTemp);
+                        bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+                            @Override
+                            public void onAnimationUpdate(ValueAnimator animation) {
+                                float value = (float) animation.getAnimatedValue();
+                                boxRoot.setBkgAlpha(value);
+                                enterAnimRunning = !(value == 1f);
+                            }
+                        });
+                        bkgAlpha.start();
                     }
 
                     @Override
-                    public void doExitAnim(FullScreenDialog dialog, ObjectRunnable<Float> animProgress) {
-                        long exitAnimDurationTemp = 300;
-                        if (overrideExitDuration >= 0) {
-                            exitAnimDurationTemp = overrideExitDuration;
-                        }
-                        if (exitAnimDuration >= 0) {
-                            exitAnimDurationTemp = exitAnimDuration;
-                        }
+                    public void doExitAnim(FullScreenDialog dialog, ViewGroup dialogBodyView) {
+                        long exitAnimDurationTemp = getExitAnimationDuration();
 
                         ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), boxBkg.getHeight());
                         exitAnim.setDuration(exitAnimDurationTemp);
@@ -444,7 +425,7 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
                             @Override
                             public void onAnimationUpdate(ValueAnimator animation) {
                                 float value = (float) animation.getAnimatedValue();
-                                animProgress.run(value);
+                                boxRoot.setBkgAlpha(value);
                                 enterAnimRunning = !(value == 1f);
                             }
                         });
@@ -454,6 +435,28 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
             }
             return dialogXAnimImpl;
         }
+
+        public long getExitAnimationDuration() {
+            long exitAnimDurationTemp = 300;
+            if (overrideExitDuration >= 0) {
+                exitAnimDurationTemp = overrideExitDuration;
+            }
+            if (exitAnimDuration != -1) {
+                exitAnimDurationTemp = exitAnimDuration;
+            }
+            return exitAnimDurationTemp;
+        }
+
+        public long getEnterAnimationDuration() {
+            long enterAnimDurationTemp = 300;
+            if (overrideEnterDuration >= 0) {
+                enterAnimDurationTemp = overrideEnterDuration;
+            }
+            if (enterAnimDuration >= 0) {
+                enterAnimDurationTemp = enterAnimDuration;
+            }
+            return enterAnimDurationTemp;
+        }
     }
 
     @Override
@@ -625,15 +628,15 @@ public class FullScreenDialog extends BaseDialog implements DialogXBaseBottomDia
         hideWithExitAnim = true;
         isHide = true;
         if (getDialogImpl() != null) {
-            getDialogImpl().getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
+            getDialogImpl().getDialogXAnimImpl().doExitAnim(me, getDialogImpl().bkg);
+            runOnMainDelay(new Runnable() {
                 @Override
-                public void run(Float value) {
-                    getDialogImpl().boxRoot.setBkgAlpha(value);
-                    if (value == 0 && getDialogView() != null) {
+                public void run() {
+                    if (getDialogView() != null) {
                         getDialogView().setVisibility(View.GONE);
                     }
                 }
-            });
+            }, getDialogImpl().getExitAnimationDuration());
         }
     }
 

File diff suppressed because it is too large
+ 179 - 177
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java


+ 62 - 46
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopMenu.java

@@ -23,6 +23,7 @@ import android.widget.AdapterView;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import androidx.annotation.Nullable;
 import androidx.lifecycle.Lifecycle;
 
 import com.kongzue.dialogx.DialogX;
@@ -217,12 +218,7 @@ public class PopMenu extends BaseDialog {
                 getDialogImpl().boxBody.clearAnimation();
                 getDialogView().setVisibility(View.VISIBLE);
                 getDialogImpl().boxRoot.animate().alpha(1f);
-                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, new ObjectRunnable<Float>() {
-                    @Override
-                    public void run(Float value) {
-                        getDialogImpl().boxRoot.setBkgAlpha(value);
-                    }
-                });
+                getDialogImpl().getDialogXAnimImpl().doShowAnim(me, getDialogImpl().boxBody);
             } else {
                 getDialogView().setVisibility(View.VISIBLE);
             }
@@ -501,12 +497,7 @@ public class PopMenu extends BaseDialog {
 
                 @Override
                 public void run() {
-                    getDialogXAnimImpl().doShowAnim(me, new ObjectRunnable<Float>() {
-                        @Override
-                        public void run(Float value) {
-                            boxRoot.setBkgAlpha(value);
-                        }
-                    });
+                    getDialogXAnimImpl().doShowAnim(me, boxBody);
                     setLifecycleState(Lifecycle.State.RESUMED);
                 }
             });
@@ -619,28 +610,25 @@ public class PopMenu extends BaseDialog {
                 boxRoot.post(new Runnable() {
                     @Override
                     public void run() {
-                        getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
+                        getDialogXAnimImpl().doExitAnim(me, boxBody);
+
+                        runOnMainDelay(new Runnable() {
                             @Override
-                            public void run(Float value) {
-                                if (boxRoot != null && baseView == null) {
-                                    boxRoot.setBkgAlpha(value);
-                                }
-                                if (value == 0f) {
-                                    if (baseViewDrawListener != null) {
-                                        if (viewTreeObserver != null) {
-                                            removeDrawListener(viewTreeObserver, baseViewDrawListener);
-                                        } else {
-                                            if (baseView != null) {
-                                                removeDrawListener(baseView.getViewTreeObserver(), baseViewDrawListener);
-                                            }
+                            public void run() {
+                                if (baseViewDrawListener != null) {
+                                    if (viewTreeObserver != null) {
+                                        removeDrawListener(viewTreeObserver, baseViewDrawListener);
+                                    } else {
+                                        if (baseView != null) {
+                                            removeDrawListener(baseView.getViewTreeObserver(), baseViewDrawListener);
                                         }
-                                        baseViewDrawListener = null;
-                                        viewTreeObserver = null;
                                     }
-                                    dismiss(dialogView);
+                                    baseViewDrawListener = null;
+                                    viewTreeObserver = null;
                                 }
+                                dismiss(dialogView);
                             }
-                        });
+                        }, getExitAnimationDuration(null));
                     }
                 });
             }
@@ -653,8 +641,8 @@ public class PopMenu extends BaseDialog {
                     int selectMenuIndex = -1;
 
                     @Override
-                    public void doShowAnim(PopMenu dialog, ObjectRunnable<Float> animProgress) {
-                        long enterAnimDurationTemp = enterAnimDuration != -1 ? enterAnimDuration : (overrideEnterDuration == -1 ? 150 : overrideEnterDuration);
+                    public void doShowAnim(PopMenu dialog, ViewGroup dialogBodyView) {
+                        long enterAnimDurationTemp = getEnterAnimationDuration(null);
 
                         if (baseView != null) {
                             //有绑定按钮的情况下
@@ -786,7 +774,8 @@ public class PopMenu extends BaseDialog {
                             bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                                 @Override
                                 public void onAnimationUpdate(ValueAnimator animation) {
-                                    animProgress.run((Float) animation.getAnimatedValue());
+                                    boxRoot.setBkgAlpha((Float) animation.getAnimatedValue());
+                                    ;
                                 }
                             });
                             bkgAlpha.start();
@@ -794,27 +783,25 @@ public class PopMenu extends BaseDialog {
                     }
 
                     @Override
-                    public void doExitAnim(PopMenu dialog, ObjectRunnable<Float> animProgress) {
-                        if (overrideExitDuration != -1) {
-                            exitAnimDuration = overrideExitDuration;
-                        }
+                    public void doExitAnim(PopMenu dialog, ViewGroup dialogBodyView) {
                         Animation exitAnim = AnimationUtils.loadAnimation(getOwnActivity() == null ? boxRoot.getContext() : getOwnActivity(), R.anim.anim_dialogx_default_exit);
-                        if (exitAnimDuration != -1) {
-                            exitAnim.setDuration(exitAnimDuration);
-                        }
+                        long exitAnimDuration = getExitAnimationDuration(exitAnim);
+                        exitAnim.setDuration(exitAnimDuration);
                         boxBody.startAnimation(exitAnim);
 
                         boxRoot.animate()
                                 .alpha(0f)
                                 .setInterpolator(new AccelerateInterpolator())
-                                .setDuration(exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
+                                .setDuration(exitAnimDuration);
 
                         ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1, 0f);
-                        bkgAlpha.setDuration(exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
+                        bkgAlpha.setDuration(exitAnimDuration);
                         bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                             @Override
                             public void onAnimationUpdate(ValueAnimator animation) {
-                                animProgress.run((Float) animation.getAnimatedValue());
+                                if (boxRoot != null && baseView == null) {
+                                    boxRoot.setBkgAlpha((Float) animation.getAnimatedValue());
+                                }
                             }
                         });
                         bkgAlpha.start();
@@ -823,6 +810,34 @@ public class PopMenu extends BaseDialog {
             }
             return dialogXAnimImpl;
         }
+
+        public long getExitAnimationDuration(@Nullable Animation defaultExitAnim) {
+            if (defaultExitAnim == null && boxBody.getAnimation() != null) {
+                defaultExitAnim = boxBody.getAnimation();
+            }
+            long exitAnimDurationTemp = (defaultExitAnim == null || defaultExitAnim.getDuration() == 0) ? 150 : defaultExitAnim.getDuration();
+            if (overrideExitDuration >= 0) {
+                exitAnimDurationTemp = overrideExitDuration;
+            }
+            if (exitAnimDuration != -1) {
+                exitAnimDurationTemp = exitAnimDuration;
+            }
+            return exitAnimDurationTemp;
+        }
+
+        public long getEnterAnimationDuration(@Nullable Animation defaultEnterAnim) {
+            if (defaultEnterAnim == null && boxBody.getAnimation() != null) {
+                defaultEnterAnim = boxBody.getAnimation();
+            }
+            long enterAnimDurationTemp = (defaultEnterAnim == null || defaultEnterAnim.getDuration() == 0) ? 150 : defaultEnterAnim.getDuration();
+            if (overrideEnterDuration >= 0) {
+                enterAnimDurationTemp = overrideEnterDuration;
+            }
+            if (enterAnimDuration >= 0) {
+                enterAnimDurationTemp = enterAnimDuration;
+            }
+            return enterAnimDurationTemp;
+        }
     }
 
     private void removeDrawListener(ViewTreeObserver viewTreeObserver, ViewTreeObserver.OnDrawListener listener) {
@@ -1155,14 +1170,15 @@ public class PopMenu extends BaseDialog {
         hideWithExitAnim = true;
         isHide = true;
         if (getDialogImpl() != null) {
-            getDialogImpl().getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
+            getDialogImpl().getDialogXAnimImpl().doExitAnim(me, getDialogImpl().boxBody);
+            runOnMainDelay(new Runnable() {
                 @Override
-                public void run(Float value) {
-                    if (value == 0 && getDialogView() != null) {
+                public void run() {
+                    if (getDialogView() != null) {
                         getDialogView().setVisibility(View.GONE);
                     }
                 }
-            });
+            }, getDialogImpl().getExitAnimationDuration(null));
         }
     }
 

+ 65 - 51
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopNotification.java

@@ -24,6 +24,7 @@ import android.widget.TextView;
 
 import androidx.annotation.ColorInt;
 import androidx.annotation.ColorRes;
+import androidx.annotation.Nullable;
 import androidx.lifecycle.Lifecycle;
 
 import com.kongzue.dialogx.DialogX;
@@ -463,12 +464,12 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
         autoDismiss(autoDismissDelay);
     }
 
-    private boolean isNoSetCustomDelay(){
+    private boolean isNoSetCustomDelay() {
         return autoDismissDelay == Long.MIN_VALUE;
     }
 
     public PopNotification showShort() {
-        if (isNoSetCustomDelay())autoDismiss(2000);
+        if (isNoSetCustomDelay()) autoDismiss(2000);
         if (!preShow && !isShow) {
             show();
         }
@@ -606,12 +607,7 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
             boxRoot.post(new Runnable() {
                 @Override
                 public void run() {
-                    getDialogXAnimImpl().doShowAnim(me, new ObjectRunnable<Float>() {
-                        @Override
-                        public void run(Float aFloat) {
-
-                        }
-                    });
+                    getDialogXAnimImpl().doShowAnim(me, boxBody);
 
                     if (!DialogX.onlyOnePopNotification) {
                         if (popNotificationList != null) {
@@ -819,14 +815,14 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
                 boxRoot.post(new Runnable() {
                     @Override
                     public void run() {
-                        getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
+                        getDialogXAnimImpl().doExitAnim(me, boxBody);
+
+                        runOnMainDelay(new Runnable() {
                             @Override
-                            public void run(Float value) {
-                                if (value == 0f) {
-                                    waitForDismiss();
-                                }
+                            public void run() {
+                                waitForDismiss();
                             }
-                        });
+                        }, getExitAnimationDuration(null));
                     }
                 });
             }
@@ -836,47 +832,66 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
             if (dialogXAnimImpl == null) {
                 dialogXAnimImpl = new DialogXAnimInterface<PopNotification>() {
                     @Override
-                    public void doShowAnim(PopNotification dialog, ObjectRunnable<Float> animProgress) {
+                    public void doShowAnim(PopNotification dialog, ViewGroup dialogBodyView) {
                         Animation enterAnim = AnimationUtils.loadAnimation(getOwnActivity(), enterAnimResId == 0 ? R.anim.anim_dialogx_notification_enter : enterAnimResId);
+                        long enterAnimDuration = getEnterAnimationDuration(enterAnim);
                         enterAnim.setInterpolator(new DecelerateInterpolator(2f));
-                        if (enterAnimDuration != -1) {
-                            enterAnim.setDuration(enterAnimDuration);
-                        }
+                        enterAnim.setDuration(enterAnimDuration);
                         enterAnim.setFillAfter(true);
                         boxBody.startAnimation(enterAnim);
 
                         boxRoot.animate()
-                                .setDuration(enterAnimDuration == -1 ? enterAnim.getDuration() : enterAnimDuration)
+                                .setDuration(enterAnimDuration)
                                 .alpha(1f)
                                 .setInterpolator(new DecelerateInterpolator())
                                 .setListener(null);
                     }
 
                     @Override
-                    public void doExitAnim(PopNotification dialog, ObjectRunnable<Float> animProgress) {
+                    public void doExitAnim(PopNotification dialog, ViewGroup dialogBodyView) {
                         Animation exitAnim = AnimationUtils.loadAnimation(getOwnActivity() == null ? boxRoot.getContext() : getOwnActivity(), exitAnimResId == 0 ? R.anim.anim_dialogx_notification_exit : exitAnimResId);
-                        if (exitAnimDuration != -1) {
-                            exitAnim.setDuration(exitAnimDuration);
-                        }
+                        long exitAnimDuration = getExitAnimationDuration(exitAnim);
+                        exitAnim.setDuration(exitAnimDuration);
                         exitAnim.setFillAfter(true);
                         boxBody.startAnimation(exitAnim);
 
                         boxRoot.animate()
                                 .alpha(0f)
                                 .setInterpolator(new AccelerateInterpolator())
-                                .setDuration(exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
-
-                        runOnMainDelay(new Runnable() {
-                            @Override
-                            public void run() {
-                                animProgress.run(0f);
-                            }
-                        }, exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
+                                .setDuration(exitAnimDuration);
                     }
                 };
             }
             return dialogXAnimImpl;
         }
+
+        public long getExitAnimationDuration(@Nullable Animation defaultExitAnim) {
+            if (defaultExitAnim == null && boxBody.getAnimation() != null) {
+                defaultExitAnim = boxBody.getAnimation();
+            }
+            long exitAnimDurationTemp = (defaultExitAnim == null || defaultExitAnim.getDuration() == 0) ? 300 : defaultExitAnim.getDuration();
+            if (overrideExitDuration >= 0) {
+                exitAnimDurationTemp = overrideExitDuration;
+            }
+            if (exitAnimDuration != -1) {
+                exitAnimDurationTemp = exitAnimDuration;
+            }
+            return exitAnimDurationTemp;
+        }
+
+        public long getEnterAnimationDuration(@Nullable Animation defaultEnterAnim) {
+            if (defaultEnterAnim == null && boxBody.getAnimation() != null) {
+                defaultEnterAnim = boxBody.getAnimation();
+            }
+            long enterAnimDurationTemp = (defaultEnterAnim == null || defaultEnterAnim.getDuration() == 0) ? 300 : defaultEnterAnim.getDuration();
+            if (overrideEnterDuration >= 0) {
+                enterAnimDurationTemp = overrideEnterDuration;
+            }
+            if (enterAnimDuration >= 0) {
+                enterAnimDurationTemp = enterAnimDuration;
+            }
+            return enterAnimDurationTemp;
+        }
     }
 
     protected boolean preRecycle = false;
@@ -1433,15 +1448,14 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
      * new PopNotification() {
-     *     @Override
-     *     public void onShow(PopNotification dialog) {
-     *         //...
-     *     }
-     * }
      *
      * @param dialog self
+     * @Override public void onShow(PopNotification dialog) {
+     * //...
+     * }
+     * }
      */
-    public void onShow(PopNotification dialog){
+    public void onShow(PopNotification dialog) {
 
     }
 
@@ -1449,23 +1463,23 @@ public class PopNotification extends BaseDialog implements NoTouchInterface {
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
      * new PopNotification() {
-     *     @Override
-     *     public boolean onDismiss(PopNotification dialog) {
-     *         WaitDialog.show("Please Wait...");
-     *         if (dialog.getButtonSelectResult() == BUTTON_SELECT_RESULT.BUTTON_OK) {
-     *             //点击了OK的情况
-     *             //...
-     *         } else {
-     *             //其他按钮点击、对话框dismiss的情况
-     *             //...
-     *         }
-     *         return false;
-     *     }
-     * }
+     *
      * @param dialog self
+     * @Override public boolean onDismiss(PopNotification dialog) {
+     * WaitDialog.show("Please Wait...");
+     * if (dialog.getButtonSelectResult() == BUTTON_SELECT_RESULT.BUTTON_OK) {
+     * //点击了OK的情况
+     * //...
+     * } else {
+     * //其他按钮点击、对话框dismiss的情况
+     * //...
+     * }
+     * return false;
+     * }
+     * }
      */
     //用于使用 new 构建实例时,override 的生命周期事件
-    public void onDismiss(PopNotification dialog){
+    public void onDismiss(PopNotification dialog) {
 
     }
 }

+ 47 - 19
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java

@@ -9,6 +9,7 @@ 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;
@@ -21,6 +22,7 @@ import android.widget.TextView;
 
 import androidx.annotation.ColorInt;
 import androidx.annotation.ColorRes;
+import androidx.annotation.Nullable;
 import androidx.lifecycle.Lifecycle;
 
 import com.kongzue.dialogx.DialogX;
@@ -562,7 +564,7 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
             boxRoot.post(new Runnable() {
                 @Override
                 public void run() {
-                    getDialogXAnimImpl().doShowAnim(me, null);
+                    getDialogXAnimImpl().doShowAnim(me, boxBody);
                     setLifecycleState(Lifecycle.State.RESUMED);
                 }
             });
@@ -665,7 +667,14 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
                 boxRoot.post(new Runnable() {
                     @Override
                     public void run() {
-                        getDialogXAnimImpl().doExitAnim(me, null);
+                        getDialogXAnimImpl().doExitAnim(me, boxBody);
+
+                        runOnMainDelay(new Runnable() {
+                            @Override
+                            public void run() {
+                                waitForDismiss();
+                            }
+                        }, getExitAnimationDuration(null));
                     }
                 });
             }
@@ -675,47 +684,66 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
             if (dialogXAnimImpl == null) {
                 dialogXAnimImpl = new DialogXAnimInterface<PopTip>() {
                     @Override
-                    public void doShowAnim(PopTip dialog, ObjectRunnable<Float> animProgress) {
+                    public void doShowAnim(PopTip dialog, ViewGroup dialogBodyView) {
                         Animation enterAnim = AnimationUtils.loadAnimation(getOwnActivity(), enterAnimResId == 0 ? R.anim.anim_dialogx_default_enter : enterAnimResId);
+                        long enterAnimDuration = getEnterAnimationDuration(enterAnim);
                         enterAnim.setInterpolator(new DecelerateInterpolator(2f));
-                        if (enterAnimDuration != -1) {
-                            enterAnim.setDuration(enterAnimDuration);
-                        }
+                        enterAnim.setDuration(enterAnimDuration);
                         enterAnim.setFillAfter(true);
                         boxBody.startAnimation(enterAnim);
 
                         boxRoot.animate()
-                                .setDuration(enterAnimDuration == -1 ? enterAnim.getDuration() : enterAnimDuration)
+                                .setDuration(enterAnimDuration)
                                 .alpha(1f)
                                 .setInterpolator(new DecelerateInterpolator())
                                 .setListener(null);
                     }
 
                     @Override
-                    public void doExitAnim(PopTip dialog, ObjectRunnable<Float> animProgress) {
+                    public void doExitAnim(PopTip dialog, ViewGroup dialogBodyView) {
                         Animation exitAnim = AnimationUtils.loadAnimation(getOwnActivity() == null ? boxRoot.getContext() : getOwnActivity(), exitAnimResId == 0 ? R.anim.anim_dialogx_default_exit : exitAnimResId);
-                        if (exitAnimDuration != -1) {
-                            exitAnim.setDuration(exitAnimDuration);
-                        }
+                        long exitAnimDuration = getExitAnimationDuration(exitAnim);
+                        exitAnim.setDuration(exitAnimDuration);
                         exitAnim.setFillAfter(true);
                         boxBody.startAnimation(exitAnim);
 
                         boxRoot.animate()
                                 .alpha(0f)
                                 .setInterpolator(new AccelerateInterpolator())
-                                .setDuration(exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
-
-                        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
-                            @Override
-                            public void run() {
-                                waitForDismiss();
-                            }
-                        }, exitAnimDuration == -1 ? exitAnim.getDuration() : exitAnimDuration);
+                                .setDuration(exitAnimDuration);
                     }
                 };
             }
             return dialogXAnimImpl;
         }
+
+        public long getExitAnimationDuration(@Nullable Animation defaultExitAnim) {
+            if (defaultExitAnim == null && boxBody.getAnimation() != null) {
+                defaultExitAnim = boxBody.getAnimation();
+            }
+            long exitAnimDurationTemp = (defaultExitAnim == null || defaultExitAnim.getDuration() == 0) ? 300 : defaultExitAnim.getDuration();
+            if (overrideExitDuration >= 0) {
+                exitAnimDurationTemp = overrideExitDuration;
+            }
+            if (exitAnimDuration != -1) {
+                exitAnimDurationTemp = exitAnimDuration;
+            }
+            return exitAnimDurationTemp;
+        }
+
+        public long getEnterAnimationDuration(@Nullable Animation defaultEnterAnim) {
+            if (defaultEnterAnim == null && boxBody.getAnimation() != null) {
+                defaultEnterAnim = boxBody.getAnimation();
+            }
+            long enterAnimDurationTemp = (defaultEnterAnim == null || defaultEnterAnim.getDuration() == 0) ? 300 : defaultEnterAnim.getDuration();
+            if (overrideEnterDuration >= 0) {
+                enterAnimDurationTemp = overrideEnterDuration;
+            }
+            if (enterAnimDuration >= 0) {
+                enterAnimDurationTemp = enterAnimDuration;
+            }
+            return enterAnimDurationTemp;
+        }
     }
 
     protected boolean preRecycle = false;

File diff suppressed because it is too large
+ 182 - 171
DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java


+ 5 - 4
DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogXAnimInterface.java

@@ -1,6 +1,7 @@
 package com.kongzue.dialogx.interfaces;
 
 import android.animation.ValueAnimator;
+import android.view.ViewGroup;
 
 import com.kongzue.dialogx.util.ObjectRunnable;
 
@@ -12,10 +13,10 @@ import com.kongzue.dialogx.util.ObjectRunnable;
  * @createTime: 2022/9/5 9:21
  */
 public abstract class DialogXAnimInterface<D> {
-    
-    public void doShowAnim(D dialog, ObjectRunnable<Float> animProgress) {
+
+    public void doShowAnim(D dialog, ViewGroup dialogBodyView) {
     }
-    
-    public void doExitAnim(D dialog, ObjectRunnable<Float> animProgress) {
+
+    public void doExitAnim(D dialog, ViewGroup dialogBodyView) {
     }
 }

+ 6 - 4
DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java

@@ -2,6 +2,7 @@ package com.kongzue.dialogx.util;
 
 import android.animation.ObjectAnimator;
 import android.content.res.Resources;
+import android.util.Log;
 import android.view.MotionEvent;
 import android.view.View;
 
@@ -18,7 +19,7 @@ import com.kongzue.dialogx.interfaces.ScrollController;
  * @createTime: 2020/10/7 4:01
  */
 public class BottomDialogTouchEventInterceptor {
-    
+
     /**
      * 下边三个值用于判断触控过程,
      * isBkgTouched:标记是否已按下
@@ -36,11 +37,11 @@ public class BottomDialogTouchEventInterceptor {
      * 需要对bkgTouchDownY、scrolledY的值进行刷新,否则触控连续过程会出现闪跳。
      */
     private int oldMode;
-    
+
     public BottomDialogTouchEventInterceptor(BottomDialog me, BottomDialog.DialogImpl impl) {
         refresh(me, impl);
     }
-    
+
     public void refresh(final BottomDialog me, final BottomDialog.DialogImpl impl) {
         if (me == null || impl == null || impl.bkg == null || impl.scrollView == null) {
             return;
@@ -62,6 +63,7 @@ public class BottomDialogTouchEventInterceptor {
             impl.bkg.setOnTouchListener(new View.OnTouchListener() {
                 @Override
                 public boolean onTouch(View v, MotionEvent event) {
+                    Log.e(">>>", "onTouch: ");
                     if (me.getDialogLifecycleCallback() instanceof BottomDialogSlideEventLifecycleCallback) {
                         if (((BottomDialogSlideEventLifecycleCallback) me.getDialogLifecycleCallback()).onSlideTouchEvent(me, v, event)) {
                             return true;
@@ -137,7 +139,7 @@ public class BottomDialogTouchEventInterceptor {
             impl.bkg.setOnTouchListener(null);
         }
     }
-    
+
     private int dip2px(float dpValue) {
         final float scale = Resources.getSystem().getDisplayMetrics().density;
         return (int) (dpValue * scale + 0.5f);

+ 1 - 1
DialogX/src/main/java/com/kongzue/dialogx/util/ObjectRunnable.java

@@ -7,6 +7,6 @@ package com.kongzue.dialogx.util;
  * @mail: myzcxhh@live.cn
  * @createTime: 2022/8/26 17:10
  */
-public interface ObjectRunnable<D> {
+public abstract class ObjectRunnable<D> {
     public abstract void run(D d);
 }

+ 1 - 1
gradle.properties

@@ -19,6 +19,6 @@ android.useAndroidX=true
 # Automatically convert third-party libraries to use AndroidX
 android.enableJetifier=true
 
-BUILD_VERSION=0.0.48.beta22
+BUILD_VERSION=0.0.48.beta23
 BUILD_VERSION_INT=47
 DIALOGX_STYLE_VERSION=5

Some files were not shown because too many files changed in this diff