Browse Source

0.0.48.beta13
- 修复 FullScreenDialog#setMaxHeight(...) 方法存在的问题,该问题可能引发当设置了最大高度时,拖拽对话框错误的移动到到屏幕顶部;
- 针对当界面处于横屏时 PopTip 横向位置与其他对话框位置相比存在偏差的问题;

Kongzue 2 years ago
parent
commit
dd79758a35

+ 127 - 124
DialogX/src/main/java/com/kongzue/dialogx/dialogs/FullScreenDialog.java

@@ -46,11 +46,11 @@ import com.kongzue.dialogx.util.views.MaxRelativeLayout;
  * @createTime: 2020/10/6 15:17
  */
 public class FullScreenDialog extends BaseDialog {
-    
+
     public static int overrideEnterDuration = -1;
     public static int overrideExitDuration = -1;
     public static BOOLEAN overrideCancelable;
-    
+
     protected OnBindView<FullScreenDialog> onBindView;
     protected OnBackPressedListener<FullScreenDialog> onBackPressedListener;
     protected BOOLEAN privateCancelable;
@@ -58,36 +58,36 @@ public class FullScreenDialog extends BaseDialog {
     protected float backgroundRadius = -1;
     protected boolean allowInterceptTouch = true;
     protected DialogXAnimInterface<FullScreenDialog> dialogXAnimImpl;
-    
+
     protected DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback;
     protected OnBackgroundMaskClickListener<FullScreenDialog> onBackgroundMaskClickListener;
-    
+
     protected FullScreenDialog me = this;
-    
+
     protected FullScreenDialog() {
         super();
     }
-    
+
     private View dialogView;
-    
+
     public static FullScreenDialog build() {
         return new FullScreenDialog();
     }
-    
+
     public static FullScreenDialog build(OnBindView<FullScreenDialog> onBindView) {
         return new FullScreenDialog(onBindView);
     }
-    
+
     public FullScreenDialog(OnBindView<FullScreenDialog> onBindView) {
         this.onBindView = onBindView;
     }
-    
+
     public static FullScreenDialog show(OnBindView<FullScreenDialog> onBindView) {
         FullScreenDialog fullScreenDialog = new FullScreenDialog(onBindView);
         fullScreenDialog.show();
         return fullScreenDialog;
     }
-    
+
     public FullScreenDialog show() {
         if (isHide && getDialogView() != null && isShow) {
             if (hideWithExitAnim && getDialogImpl() != null) {
@@ -107,7 +107,7 @@ public class FullScreenDialog extends BaseDialog {
         show(dialogView);
         return this;
     }
-    
+
     public void show(Activity activity) {
         super.beforeShow();
         if (getDialogView() == null) {
@@ -117,25 +117,25 @@ public class FullScreenDialog extends BaseDialog {
         }
         show(activity, dialogView);
     }
-    
+
     protected DialogImpl dialogImpl;
-    
+
     public class DialogImpl implements DialogConvertViewInterface {
-        
+
         private FullScreenDialogTouchEventInterceptor fullScreenDialogTouchEventInterceptor;
-        
+
         public ActivityScreenShotImageView imgZoomActivity;
         public DialogXBaseRelativeLayout boxRoot;
         public RelativeLayout boxBkg;
         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);
@@ -143,7 +143,7 @@ public class FullScreenDialog extends BaseDialog {
             boxBkg = convertView.findViewById(R.id.box_bkg);
             bkg = convertView.findViewById(R.id.bkg);
             boxCustom = convertView.findViewById(R.id.box_custom);
-            
+
             if (hideZoomBackground) {
                 dialogView.setBackgroundResource(R.color.black20);
                 imgZoomActivity.setVisibility(View.GONE);
@@ -155,10 +155,15 @@ public class FullScreenDialog extends BaseDialog {
             dialogImpl = this;
             refreshView();
         }
-        
+
         public float bkgEnterAimY = -1;
         private long enterAnimDurationTemp = 300;
-        
+        protected int enterY;
+
+        public float getEnterY() {
+            return boxRoot.getSafeHeight() - enterY > 0 ? boxRoot.getSafeHeight() - enterY : 0;
+        }
+
         @Override
         public void init() {
             boxRoot.setParentDialog(me);
@@ -167,14 +172,14 @@ public class FullScreenDialog extends BaseDialog {
                 public void onShow() {
                     isShow = true;
                     preShow = false;
-                    
+
                     lifecycle.setCurrentState(Lifecycle.State.CREATED);
                     onDialogShow();
-                    
+
                     getDialogLifecycleCallback().onShow(me);
                     FullScreenDialog.this.onShow(me);
                 }
-                
+
                 @Override
                 public void onDismiss() {
                     isShow = false;
@@ -187,7 +192,7 @@ public class FullScreenDialog extends BaseDialog {
                     System.gc();
                 }
             });
-            
+
             boxRoot.setOnBackPressedListener(new DialogXBaseRelativeLayout.PrivateBackPressedListener() {
                 @Override
                 public boolean onBackPressed() {
@@ -203,9 +208,9 @@ public class FullScreenDialog extends BaseDialog {
                     return true;
                 }
             });
-            
+
             fullScreenDialogTouchEventInterceptor = new FullScreenDialogTouchEventInterceptor(me, dialogImpl);
-            
+
             enterAnimDurationTemp = 300;
             if (overrideEnterDuration >= 0) {
                 enterAnimDurationTemp = overrideEnterDuration;
@@ -214,7 +219,7 @@ public class FullScreenDialog extends BaseDialog {
                 enterAnimDurationTemp = enterAnimDuration;
             }
             boxRoot.setBkgAlpha(0f);
-            
+
             bkg.setY(boxRoot.getHeight());
             boxRoot.post(new Runnable() {
                 @Override
@@ -223,45 +228,44 @@ public class FullScreenDialog extends BaseDialog {
                     lifecycle.setCurrentState(Lifecycle.State.RESUMED);
                 }
             });
-            
             boxRoot.setOnSafeInsetsChangeListener(new OnSafeInsetsChangeListener() {
                 @Override
                 public void onChange(Rect unsafeRect) {
-                    if (unsafeRect.bottom > dip2px(100)) {
-                        ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), 0);
-                        enterAnim.setDuration(enterAnimDurationTemp);
-                        enterAnim.start();
-                    }
+                    bkg.setY(getEnterY());
                 }
             });
-            
+
             bkg.setOnYChanged(new MaxRelativeLayout.OnYChanged() {
                 @Override
                 public void y(float y) {
-                    float zoomScale = 1 - (boxRoot.getHeight() - y) * 0.00002f;
+                    float realY = y + bkg.getTop();
+                    float zoomScale = 1 - (boxRoot.getHeight() - realY) * 0.00002f;
                     if (zoomScale > 1) zoomScale = 1;
                     if (!hideZoomBackground) {
                         imgZoomActivity.setScaleX(zoomScale);
                         imgZoomActivity.setScaleY(zoomScale);
-                        
-                        imgZoomActivity.setRadius(dip2px(15) * ((boxRoot.getHeight() - y) / boxRoot.getHeight()));
+
+                        imgZoomActivity.setRadius(dip2px(15) * ((boxRoot.getHeight() - realY) / boxRoot.getHeight()));
                     }
                 }
             });
-            
+
             onDialogInit();
         }
-        
+
         private void showEnterAnim(int customViewHeight) {
+            if (getMaxHeight() != 0) {
+                customViewHeight = Math.min(getMaxHeight() - boxRoot.getUnsafePlace().bottom, customViewHeight);
+            }
+            enterY = customViewHeight;
             bkgEnterAimY = boxRoot.getSafeHeight() - customViewHeight;
             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() {
@@ -273,22 +277,22 @@ public class FullScreenDialog extends BaseDialog {
             });
             bkgAlpha.start();
         }
-        
+
         @Override
         public void refreshView() {
             if (boxRoot == null || getTopActivity() == null) {
                 return;
             }
-            boxRoot.setRootPadding(screenPaddings[0],screenPaddings[1],screenPaddings[2],screenPaddings[3]);
+            boxRoot.setRootPadding(screenPaddings[0], screenPaddings[1], screenPaddings[2], screenPaddings[3]);
             if (backgroundColor != -1) {
                 tintColor(bkg, backgroundColor);
             }
-            
+
             bkg.setMaxWidth(getMaxWidth());
             bkg.setMaxHeight(getMaxHeight());
             bkg.setMinimumWidth(getMinWidth());
             bkg.setMinimumHeight(getMinHeight());
-            
+
             if (isCancelable()) {
                 boxRoot.setOnClickListener(new View.OnClickListener() {
                     @Override
@@ -316,7 +320,7 @@ public class FullScreenDialog extends BaseDialog {
                     bkg.setClipToOutline(true);
                 }
             }
-            
+
             if (onBindView != null) {
                 onBindView.bindParent(boxCustom, me);
                 if (onBindView.getCustomView() instanceof ScrollController) {
@@ -328,7 +332,7 @@ public class FullScreenDialog extends BaseDialog {
                     }
                 }
             }
-            
+
             if (hideZoomBackground) {
                 dialogView.setBackgroundResource(R.color.black20);
                 imgZoomActivity.setVisibility(View.GONE);
@@ -336,17 +340,17 @@ public class FullScreenDialog extends BaseDialog {
                 dialogView.setBackgroundResource(R.color.black);
                 imgZoomActivity.setVisibility(View.VISIBLE);
             }
-            
+
             fullScreenDialogTouchEventInterceptor.refresh(me, this);
-            
+
             onDialogRefreshUI();
         }
-        
+
         @Override
         public void doDismiss(View v) {
             if (v != null) v.setEnabled(false);
             if (getTopActivity() == null) return;
-            
+
             if (!dismissAnimFlag) {
                 dismissAnimFlag = true;
                 getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
@@ -365,7 +369,7 @@ public class FullScreenDialog extends BaseDialog {
                 });
             }
         }
-        
+
         public void preDismiss() {
             if (isCancelable()) {
                 doDismiss(boxRoot);
@@ -377,13 +381,13 @@ public class FullScreenDialog extends BaseDialog {
                 if (exitAnimDuration >= 0) {
                     exitAnimDurationTemp = exitAnimDuration;
                 }
-                
+
                 ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), bkgEnterAimY);
                 exitAnim.setDuration(exitAnimDurationTemp);
                 exitAnim.start();
             }
         }
-        
+
         protected DialogXAnimInterface<FullScreenDialog> getDialogXAnimImpl() {
             if (dialogXAnimImpl == null) {
                 dialogXAnimImpl = new DialogXAnimInterface<FullScreenDialog>() {
@@ -398,7 +402,7 @@ public class FullScreenDialog extends BaseDialog {
                             showEnterAnim(customViewHeight);
                         }
                     }
-                    
+
                     private boolean isMatchParentHeightCustomView() {
                         if (onBindView != null && onBindView.getCustomView() != null) {
                             ViewGroup.LayoutParams lp = onBindView.getCustomView().getLayoutParams();
@@ -408,7 +412,7 @@ public class FullScreenDialog extends BaseDialog {
                         }
                         return false;
                     }
-                    
+
                     @Override
                     public void doExitAnim(FullScreenDialog dialog, ObjectRunnable<Float> animProgress) {
                         long exitAnimDurationTemp = 300;
@@ -418,11 +422,11 @@ public class FullScreenDialog extends BaseDialog {
                         if (exitAnimDuration >= 0) {
                             exitAnimDurationTemp = exitAnimDuration;
                         }
-                        
+
                         ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), boxBkg.getHeight());
                         exitAnim.setDuration(exitAnimDurationTemp);
                         exitAnim.start();
-                        
+
                         ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1f, 0f);
                         bkgAlpha.setDuration(exitAnimDurationTemp);
                         bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@@ -438,12 +442,12 @@ public class FullScreenDialog extends BaseDialog {
             return dialogXAnimImpl;
         }
     }
-    
+
     @Override
     public String dialogKey() {
         return getClass().getSimpleName() + "(" + Integer.toHexString(hashCode()) + ")";
     }
-    
+
     public void refreshUI() {
         if (getDialogImpl() == null) return;
         runOnMain(new Runnable() {
@@ -453,7 +457,7 @@ public class FullScreenDialog extends BaseDialog {
             }
         });
     }
-    
+
     public void dismiss() {
         runOnMain(new Runnable() {
             @Override
@@ -463,38 +467,38 @@ public class FullScreenDialog extends BaseDialog {
             }
         });
     }
-    
+
     public DialogLifecycleCallback<FullScreenDialog> getDialogLifecycleCallback() {
         return dialogLifecycleCallback == null ? new DialogLifecycleCallback<FullScreenDialog>() {
         } : dialogLifecycleCallback;
     }
-    
+
     public FullScreenDialog setDialogLifecycleCallback(DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback) {
         this.dialogLifecycleCallback = dialogLifecycleCallback;
         if (isShow) dialogLifecycleCallback.onShow(me);
         return this;
     }
-    
+
     public OnBackPressedListener<FullScreenDialog> getOnBackPressedListener() {
         return (OnBackPressedListener<FullScreenDialog>) onBackPressedListener;
     }
-    
+
     public FullScreenDialog setOnBackPressedListener(OnBackPressedListener<FullScreenDialog> onBackPressedListener) {
         this.onBackPressedListener = onBackPressedListener;
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setStyle(DialogXStyle style) {
         this.style = style;
         return this;
     }
-    
+
     public FullScreenDialog setTheme(DialogX.THEME theme) {
         this.theme = theme;
         return this;
     }
-    
+
     public boolean isCancelable() {
         if (privateCancelable != null) {
             return privateCancelable == BOOLEAN.TRUE;
@@ -504,78 +508,78 @@ public class FullScreenDialog extends BaseDialog {
         }
         return cancelable;
     }
-    
+
     public FullScreenDialog setCancelable(boolean cancelable) {
         this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
         refreshUI();
         return this;
     }
-    
+
     public DialogImpl getDialogImpl() {
         return dialogImpl;
     }
-    
+
     public FullScreenDialog setCustomView(OnBindView<FullScreenDialog> onBindView) {
         this.onBindView = onBindView;
         refreshUI();
         return this;
     }
-    
+
     public View getCustomView() {
         if (onBindView == null) return null;
         return onBindView.getCustomView();
     }
-    
+
     public FullScreenDialog removeCustomView() {
         this.onBindView.clean();
         refreshUI();
         return this;
     }
-    
+
     public int getBackgroundColor() {
         return backgroundColor;
     }
-    
+
     public FullScreenDialog setBackgroundColor(@ColorInt int backgroundColor) {
         this.backgroundColor = backgroundColor;
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setBackgroundColorRes(@ColorRes int backgroundColorRes) {
         this.backgroundColor = getColor(backgroundColorRes);
         refreshUI();
         return this;
     }
-    
+
     public long getEnterAnimDuration() {
         return enterAnimDuration;
     }
-    
+
     public FullScreenDialog setEnterAnimDuration(long enterAnimDuration) {
         this.enterAnimDuration = enterAnimDuration;
         return this;
     }
-    
+
     public long getExitAnimDuration() {
         return exitAnimDuration;
     }
-    
+
     public FullScreenDialog setExitAnimDuration(long exitAnimDuration) {
         this.exitAnimDuration = exitAnimDuration;
         return this;
     }
-    
+
     public boolean isHideZoomBackground() {
         return hideZoomBackground;
     }
-    
+
     public FullScreenDialog setHideZoomBackground(boolean hideZoomBackground) {
         this.hideZoomBackground = hideZoomBackground;
         refreshUI();
         return this;
     }
-    
+
     @Override
     public void restartDialog() {
         if (dialogView != null) {
@@ -591,9 +595,9 @@ public class FullScreenDialog extends BaseDialog {
         if (dialogView != null) dialogView.setTag(me);
         show(dialogView);
     }
-    
+
     private boolean isHide;
-    
+
     public void hide() {
         isHide = true;
         hideWithExitAnim = false;
@@ -601,9 +605,9 @@ public class FullScreenDialog extends BaseDialog {
             getDialogView().setVisibility(View.GONE);
         }
     }
-    
+
     protected boolean hideWithExitAnim;
-    
+
     public void hideWithExitAnim() {
         hideWithExitAnim = true;
         isHide = true;
@@ -619,85 +623,85 @@ public class FullScreenDialog extends BaseDialog {
             });
         }
     }
-    
+
     @Override
     protected void shutdown() {
         dismiss();
     }
-    
+
     public FullScreenDialog setMaxWidth(int maxWidth) {
         this.maxWidth = maxWidth;
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setMaxHeight(int maxHeight) {
         this.maxHeight = maxHeight;
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setMinHeight(int minHeight) {
         this.minHeight = minHeight;
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setMinWidth(int minWidth) {
         this.minWidth = minWidth;
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setDialogImplMode(DialogX.IMPL_MODE dialogImplMode) {
         this.dialogImplMode = dialogImplMode;
         return this;
     }
-    
+
     public OnBackgroundMaskClickListener<FullScreenDialog> getOnBackgroundMaskClickListener() {
         return onBackgroundMaskClickListener;
     }
-    
+
     public FullScreenDialog setOnBackgroundMaskClickListener(OnBackgroundMaskClickListener<FullScreenDialog> onBackgroundMaskClickListener) {
         this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
         return this;
     }
-    
+
     public FullScreenDialog setRadius(float radiusPx) {
         backgroundRadius = radiusPx;
         refreshUI();
         return this;
     }
-    
+
     public float getRadius() {
         return backgroundRadius;
     }
-    
+
     public boolean isAllowInterceptTouch() {
         return allowInterceptTouch;
     }
-    
+
     public FullScreenDialog setAllowInterceptTouch(boolean allowInterceptTouch) {
         this.allowInterceptTouch = allowInterceptTouch;
         refreshUI();
         return this;
     }
-    
+
     public DialogXAnimInterface<FullScreenDialog> getDialogXAnimImpl() {
         return dialogXAnimImpl;
     }
-    
+
     public FullScreenDialog setDialogXAnimImpl(DialogXAnimInterface<FullScreenDialog> dialogXAnimImpl) {
         this.dialogXAnimImpl = dialogXAnimImpl;
         return this;
     }
-    
+
     public FullScreenDialog setRootPadding(int padding) {
         this.screenPaddings = new int[]{padding, padding, padding, padding};
         refreshUI();
         return this;
     }
-    
+
     public FullScreenDialog setRootPadding(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) {
         this.screenPaddings = new int[]{paddingLeft, paddingTop, paddingRight, paddingBottom};
         refreshUI();
@@ -708,15 +712,14 @@ public class FullScreenDialog extends BaseDialog {
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
      * new FullScreenDialog() {
-     *     @Override
-     *     public void onShow(FullScreenDialog dialog) {
-     *         //...
-     *     }
-     * }
      *
      * @param dialog self
+     * @Override public void onShow(FullScreenDialog dialog) {
+     * //...
+     * }
+     * }
      */
-    public void onShow(FullScreenDialog dialog){
+    public void onShow(FullScreenDialog dialog) {
 
     }
 
@@ -724,23 +727,23 @@ public class FullScreenDialog extends BaseDialog {
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
      * new FullScreenDialog() {
-     *     @Override
-     *     public boolean onDismiss(FullScreenDialog 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(FullScreenDialog dialog) {
+     * WaitDialog.show("Please Wait...");
+     * if (dialog.getButtonSelectResult() == BUTTON_SELECT_RESULT.BUTTON_OK) {
+     * //点击了OK的情况
+     * //...
+     * } else {
+     * //其他按钮点击、对话框dismiss的情况
+     * //...
+     * }
+     * return false;
+     * }
+     * }
      */
     //用于使用 new 构建实例时,override 的生命周期事件
-    public void onDismiss(FullScreenDialog dialog){
+    public void onDismiss(FullScreenDialog dialog) {
 
     }
 }

+ 21 - 25
DialogX/src/main/java/com/kongzue/dialogx/dialogs/PopTip.java

@@ -498,7 +498,7 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
             }
 
             boxRoot.setParentDialog(me);
-            boxRoot.setAutoUnsafePlacePadding(false);
+            boxRoot.setAutoUnsafePlacePadding(true);
             boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
                 @Override
                 public void onShow() {
@@ -534,7 +534,6 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
                 case BOTTOM:
                     rlp.removeRule(RelativeLayout.CENTER_IN_PARENT);
                     rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
-                    boxRoot.setAutoUnsafePlacePadding(true);
                     break;
                 case CENTER:
                     rlp.removeRule(RelativeLayout.ALIGN_PARENT_TOP);
@@ -547,9 +546,7 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
             boxRoot.setOnSafeInsetsChangeListener(new OnSafeInsetsChangeListener() {
                 @Override
                 public void onChange(Rect unsafeRect) {
-                    if (align == DialogXStyle.PopTipSettings.ALIGN.TOP) {
-                        boxBody.setY(unsafeRect.top + bodyMargin[1]);
-                    } else if (align == DialogXStyle.PopTipSettings.ALIGN.TOP_INSIDE) {
+                    if (align == DialogXStyle.PopTipSettings.ALIGN.TOP_INSIDE) {
                         boxBody.setPadding(0, unsafeRect.top, 0, 0);
                     }
                 }
@@ -1228,15 +1225,14 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
      * new PopTip() {
-     *     @Override
-     *     public void onShow(PopTip dialog) {
-     *         //...
-     *     }
-     * }
      *
      * @param dialog self
+     * @Override public void onShow(PopTip dialog) {
+     * //...
+     * }
+     * }
      */
-    public void onShow(PopTip dialog){
+    public void onShow(PopTip dialog) {
 
     }
 
@@ -1244,23 +1240,23 @@ public class PopTip extends BaseDialog implements NoTouchInterface {
      * 用于使用 new 构建实例时,override 的生命周期事件
      * 例如:
      * new PopTip() {
-     *     @Override
-     *     public boolean onDismiss(PopTip 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(PopTip dialog) {
+     * WaitDialog.show("Please Wait...");
+     * if (dialog.getButtonSelectResult() == BUTTON_SELECT_RESULT.BUTTON_OK) {
+     * //点击了OK的情况
+     * //...
+     * } else {
+     * //其他按钮点击、对话框dismiss的情况
+     * //...
+     * }
+     * return false;
+     * }
+     * }
      */
     //用于使用 new 构建实例时,override 的生命周期事件
-    public void onDismiss(PopTip dialog){
+    public void onDismiss(PopTip dialog) {
 
     }
 }

+ 10 - 10
DialogX/src/main/java/com/kongzue/dialogx/util/FullScreenDialogTouchEventInterceptor.java

@@ -55,7 +55,7 @@ public class FullScreenDialogTouchEventInterceptor {
                             if (isBkgTouched) {
                                 float aimY = impl.bkg.getY() + event.getY() - bkgTouchDownY;
                                 if (impl.scrollView != null && impl.scrollView.isCanScroll()) {
-                                    if (aimY > 0) {
+                                    if (aimY > me.getDialogImpl().getEnterY()) {
                                         if (impl.scrollView.getScrollDistance() == 0) {
                                             if (impl.scrollView instanceof ScrollController) {
                                                 ((ScrollController) impl.scrollView).lockScroll(true);
@@ -68,11 +68,11 @@ public class FullScreenDialogTouchEventInterceptor {
                                         if (impl.scrollView instanceof ScrollController) {
                                             ((ScrollController) impl.scrollView).lockScroll(false);
                                         }
-                                        impl.bkg.setY(0);
+                                        impl.bkg.setY(me.getDialogImpl().getEnterY());
                                     }
                                 } else {
-                                    if (aimY < 0) {
-                                        aimY = 0;
+                                    if (aimY < me.getDialogImpl().getEnterY()) {
+                                        aimY = me.getDialogImpl().getEnterY();
                                     }
                                     impl.bkg.setY(aimY);
                                 }
@@ -81,27 +81,27 @@ public class FullScreenDialogTouchEventInterceptor {
                         case MotionEvent.ACTION_UP:
                         case MotionEvent.ACTION_CANCEL:
                             isBkgTouched = false;
-                            if (bkgOldY == 0) {
+                            if (bkgOldY == me.getDialogImpl().getEnterY()) {
                                 if (impl.bkg.getY() < DialogX.touchSlideTriggerThreshold) {
-                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), 0);
+                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), me.getDialogImpl().getEnterY());
                                     enterAnim.setDuration(300);
                                     enterAnim.start();
-                                } else if (impl.bkg.getY() > impl.bkgEnterAimY + DialogX.touchSlideTriggerThreshold) {
+                                } else if (impl.bkg.getY() > impl.getEnterY() + DialogX.touchSlideTriggerThreshold) {
                                     impl.preDismiss();
                                 } else {
-                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), impl.bkgEnterAimY);
+                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), impl.getEnterY());
                                     enterAnim.setDuration(300);
                                     enterAnim.start();
                                 }
                             } else {
                                 if (impl.bkg.getY() < bkgOldY - DialogX.touchSlideTriggerThreshold) {
-                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), 0);
+                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), me.getDialogImpl().getEnterY());
                                     enterAnim.setDuration(300);
                                     enterAnim.start();
                                 } else if (impl.bkg.getY() > bkgOldY + DialogX.touchSlideTriggerThreshold) {
                                     impl.preDismiss();
                                 } else {
-                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), impl.bkgEnterAimY);
+                                    ObjectAnimator enterAnim = ObjectAnimator.ofFloat(impl.bkg, "y", impl.bkg.getY(), impl.getEnterY());
                                     enterAnim.setDuration(300);
                                     enterAnim.start();
                                 }

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

@@ -1,7 +1,5 @@
 package com.kongzue.dialogx.util.views;
 
-import static android.view.WindowInsetsAnimation.Callback.DISPATCH_MODE_STOP;
-
 import android.app.Activity;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -98,6 +96,8 @@ public class DialogXBaseRelativeLayout extends RelativeLayout {
             if (parentDialog != null && parentDialog.getDialogImplMode() != DialogX.IMPL_MODE.VIEW) {
                 setFitsSystemWindows(true);
             }
+            setClipChildren(false);
+            setClipToPadding(false);
         }
     }
 

+ 62 - 56
DialogX/src/main/res/layout/layout_dialogx_poptip_material.xml

@@ -7,67 +7,73 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:background="@drawable/rect_dialogx_material_poptip_bkg"
-        android:elevation="20dp"
-        android:gravity="center_vertical"
-        android:minHeight="50dp"
-        android:orientation="horizontal">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
-            android:layout_weight="1"
-            android:gravity="left|center_vertical"
-            android:text="Sure?"
-            android:textColor="@color/black"
-            android:textSize="14dp" />
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:background="@drawable/rect_dialogx_material_poptip_bkg"
+            android:elevation="20dp"
+            android:gravity="center_vertical"
+            android:minHeight="50dp"
+            android:orientation="horizontal">
 
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
 
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="-15dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:background="@drawable/button_dialogx_material_light"
-            android:gravity="left|center_vertical"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxColorBlue"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:gravity="left|center_vertical"
+                android:text="Sure?"
+                android:textColor="@color/black"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="-15dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:background="@drawable/button_dialogx_material_light"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxColorBlue"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 62 - 56
DialogX/src/main/res/layout/layout_dialogx_poptip_material_dark.xml

@@ -7,67 +7,73 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:background="@drawable/rect_dialogx_material_poptip_bkg_night"
-        android:elevation="10dp"
-        android:gravity="center_vertical"
-        android:minHeight="50dp"
-        android:orientation="horizontal">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
-            android:layout_weight="1"
-            android:gravity="left|center_vertical"
-            android:text="Sure?"
-            android:textColor="@color/white"
-            android:textSize="14dp" />
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:background="@drawable/rect_dialogx_material_poptip_bkg_night"
+            android:elevation="10dp"
+            android:gravity="center_vertical"
+            android:minHeight="50dp"
+            android:orientation="horizontal">
 
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
 
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="-15dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:background="@drawable/button_dialogx_material_night"
-            android:gravity="left|center_vertical"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxPopButtonBlueDark"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:gravity="left|center_vertical"
+                android:text="Sure?"
+                android:textColor="@color/white"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="-15dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:background="@drawable/button_dialogx_material_night"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxPopButtonBlueDark"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 1 - 1
DialogXIOSStyle/src/main/res/layout/layout_dialogx_popnotification_ios.xml

@@ -14,7 +14,7 @@
 
     <com.kongzue.dialogx.util.views.MaxRelativeLayout
         android:id="@+id/box_body"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginLeft="15dp"
         android:layout_marginRight="15dp"

+ 1 - 1
DialogXIOSStyle/src/main/res/layout/layout_dialogx_popnotification_ios_dark.xml

@@ -9,7 +9,7 @@
 
     <com.kongzue.dialogx.util.views.MaxRelativeLayout
         android:id="@+id/box_body"
-        android:layout_width="wrap_content"
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_marginLeft="15dp"
         android:layout_marginRight="15dp"

+ 62 - 55
DialogXIOSStyle/src/main/res/layout/layout_dialogx_poptip_ios.xml

@@ -7,65 +7,72 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="50dp"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginTop="10dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:background="@drawable/rect_dialogx_ios_poptip_bkg"
-        android:elevation="200dp"
-        android:gravity="center_vertical"
-        android:paddingLeft="10dp"
-        android:paddingRight="10dp">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="15dp"
-            android:gravity="left|center_vertical"
-            android:layout_weight="1"
-            android:singleLine="true"
-            android:text="Sure?"
-            android:textColor="@color/black"
-            android:textSize="14dp" />
-
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="5dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:gravity="left|center_vertical"
+            android:layout_height="50dp"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:background="@drawable/rect_dialogx_ios_poptip_bkg"
+            android:elevation="200dp"
+            android:gravity="center_vertical"
             android:paddingLeft="10dp"
             android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxColorBlue"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            android:orientation="horizontal">
+
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="5dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:gravity="left|center_vertical"
+                android:layout_weight="1"
+                android:singleLine="true"
+                android:text="Sure?"
+                android:textColor="@color/black"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="5dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxColorBlue"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 61 - 54
DialogXIOSStyle/src/main/res/layout/layout_dialogx_poptip_ios_dark.xml

@@ -7,64 +7,71 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="50dp"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginTop="10dp"
-        android:layout_marginRight="35dp"
-        android:background="@drawable/rect_dialogx_ios_poptip_bkg_night"
-        android:elevation="100dp"
-        android:gravity="center_vertical"
-        android:paddingLeft="10dp"
-        android:paddingRight="10dp">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginRight="15dp"
-            android:gravity="left|center_vertical"
-            android:layout_weight="1"
-            android:singleLine="true"
-            android:text="Sure?"
-            android:textColor="@color/white"
-            android:textSize="14dp" />
-
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="5dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:gravity="left|center_vertical"
+            android:layout_height="50dp"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginRight="35dp"
+            android:background="@drawable/rect_dialogx_ios_poptip_bkg_night"
+            android:elevation="100dp"
+            android:gravity="center_vertical"
             android:paddingLeft="10dp"
             android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxIOSBlueDark"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            android:orientation="horizontal">
+
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="5dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginRight="15dp"
+                android:gravity="left|center_vertical"
+                android:layout_weight="1"
+                android:singleLine="true"
+                android:text="Sure?"
+                android:textColor="@color/white"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="5dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxIOSBlueDark"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 64 - 58
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_poptip_kongzue.xml

@@ -7,69 +7,75 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:background="@drawable/rect_dialogx_kongzue_poptip_bkg"
-        android:elevation="5dp"
-        android:gravity="center_vertical"
-        android:minHeight="45dp"
-        android:orientation="horizontal"
-        android:paddingLeft="5dp"
-        android:paddingRight="5dp">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="8dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
-            android:layout_weight="1"
-            android:gravity="left|center_vertical"
-            android:text="Sure?"
-            android:textColor="@color/black"
-            android:textSize="14dp" />
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:background="@drawable/rect_dialogx_kongzue_poptip_bkg"
+            android:elevation="5dp"
+            android:gravity="center_vertical"
+            android:minHeight="45dp"
+            android:orientation="horizontal"
+            android:paddingLeft="5dp"
+            android:paddingRight="5dp">
 
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
 
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="-5dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:background="@drawable/button_dialogx_material_light"
-            android:gravity="left|center_vertical"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxColorBlue"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:gravity="left|center_vertical"
+                android:text="Sure?"
+                android:textColor="@color/black"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="-5dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:background="@drawable/button_dialogx_material_light"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxColorBlue"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 64 - 58
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_poptip_kongzue_dark.xml

@@ -7,69 +7,75 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:paddingLeft="5dp"
-        android:paddingRight="5dp"
-        android:background="@drawable/rect_dialogx_kongzue_poptip_bkg_night"
-        android:elevation="5dp"
-        android:gravity="center_vertical"
-        android:minHeight="45dp"
-        android:orientation="horizontal">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="8dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
-            android:layout_weight="1"
-            android:gravity="left|center_vertical"
-            android:text="Sure?"
-            android:textColor="@color/white"
-            android:textSize="14dp" />
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:paddingLeft="5dp"
+            android:paddingRight="5dp"
+            android:background="@drawable/rect_dialogx_kongzue_poptip_bkg_night"
+            android:elevation="5dp"
+            android:gravity="center_vertical"
+            android:minHeight="45dp"
+            android:orientation="horizontal">
 
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
 
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="-5dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:background="@drawable/button_dialogx_material_night"
-            android:gravity="left|center_vertical"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxPopButtonBlueDark"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:gravity="left|center_vertical"
+                android:text="Sure?"
+                android:textColor="@color/white"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="-5dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:background="@drawable/button_dialogx_material_night"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxPopButtonBlueDark"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 64 - 58
DialogXMaterialYou/src/main/res/layout/layout_dialogx_poptip_material_you.xml

@@ -8,69 +8,75 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:background="@drawable/rect_dialogx_material_you_poptip_bkg"
-        android:elevation="2dp"
-        android:gravity="center_vertical"
-        android:minHeight="45dp"
-        android:orientation="horizontal"
-        android:paddingLeft="5dp"
-        android:paddingRight="5dp">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
-            android:layout_weight="1"
-            android:gravity="left|center_vertical"
-            android:text="Sure?"
-            android:textColor="@color/black"
-            android:textSize="14dp" />
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:background="@drawable/rect_dialogx_material_you_poptip_bkg"
+            android:elevation="2dp"
+            android:gravity="center_vertical"
+            android:minHeight="45dp"
+            android:orientation="horizontal"
+            android:paddingLeft="5dp"
+            android:paddingRight="5dp">
 
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="5dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
 
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="-10dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:background="@drawable/button_dialogx_material_you_light"
-            android:gravity="left|center_vertical"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxColorBlue"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:gravity="left|center_vertical"
+                android:text="Sure?"
+                android:textColor="@color/black"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="-10dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:background="@drawable/button_dialogx_material_you_light"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxColorBlue"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 64 - 58
DialogXMaterialYou/src/main/res/layout/layout_dialogx_poptip_material_you_dark.xml

@@ -8,69 +8,75 @@
     android:orientation="vertical"
     app:baseFocusable="false">
 
-    <LinearLayout
-        android:id="@+id/box_body"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
-        android:layout_centerHorizontal="true"
-        android:layout_marginLeft="35dp"
-        android:layout_marginRight="35dp"
-        android:layout_marginBottom="100dp"
-        android:paddingLeft="5dp"
-        android:paddingRight="5dp"
-        android:background="@drawable/rect_dialogx_material_you_poptip_bkg_night"
-        android:elevation="2dp"
-        android:gravity="center_vertical"
-        android:minHeight="45dp"
-        android:orientation="horizontal">
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
 
-        <ImageView
-            android:id="@+id/img_dialogx_pop_icon"
-            android:layout_width="26dp"
-            android:layout_height="26dp"
-            android:layout_marginLeft="5dp"
-            android:layout_marginRight="-5dp"
-            android:visibility="gone" />
-
-        <TextView
-            android:id="@+id/txt_dialogx_pop_text"
+        <LinearLayout
+            android:id="@+id/box_body"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
-            android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
-            android:layout_weight="1"
-            android:gravity="left|center_vertical"
-            android:text="Sure?"
-            android:textColor="@color/white"
-            android:textSize="14dp" />
+            android:layout_alignParentBottom="true"
+            android:layout_centerHorizontal="true"
+            android:layout_marginLeft="35dp"
+            android:layout_marginRight="35dp"
+            android:layout_marginBottom="100dp"
+            android:paddingLeft="5dp"
+            android:paddingRight="5dp"
+            android:background="@drawable/rect_dialogx_material_you_poptip_bkg_night"
+            android:elevation="2dp"
+            android:gravity="center_vertical"
+            android:minHeight="45dp"
+            android:orientation="horizontal">
 
-        <RelativeLayout
-            android:id="@+id/box_custom"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone" />
+            <ImageView
+                android:id="@+id/img_dialogx_pop_icon"
+                android:layout_width="26dp"
+                android:layout_height="26dp"
+                android:layout_marginLeft="5dp"
+                android:layout_marginRight="-5dp"
+                android:visibility="gone" />
 
-        <TextView
-            android:id="@+id/txt_dialogx_button"
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_marginLeft="-10dp"
-            android:layout_marginTop="5dp"
-            android:layout_marginRight="5dp"
-            android:layout_marginBottom="5dp"
-            android:background="@drawable/button_dialogx_material_you_night"
-            android:gravity="left|center_vertical"
-            android:paddingLeft="10dp"
-            android:paddingRight="10dp"
-            android:singleLine="true"
-            android:text="Dismiss"
-            android:textColor="@color/dialogxPopButtonBlueDark"
-            android:textSize="14dp"
-            android:visibility="gone" />
+            <TextView
+                android:id="@+id/txt_dialogx_pop_text"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="15dp"
+                android:layout_marginTop="10dp"
+                android:layout_marginRight="15dp"
+                android:layout_marginBottom="10dp"
+                android:layout_weight="1"
+                android:gravity="left|center_vertical"
+                android:text="Sure?"
+                android:textColor="@color/white"
+                android:textSize="14dp" />
+
+            <RelativeLayout
+                android:id="@+id/box_custom"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone" />
+
+            <TextView
+                android:id="@+id/txt_dialogx_button"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="-10dp"
+                android:layout_marginTop="5dp"
+                android:layout_marginRight="5dp"
+                android:layout_marginBottom="5dp"
+                android:background="@drawable/button_dialogx_material_you_night"
+                android:gravity="left|center_vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp"
+                android:singleLine="true"
+                android:text="Dismiss"
+                android:textColor="@color/dialogxPopButtonBlueDark"
+                android:textSize="14dp"
+                android:visibility="gone" />
+
+        </LinearLayout>
 
-    </LinearLayout>
+    </RelativeLayout>
 
 </com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

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

@@ -521,7 +521,7 @@ public class MainActivity extends BaseActivity {
                             @Override
                             public boolean onClick(MessageDialog baseDialog, View v) {
                                 PopTip.show("点击确定按钮");
-                                return false;
+                                return true;
                             }
                         });
             }
@@ -1034,6 +1034,7 @@ public class MainActivity extends BaseActivity {
                                 });
                             }
                         })
+                        //.setAnimResId(R.anim.anim_right_in, R.anim.anim_right_out)
                         .setMaskColor(getResources().getColor(R.color.black30))
                 //实现完全自定义动画效果
 //                        .setDialogXAnimImpl(new DialogXAnimInterface<CustomDialog>() {

+ 11 - 0
app/src/main/res/anim/anim_right_in.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:duration="200"
+        android:fromXDelta="100%p"
+        android:toXDelta="0"/>
+    <alpha
+        android:duration="200"
+        android:fromAlpha="0.0"
+        android:toAlpha="1.0"/>
+</set>

+ 11 - 0
app/src/main/res/anim/anim_right_out.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+    <translate
+        android:duration="200"
+        android:fromXDelta="0"
+        android:toXDelta="100%p"/>
+    <alpha
+        android:duration="200"
+        android:fromAlpha="1.0"
+        android:toAlpha="0.0"/>
+</set>

+ 4 - 1
app/src/main/res/layout/layout_full_login.xml

@@ -8,7 +8,6 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingBottom="50dp"
         android:gravity="center_horizontal"
         android:orientation="vertical">
 
@@ -163,6 +162,10 @@
                 android:textSize="13dp" />
 
         </LinearLayout>
+
+        <Space
+            android:layout_width="match_parent"
+            android:layout_height="50dp"/>
     </LinearLayout>
 
 </RelativeLayout>

+ 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.beta12
+BUILD_VERSION=0.0.48.beta13
 BUILD_VERSION_INT=47
 DIALOGX_STYLE_VERSION=5