kongzue 4 éve
szülő
commit
0b758673f4
21 módosított fájl, 579 hozzáadás és 81 törlés
  1. 287 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java
  2. 11 6
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java
  3. 10 5
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/WaitDialog.java
  4. 19 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogConvertViewInterface.java
  5. 98 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java
  6. 11 0
      DialogX/src/main/res/anim/anim_dialogx_bottom_enter.xml
  7. 11 0
      DialogX/src/main/res/anim/anim_dialogx_bottom_exit.xml
  8. 11 0
      DialogX/src/main/res/drawable/rect_dialogx_material_bottom_bkg_light.xml
  9. 6 0
      DialogX/src/main/res/drawable/rect_dialogx_material_dialogtap.xml
  10. 89 0
      DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml
  11. 1 0
      DialogX/src/main/res/layout/layout_dialogx_material.xml
  12. 1 0
      DialogX/src/main/res/layout/layout_dialogx_material_dark.xml
  13. 1 0
      DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios.xml
  14. 3 2
      DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios_dark.xml
  15. 1 0
      DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue.xml
  16. 1 0
      DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue_dark.xml
  17. 1 0
      DialogXMIUIStyle/src/main/res/layout/layout_dialogx_miui.xml
  18. 1 0
      DialogXMIUIStyle/src/main/res/layout/layout_dialogx_miui_dark.xml
  19. 3 2
      README.md
  20. 10 8
      app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java
  21. 3 58
      app/src/main/res/layout/activity_main.xml

+ 287 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -0,0 +1,287 @@
+package com.kongzue.dialogx.dialogs;
+
+import android.animation.Animator;
+import android.animation.ObjectAnimator;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.DecelerateInterpolator;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+import com.kongzue.dialogx.DialogX;
+import com.kongzue.dialogx.R;
+import com.kongzue.dialogx.impl.AnimatorListenerEndCallBack;
+import com.kongzue.dialogx.interfaces.BaseDialog;
+import com.kongzue.dialogx.interfaces.DialogConvertViewInterface;
+import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
+import com.kongzue.dialogx.interfaces.DialogXStyle;
+import com.kongzue.dialogx.interfaces.OnBackPressedListener;
+import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
+import com.kongzue.dialogx.util.views.MaxRelativeLayout;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/10/6 15:17
+ */
+public class BottomDialog extends BaseDialog {
+    
+    private DialogLifecycleCallback<BottomDialog> dialogLifecycleCallback;
+    
+    protected BottomDialog me;
+    
+    public BottomDialog() {
+        me = this;
+    }
+    
+    private View dialogView;
+    
+    public void show() {
+        int layoutId = R.layout.layout_dialogx_bottom_material;
+        
+        dialogView = createView(layoutId);
+        dialogImpl = new DialogImpl(dialogView);
+        show(dialogView);
+    }
+    
+    protected DialogImpl dialogImpl;
+    
+    class DialogImpl implements DialogConvertViewInterface {
+        
+        DialogXBaseRelativeLayout boxRoot;
+        RelativeLayout boxBkg;
+        MaxRelativeLayout bkg;
+        ImageView imgTab;
+        TextView txtDialogTitle;
+        ScrollView scrollView;
+        TextView txtDialogTip;
+        RelativeLayout boxCustom;
+        
+        public DialogImpl(View convertView) {
+            boxRoot = convertView.findViewById(R.id.box_root);
+            bkg = convertView.findViewById(R.id.bkg);
+            boxBkg = convertView.findViewById(R.id.box_bkg);
+            imgTab = convertView.findViewById(R.id.img_tab);
+            txtDialogTitle = convertView.findViewById(R.id.txt_dialog_title);
+            scrollView = convertView.findViewById(R.id.scrollView);
+            txtDialogTip = convertView.findViewById(R.id.txt_dialog_tip);
+            boxCustom = convertView.findViewById(R.id.box_custom);
+            init();
+            refreshView();
+        }
+        
+        private boolean isBkgTouched = false;
+        private float bkgTouchDownY;
+        private boolean isSvTouched = false;
+        private boolean isInterceptTouched = false;
+        private float svTouchDownY;
+        private float bkgEnterAimY;
+        
+        @Override
+        public void init() {
+            boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
+                @Override
+                public void onShow() {
+                    isShow = true;
+                    boxRoot.setAlpha(0f);
+                    
+                    scrollView.setOnTouchListener(new View.OnTouchListener() {
+                        @Override
+                        public boolean onTouch(View v, MotionEvent event) {
+                            switch (event.getAction()) {
+                                case MotionEvent.ACTION_DOWN:
+                                    svTouchDownY = event.getY();
+                                    isSvTouched = true;
+                                    break;
+                                case MotionEvent.ACTION_MOVE:
+                                    if (isSvTouched) {
+                                        if (scrollView.getScrollY() == 0) {
+                                            bkgTouchDownY = svTouchDownY;
+                                            bkg.setInterceptTouchEvent(true);
+                                            bkg.onTouchEvent(event);
+                                            isBkgTouched = true;
+                                            isInterceptTouched = true;
+                                            return true;
+                                        } else {
+                                            svTouchDownY = event.getY();
+                                            isInterceptTouched = false;
+                                        }
+                                    }
+                                    if (isInterceptTouched || bkg.getY() > 0) {
+                                        return true;
+                                    }
+                                    break;
+                                case MotionEvent.ACTION_UP:
+                                case MotionEvent.ACTION_CANCEL:
+                                    isInterceptTouched = false;
+                                    isSvTouched = false;
+                                    break;
+                            }
+                            return false;
+                        }
+                    });
+                    
+                    bkg.setOnTouchListener(new View.OnTouchListener() {
+                        @Override
+                        public boolean onTouch(View v, MotionEvent event) {
+                            switch (event.getAction()) {
+                                case MotionEvent.ACTION_DOWN:
+                                    bkgTouchDownY = event.getY();
+                                    isBkgTouched = true;
+                                    break;
+                                case MotionEvent.ACTION_MOVE:
+                                    if (isBkgTouched) {
+                                        float aimY = bkg.getY() + event.getY() - bkgTouchDownY;
+                                        if (aimY < 0) {
+                                            bkg.setInterceptTouchEvent(false);
+                                            scrollView.onTouchEvent(event);
+                                            bkg.setY(0);
+                                        } else {
+                                            if (bkg.isChildScrollViewCanScroll()) {
+                                                bkg.setInterceptTouchEvent(true);
+                                                bkg.setY(aimY);
+                                            } else {
+                                                if (aimY > bkgEnterAimY) {
+                                                    bkg.setInterceptTouchEvent(true);
+                                                    bkg.setY(aimY);
+                                                }
+                                            }
+                                        }
+                                    }
+                                    break;
+                                case MotionEvent.ACTION_UP:
+                                case MotionEvent.ACTION_CANCEL:
+                                    isBkgTouched = false;
+                                    if (bkg.getY() > 0) {
+                                        if (bkg.getY() < bkgEnterAimY  + dip2px(15)) {
+                                            ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), bkgEnterAimY);
+                                            enterAnim.setDuration(300);
+                                            enterAnim.start();
+                                        } else {
+                                            doDismiss(boxRoot);
+                                        }
+                                    }
+                                    break;
+                            }
+                            return true;
+                        }
+                    });
+                    scrollView.post(new Runnable() {
+                        @Override
+                        public void run() {
+                            bkg.setY(boxBkg.getHeight());
+                            if (bkg.isChildScrollViewCanScroll()) {
+                                bkgEnterAimY = boxBkg.getHeight() - bkg.getHeight() * 0.8f;
+                            } else {
+                                bkgEnterAimY = boxBkg.getHeight() - bkg.getHeight();
+                            }
+                            ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", boxBkg.getHeight(), bkgEnterAimY);
+                            enterAnim.setDuration(300);
+                            enterAnim.start();
+                            boxRoot.animate().setDuration(enterAnim.getDuration()).alpha(1f).setInterpolator(new DecelerateInterpolator()).setDuration(300).setListener(null);
+                            
+                            bkg.setInterceptTouchEvent(true);
+                        }
+                    });
+                    
+                    getDialogLifecycleCallback().onShow(me);
+                }
+                
+                @Override
+                public void onDismiss() {
+                    isShow = false;
+                    getDialogLifecycleCallback().onDismiss(me);
+                }
+            });
+        }
+        
+        @Override
+        public void refreshView() {
+            txtDialogTitle.getPaint().setFakeBoldText(true);
+            if (cancelable) {
+                boxRoot.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        doDismiss(v);
+                    }
+                });
+            } else {
+                boxRoot.setOnClickListener(null);
+            }
+            boxRoot.setOnBackPressedListener(new OnBackPressedListener() {
+                @Override
+                public boolean onBackPressed() {
+                    if (cancelable) {
+                        dismiss();
+                    }
+                    return false;
+                }
+            });
+        }
+        
+        @Override
+        public void doDismiss(View v) {
+            if (v != null) v.setEnabled(false);
+            
+            ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), boxBkg.getHeight());
+            exitAnim.setDuration(300);
+            exitAnim.start();
+            
+            boxRoot.animate().setDuration(300).alpha(0f).setInterpolator(new AccelerateInterpolator()).setDuration(exitAnim.getDuration()).setListener(new AnimatorListenerEndCallBack() {
+                @Override
+                public void onAnimationEnd(Animator animation) {
+                    dismiss(dialogView);
+                }
+            });
+        }
+    }
+    
+    public void refreshUI() {
+        if (dialogImpl == null) return;
+        dialogImpl.refreshView();
+    }
+    
+    public void dismiss() {
+        if (dialogImpl == null) return;
+        dialogImpl.doDismiss(null);
+    }
+    
+    public DialogLifecycleCallback<BottomDialog> getDialogLifecycleCallback() {
+        return dialogLifecycleCallback == null ? new DialogLifecycleCallback<BottomDialog>() {
+        } : dialogLifecycleCallback;
+    }
+    
+    public BottomDialog setDialogLifecycleCallback(DialogLifecycleCallback<BottomDialog> dialogLifecycleCallback) {
+        this.dialogLifecycleCallback = dialogLifecycleCallback;
+        return this;
+    }
+    
+    public BottomDialog setStyle(DialogXStyle style) {
+        this.style = style;
+        return this;
+    }
+    
+    public BottomDialog setTheme(DialogX.THEME theme) {
+        this.theme = theme;
+        return this;
+    }
+    
+    public boolean isCancelable() {
+        return cancelable;
+    }
+    
+    public BottomDialog setCancelable(boolean cancelable) {
+        this.cancelable = cancelable;
+        refreshUI();
+        return this;
+    }
+    
+    public DialogImpl getDialogImpl() {
+        return dialogImpl;
+    }
+}

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

@@ -21,6 +21,7 @@ import com.kongzue.dialogx.DialogX;
 import com.kongzue.dialogx.R;
 import com.kongzue.dialogx.impl.AnimatorListenerEndCallBack;
 import com.kongzue.dialogx.interfaces.BaseDialog;
+import com.kongzue.dialogx.interfaces.DialogConvertViewInterface;
 import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
 import com.kongzue.dialogx.interfaces.DialogXStyle;
 import com.kongzue.dialogx.interfaces.OnBackPressedListener;
@@ -137,7 +138,7 @@ public class MessageDialog extends BaseDialog {
         dialogImpl.refreshView();
     }
     
-    class DialogImpl {
+    class DialogImpl implements DialogConvertViewInterface {
         BlurView blurView;
         
         DialogXBaseRelativeLayout boxRoot;
@@ -167,8 +168,8 @@ public class MessageDialog extends BaseDialog {
             init();
             refreshView();
         }
-        
-        private void init() {
+    
+        public void init() {
             txtDialogTitle.getPaint().setFakeBoldText(true);
             btnSelectNegative.getPaint().setFakeBoldText(true);
             btnSelectPositive.getPaint().setFakeBoldText(true);
@@ -225,8 +226,8 @@ public class MessageDialog extends BaseDialog {
                 }
             });
         }
-        
-        private void refreshView() {
+    
+        public void refreshView() {
             bkg.setMaxWidth(DialogX.dialogMaxWidth);
             if (me instanceof InputDialog) {
                 txtInput.setVisibility(View.VISIBLE);
@@ -472,7 +473,7 @@ public class MessageDialog extends BaseDialog {
             });
             
         }
-        
+    
         public void doDismiss(View v) {
             if (v != null) v.setEnabled(false);
             
@@ -713,4 +714,8 @@ public class MessageDialog extends BaseDialog {
         refreshUI();
         return this;
     }
+    
+    public DialogImpl getDialogImpl() {
+        return dialogImpl;
+    }
 }

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

@@ -13,6 +13,7 @@ import android.widget.TextView;
 import com.kongzue.dialogx.R;
 import com.kongzue.dialogx.impl.AnimatorListenerEndCallBack;
 import com.kongzue.dialogx.interfaces.BaseDialog;
+import com.kongzue.dialogx.interfaces.DialogConvertViewInterface;
 import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
 import com.kongzue.dialogx.util.views.BlurView;
 import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
@@ -112,7 +113,7 @@ public class WaitDialog extends BaseDialog {
     
     protected DialogImpl dialogImpl;
     
-    class DialogImpl {
+    class DialogImpl implements DialogConvertViewInterface {
         DialogXBaseRelativeLayout boxRoot;
         MaxRelativeLayout bkg;
         BlurView blurView;
@@ -132,8 +133,8 @@ public class WaitDialog extends BaseDialog {
             init();
             refreshView();
         }
-        
-        private void init() {
+    
+        public void init() {
             blurView.setRadiusPx(dip2px(15));
             boxRoot.setClickable(true);
             //txtInfo.getPaint().setFakeBoldText(true);
@@ -179,8 +180,8 @@ public class WaitDialog extends BaseDialog {
         }
         
         private float oldProgress;
-        
-        private void refreshView() {
+    
+        public void refreshView() {
             if (style.overrideWaitTipRes() != null) {
                 int overrideBackgroundColorRes = style.overrideWaitTipRes().overrideBackgroundColorRes(isLightTheme());
                 if (overrideBackgroundColorRes == 0) {
@@ -307,4 +308,8 @@ public class WaitDialog extends BaseDialog {
         this.dialogLifecycleCallback = dialogLifecycleCallback;
         return this;
     }
+    
+    public DialogImpl getDialogImpl() {
+        return dialogImpl;
+    }
 }

+ 19 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogConvertViewInterface.java

@@ -0,0 +1,19 @@
+package com.kongzue.dialogx.interfaces;
+
+import android.view.View;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/10/6 15:52
+ */
+public interface DialogConvertViewInterface {
+    
+    void init();
+    
+    void refreshView();
+    
+    void doDismiss(View v);
+}

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

@@ -5,8 +5,19 @@ import android.content.res.TypedArray;
 import android.graphics.Canvas;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.MotionEvent;
 import android.view.View;
+import android.view.ViewParent;
 import android.widget.RelativeLayout;
+import android.widget.ScrollView;
+import android.widget.Toast;
+
+import androidx.annotation.NonNull;
+import androidx.core.view.NestedScrollingChildHelper;
+import androidx.core.view.NestedScrollingParent;
+import androidx.core.view.NestedScrollingParent2;
+import androidx.core.view.NestedScrollingParentHelper;
+import androidx.core.view.ViewCompat;
 
 import com.kongzue.dialogx.R;
 
@@ -47,6 +58,8 @@ public class MaxRelativeLayout extends RelativeLayout {
         }
     }
     
+    private ScrollView childScrollView;
+    
     public MaxRelativeLayout setMaxHeight(int maxHeight) {
         this.maxHeight = maxHeight;
         return this;
@@ -83,5 +96,90 @@ public class MaxRelativeLayout extends RelativeLayout {
         int maxHeightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, heightMode);
         int maxWidthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, widthMode);
         super.onMeasure(maxWidthMeasureSpec, maxHeightMeasureSpec);
+        
+        childScrollView = findViewById(R.id.scrollView);
+    }
+    
+    private boolean isMove = false;
+    private int touchY, touchX;
+    private boolean interceptTouchEvent;
+    
+    public boolean isInterceptTouchEvent() {
+        return interceptTouchEvent;
+    }
+    
+    public MaxRelativeLayout setInterceptTouchEvent(boolean interceptTouchEvent) {
+        this.interceptTouchEvent = interceptTouchEvent;
+        return this;
+    }
+    
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        if (onTouchListener!=null){
+            return onTouchListener.onTouch(this,event);
+        }
+        return super.onTouchEvent(event);
+    }
+    
+    @Override
+    public boolean onInterceptTouchEvent(MotionEvent event) {
+        if (onTouchListener != null && interceptTouchEvent) {
+            onTouchListener.onTouch(this, event);
+            switch (event.getAction()) {
+                case MotionEvent.ACTION_DOWN:
+                    isMove = false;
+                    break;
+                case MotionEvent.ACTION_CANCEL:
+                case MotionEvent.ACTION_UP:
+                    if (!isMove) {
+                        return false;
+                    }
+                    isMove = false;
+                    break;
+                case MotionEvent.ACTION_MOVE:
+                    if (!isMove) {
+                        touchY = (int) event.getRawY();
+                        touchX = (int) event.getRawX();
+                    }
+                    isMove = true;
+                    
+                    float moveY = event.getRawY();
+                    float moveX = event.getRawX();
+                    
+                    if (Math.abs(moveY - touchY) > dip2px(20) || Math.abs(moveX - touchX) > dip2px(20)) {
+                        final ViewParent parent = getParent();
+                        if (parent != null) {
+                            parent.requestDisallowInterceptTouchEvent(true);
+                        }
+                        return true;
+                    }
+                    break;
+            }
+            return isMove;
+        }
+        return super.onInterceptTouchEvent(event);
+    }
+    
+    public boolean isChildScrollViewCanScroll() {
+        if (childScrollView == null) return false;
+        View child = childScrollView.getChildAt(0);
+        if (child != null) {
+            int childHeight = child.getHeight();
+            return childScrollView.getHeight() < childHeight;
+        }
+        return false;
+    }
+    
+    private OnTouchListener onTouchListener;
+    
+    @Override
+    public void setOnTouchListener(OnTouchListener l) {
+        onTouchListener = l;
+        super.setOnTouchListener(l);
+    }
+    
+    public int dip2px(float dpValue) {
+        final float scale = getResources().getDisplayMetrics().density;
+        return (int) (dpValue * scale + 0.5f);
     }
 }

+ 11 - 0
DialogX/src/main/res/anim/anim_dialogx_bottom_enter.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="300"
+        android:fromYDelta="100%p"
+        android:toYDelta="0" />
+    <alpha
+        android:duration="300"
+        android:fromAlpha="0.0"
+        android:toAlpha="1.0" />
+</set>

+ 11 - 0
DialogX/src/main/res/anim/anim_dialogx_bottom_exit.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="300"
+        android:fromYDelta="0"
+        android:toYDelta="100%p"/>
+    <alpha
+        android:duration="300"
+        android:fromAlpha="1.0"
+        android:toAlpha="0.0"/>
+</set>

+ 11 - 0
DialogX/src/main/res/drawable/rect_dialogx_material_bottom_bkg_light.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <!--left to right-->
+    <solid
+        android:color="@color/white"/>
+
+    <corners
+        android:topRightRadius="10dp"
+        android:topLeftRadius="10dp"/>
+</shape>

+ 6 - 0
DialogX/src/main/res/drawable/rect_dialogx_material_dialogtap.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/black10"/>
+    <corners android:radius="99dp" />
+</shape>

+ 89 - 0
DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black20"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:id="@+id/box_bkg"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentBottom="true"
+            android:background="@drawable/rect_dialogx_material_bottom_bkg_light"
+            android:focusableInTouchMode="true">
+
+            <ImageView
+                android:id="@+id/img_tab"
+                android:layout_width="30dp"
+                android:layout_height="4dp"
+                android:layout_centerHorizontal="true"
+                android:layout_marginTop="10dp"
+                android:src="@drawable/rect_dialogx_material_dialogtap" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="15dp"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center_vertical"
+                    android:paddingHorizontal="20dp"
+                    android:paddingBottom="10dp"
+                    android:text="Title"
+                    android:textColor="@color/black"
+                    android:textSize="21dp" />
+
+                <ScrollView
+                    android:id="@+id/scrollView"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:overScrollMode="never"
+                    android:scrollbarSize="7dp"
+                    android:scrollbars="vertical">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginHorizontal="20dp"
+                            android:paddingBottom="15dp"
+                            android:text="This is content text."
+                            android:textColor="@color/black70"
+                            android:textSize="16dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="-10dp"/>
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 1 - 0
DialogX/src/main/res/layout/layout_dialogx_material.xml

@@ -40,6 +40,7 @@
                 <ScrollView
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:overScrollMode="never"
                     android:layout_weight="1">
 
                     <LinearLayout

+ 1 - 0
DialogX/src/main/res/layout/layout_dialogx_material_dark.xml

@@ -40,6 +40,7 @@
                 <ScrollView
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:overScrollMode="never"
                     android:layout_weight="1">
 
                     <LinearLayout

+ 1 - 0
DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios.xml

@@ -42,6 +42,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:scrollbarSize="7dp"
+                    android:overScrollMode="never"
                     android:scrollbarThumbVertical="@drawable/scrollbar_dialogx_vertical"
                     android:scrollbars="vertical"
                     android:layout_weight="1">

+ 3 - 2
DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios_dark.xml

@@ -41,10 +41,11 @@
                 <ScrollView
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:overScrollMode="never"
                     android:scrollbarSize="7dp"
                     android:scrollbarThumbVertical="@drawable/scrollbar_dialogx_vertical_dark"
-                    android:scrollbars="vertical"
-                    android:layout_weight="1">
+                    android:scrollbars="vertical">
 
                     <LinearLayout
                         android:layout_width="match_parent"

+ 1 - 0
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue.xml

@@ -40,6 +40,7 @@
                 <ScrollView
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:overScrollMode="never"
                     android:layout_weight="1">
 
                     <LinearLayout

+ 1 - 0
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue_dark.xml

@@ -40,6 +40,7 @@
                 <ScrollView
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
+                    android:overScrollMode="never"
                     android:layout_weight="1">
 
                     <LinearLayout

+ 1 - 0
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_miui.xml

@@ -39,6 +39,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:scrollbarSize="7dp"
+                    android:overScrollMode="never"
                     android:scrollbarThumbVertical="@drawable/scrollbar_dialogx_vertical"
                     android:scrollbars="vertical"
                     android:layout_weight="1">

+ 1 - 0
DialogXMIUIStyle/src/main/res/layout/layout_dialogx_miui_dark.xml

@@ -39,6 +39,7 @@
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:scrollbarSize="7dp"
+                    android:overScrollMode="never"
                     android:scrollbarThumbVertical="@drawable/scrollbar_dialogx_vertical_dark"
                     android:scrollbars="vertical"
                     android:layout_weight="1">

+ 3 - 2
README.md

@@ -7,7 +7,7 @@ DialogX 采用分离设计,默认自带 Material 主题,可选引入 IOS、K
 
 更低的耦合度,无论对话框是否正在显示,请肆意执行的 Activity 关闭逻辑,而无需担心引发 WindowLeaked 错误。
 
-目前开发进度:53% [========== · · · · · · · · · · ]
+目前开发进度:55% [=========== · · · · · · · · · ]
 
 ## 开发计划
 
@@ -17,7 +17,8 @@ DialogX开发计划
     InputDialog(extends MessageDialog)      √
     WaitDialog                              √
     TipDialog(extends WaitDialog)           √
-    BottomDialog                            ×
+    BottomDialog                            -
+    BottomMenu                              ×
     FullScreenDialog                        ×
     CustomDialog                            ×
     PopTip                                  ×

+ 10 - 8
app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java

@@ -17,6 +17,7 @@ import com.kongzue.baseframework.interfaces.NavigationBarBackgroundColorRes;
 import com.kongzue.baseframework.util.CycleRunner;
 import com.kongzue.baseframework.util.JumpParameter;
 import com.kongzue.dialogx.DialogX;
+import com.kongzue.dialogx.dialogs.BottomDialog;
 import com.kongzue.dialogx.dialogs.InputDialog;
 import com.kongzue.dialogx.dialogs.MessageDialog;
 import com.kongzue.dialogx.dialogs.TipDialog;
@@ -55,12 +56,9 @@ public class MainActivity extends BaseActivity {
     private TextView btnTipWarning;
     private TextView btnTipError;
     private TextView btnTipProgress;
-    private TextView btnModalDialog;
     private TextView btnShowBreak;
-    private TextView btnNotify;
+    private TextView btnBottomDialog;
     private TextView btnBottomMenu;
-    private TextView btnBottomMenuWithTitle;
-    private TextView btnShareDialog;
     private TextView btnCustomMessageDialog;
     private TextView btnCustomInputDialog;
     private TextView btnCustomBottomMenu;
@@ -93,12 +91,9 @@ public class MainActivity extends BaseActivity {
         btnTipWarning = findViewById(R.id.btn_tipWarning);
         btnTipError = findViewById(R.id.btn_tipError);
         btnTipProgress = findViewById(R.id.btn_tipProgress);
-        btnModalDialog = findViewById(R.id.btn_modalDialog);
         btnShowBreak = findViewById(R.id.btn_showBreak);
-        btnNotify = findViewById(R.id.btn_notify);
+        btnBottomDialog = findViewById(R.id.btn_bottom_dialog);
         btnBottomMenu = findViewById(R.id.btn_bottom_menu);
-        btnBottomMenuWithTitle = findViewById(R.id.btn_bottom_menu_withTitle);
-        btnShareDialog = findViewById(R.id.btn_shareDialog);
         btnCustomMessageDialog = findViewById(R.id.btn_customMessageDialog);
         btnCustomInputDialog = findViewById(R.id.btn_customInputDialog);
         btnCustomBottomMenu = findViewById(R.id.btn_customBottomMenu);
@@ -248,6 +243,13 @@ public class MainActivity extends BaseActivity {
                 }, 3000);
             }
         });
+    
+        btnBottomDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                new BottomDialog().show();
+            }
+        });
     }
     
     @Override

+ 3 - 58
app/src/main/res/layout/activity_main.xml

@@ -372,19 +372,6 @@
                     android:layout_height="wrap_content"
                     android:orientation="horizontal">
 
-                    <TextView
-                        android:id="@+id/btn_modalDialog"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_margin="5dp"
-                        android:background="@drawable/rect_button"
-                        android:paddingHorizontal="15dp"
-                        android:paddingVertical="10dp"
-                        android:text="序列化对话框"
-                        android:textColor="@color/white"
-                        android:textSize="13dp"
-                        android:textStyle="bold" />
-
                     <TextView
                         android:id="@+id/btn_showBreak"
                         android:layout_width="wrap_content"
@@ -404,7 +391,7 @@
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginTop="15dp"
-                    android:text="跨域通知"
+                    android:text="底部菜单"
                     android:textColor="#dc000000"
                     android:textSize="14dp"
                     android:textStyle="bold" />
@@ -415,34 +402,18 @@
                     android:orientation="horizontal">
 
                     <TextView
-                        android:id="@+id/btn_notify"
+                        android:id="@+id/btn_bottom_dialog"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_margin="5dp"
                         android:background="@drawable/rect_button"
                         android:paddingHorizontal="15dp"
                         android:paddingVertical="10dp"
-                        android:text="显示跨域通知"
+                        android:text="标题对话框"
                         android:textColor="@color/white"
                         android:textSize="13dp"
                         android:textStyle="bold" />
 
-                </LinearLayout>
-
-                <TextView
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="15dp"
-                    android:text="底部菜单"
-                    android:textColor="#dc000000"
-                    android:textSize="14dp"
-                    android:textStyle="bold" />
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:orientation="horizontal">
-
                     <TextView
                         android:id="@+id/btn_bottom_menu"
                         android:layout_width="wrap_content"
@@ -456,32 +427,6 @@
                         android:textSize="13dp"
                         android:textStyle="bold" />
 
-                    <TextView
-                        android:id="@+id/btn_bottom_menu_withTitle"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_margin="5dp"
-                        android:background="@drawable/rect_button"
-                        android:paddingHorizontal="15dp"
-                        android:paddingVertical="10dp"
-                        android:text="标题底部菜单"
-                        android:textColor="@color/white"
-                        android:textSize="13dp"
-                        android:textStyle="bold" />
-
-                    <TextView
-                        android:id="@+id/btn_shareDialog"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_margin="5dp"
-                        android:background="@drawable/rect_button"
-                        android:paddingHorizontal="15dp"
-                        android:paddingVertical="10dp"
-                        android:text="分享对话框"
-                        android:textColor="@color/white"
-                        android:textSize="13dp"
-                        android:textStyle="bold" />
-
                 </LinearLayout>
 
                 <TextView