Browse Source

update 0.0.19 ver.
MessageDialog增加不需要okText的构造方法;
BottomDialog增加ok、other按钮,但目前仅限Material风格使用,其他主题的样式开发中;

kongzue 4 years ago
parent
commit
305148cf5e

+ 3 - 3
DialogX/build.gradle

@@ -6,7 +6,7 @@ def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
 def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
 
 group = "com.kongzue.dialogx"
-version = "0.0.18"
+version = "0.0.19"
 
 android {
     compileSdkVersion 30
@@ -14,8 +14,8 @@ android {
     defaultConfig {
         minSdkVersion 21
         targetSdkVersion 30
-        versionCode 18
-        versionName "0.0.18"
+        versionCode 19
+        versionName "0.0.19"
 
         consumerProguardFiles "consumer-rules.pro"
 

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

@@ -84,7 +84,7 @@ public class DialogX {
     public static boolean cancelableTipDialog = false;
     
     //默认取消按钮文本文字,影响 BottomDialog
-    public static String cancelButtonText = "取消";
+    public static String cancelButtonText ;
     
     //默认 PopTip 文本样式
     public static TextInfo popTextInfo;

+ 123 - 10
DialogX/src/main/java/com/kongzue/dialogx/dialogs/BottomDialog.java

@@ -13,6 +13,7 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 import android.widget.ScrollView;
+import android.widget.Space;
 import android.widget.TextView;
 
 import androidx.annotation.ColorInt;
@@ -22,6 +23,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.BaseOnDialogClickCallback;
 import com.kongzue.dialogx.interfaces.DialogConvertViewInterface;
 import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
 import com.kongzue.dialogx.interfaces.DialogXStyle;
@@ -51,12 +53,18 @@ public class BottomDialog extends BaseDialog {
     protected CharSequence title;
     protected CharSequence message;
     protected CharSequence cancelText;
+    protected CharSequence okText;
+    protected CharSequence otherText;
     protected boolean allowInterceptTouch = true;
     protected OnDialogButtonClickListener<BottomDialog> cancelButtonClickListener;
+    protected OnDialogButtonClickListener<BottomDialog> okButtonClickListener;
+    protected OnDialogButtonClickListener<BottomDialog> otherButtonClickListener;
     
     protected TextInfo titleTextInfo;
     protected TextInfo messageTextInfo;
     protected TextInfo cancelTextInfo = new TextInfo().setBold(true);
+    protected TextInfo okTextInfo = new TextInfo().setBold(true);
+    protected TextInfo otherTextInfo = new TextInfo().setBold(true);
     
     /**
      * 此值用于,当禁用滑动时(style.overrideBottomDialogRes.touchSlide = false时)的最大显示高度。
@@ -191,6 +199,9 @@ public class BottomDialog extends BaseDialog {
         public TextView btnCancel;
         public BlurView cancelBlurView;
         
+        public TextView btnSelectOther;
+        public TextView btnSelectPositive;
+        
         public DialogImpl(View convertView) {
             boxRoot = convertView.findViewById(R.id.box_root);
             boxBkg = convertView.findViewById(R.id.box_bkg);
@@ -207,6 +218,10 @@ public class BottomDialog extends BaseDialog {
             blurView = convertView.findViewById(R.id.blurView);
             boxCancel = convertView.findViewWithTag("cancelBox");
             btnCancel = convertView.findViewWithTag("cancel");
+            
+            btnSelectOther = convertView.findViewById(R.id.btn_selectOther);
+            btnSelectPositive = convertView.findViewById(R.id.btn_selectPositive);
+            
             init();
             refreshView();
         }
@@ -227,10 +242,18 @@ public class BottomDialog extends BaseDialog {
             if (titleTextInfo == null) titleTextInfo = DialogX.menuTitleInfo;
             if (titleTextInfo == null) titleTextInfo = DialogX.titleTextInfo;
             if (messageTextInfo == null) messageTextInfo = DialogX.messageTextInfo;
+            if (okTextInfo == null) okTextInfo = DialogX.okButtonTextInfo;
+            if (okTextInfo == null) okTextInfo = DialogX.buttonTextInfo;
             if (cancelTextInfo == null) cancelTextInfo = DialogX.buttonTextInfo;
+            if (otherTextInfo == null) otherTextInfo = DialogX.buttonTextInfo;
             if (backgroundColor == -1) backgroundColor = DialogX.backgroundColor;
             if (cancelText == null) cancelText = DialogX.cancelButtonText;
             
+            txtDialogTitle.getPaint().setFakeBoldText(true);
+            if (btnCancel != null) btnCancel.getPaint().setFakeBoldText(true);
+            if (btnSelectPositive != null) btnSelectPositive.getPaint().setFakeBoldText(true);
+            if (btnSelectOther != null) btnSelectOther.getPaint().setFakeBoldText(true);
+            
             boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
                 @Override
                 public void onShow() {
@@ -285,6 +308,34 @@ public class BottomDialog extends BaseDialog {
                     }
                 });
             }
+            if (btnSelectOther != null) {
+                btnSelectOther.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        if (otherButtonClickListener != null) {
+                            if (!otherButtonClickListener.onClick(me, v)) {
+                                dismiss();
+                            }
+                        } else {
+                            dismiss();
+                        }
+                    }
+                });
+            }
+            if (btnSelectPositive != null) {
+                btnSelectPositive.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        if (okButtonClickListener != null) {
+                            if (!okButtonClickListener.onClick(me, v)) {
+                                dismiss();
+                            }
+                        } else {
+                            dismiss();
+                        }
+                    }
+                });
+            }
             
             if (imgSplit != null) {
                 int dividerRes = style.overrideBottomDialogRes().overrideMenuDividerDrawableRes(isLightTheme());
@@ -354,14 +405,14 @@ public class BottomDialog extends BaseDialog {
                 }
             }
             
-            txtDialogTitle.getPaint().setFakeBoldText(true);
-            
             showText(txtDialogTitle, title);
             showText(txtDialogTip, message);
             
             useTextInfo(txtDialogTitle, titleTextInfo);
             useTextInfo(txtDialogTip, messageTextInfo);
             useTextInfo(btnCancel, cancelTextInfo);
+            useTextInfo(btnSelectOther, otherTextInfo);
+            useTextInfo(btnSelectPositive, okTextInfo);
             
             if (cancelable) {
                 boxRoot.setOnClickListener(new View.OnClickListener() {
@@ -408,14 +459,10 @@ public class BottomDialog extends BaseDialog {
                     boxCancel.setVisibility(View.VISIBLE);
                 }
             }
-            if (btnCancel != null) {
-                if (isNull(cancelText)) {
-                    btnCancel.setVisibility(View.GONE);
-                } else {
-                    showText(btnCancel, cancelText);
-                    btnCancel.setVisibility(View.VISIBLE);
-                }
-            }
+            
+            showText(btnSelectPositive, okText);
+            showText(btnCancel, cancelText);
+            showText(btnSelectOther, otherText);
         }
         
         @Override
@@ -661,4 +708,70 @@ public class BottomDialog extends BaseDialog {
         refreshUI();
         return this;
     }
+    
+    public CharSequence getOkButton() {
+        return okText;
+    }
+    
+    public BottomDialog setOkButton(CharSequence okText) {
+        this.okText = okText;
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOkButton(int OkTextResId) {
+        this.okText = getString(OkTextResId);
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOkButton(OnDialogButtonClickListener<BottomDialog> OkButtonClickListener) {
+        this.okButtonClickListener = OkButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOkButton(CharSequence OkText, OnDialogButtonClickListener<BottomDialog> OkButtonClickListener) {
+        this.okText = OkText;
+        this.okButtonClickListener = OkButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOkButton(int OkTextResId, OnDialogButtonClickListener<BottomDialog> OkButtonClickListener) {
+        this.okText = getString(OkTextResId);
+        this.okButtonClickListener = OkButtonClickListener;
+        return this;
+    }
+    
+    public CharSequence getOtherButton() {
+        return otherText;
+    }
+    
+    public BottomDialog setOtherButton(CharSequence otherText) {
+        this.otherText = otherText;
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(int OtherTextResId) {
+        this.otherText = getString(OtherTextResId);
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(OnDialogButtonClickListener<BottomDialog> OtherButtonClickListener) {
+        this.otherButtonClickListener = OtherButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(CharSequence OtherText, OnDialogButtonClickListener<BottomDialog> OtherButtonClickListener) {
+        this.otherText = OtherText;
+        this.otherButtonClickListener = OtherButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(int OtherTextResId, OnDialogButtonClickListener<BottomDialog> OtherButtonClickListener) {
+        this.otherText = getString(OtherTextResId);
+        this.otherButtonClickListener = OtherButtonClickListener;
+        return this;
+    }
 }

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

@@ -809,4 +809,70 @@ public class BottomMenu extends BottomDialog {
         refreshUI();
         return this;
     }
+    
+    public CharSequence getOkButton() {
+        return okText;
+    }
+    
+    public BottomDialog setOkButton(CharSequence okText) {
+        this.okText = okText;
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOkButton(int OkTextResId) {
+        this.okText = getString(OkTextResId);
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOkButton(OnDialogButtonClickListener<BottomDialog> OkButtonClickListener) {
+        this.okButtonClickListener = OkButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOkButton(CharSequence OkText, OnDialogButtonClickListener<BottomDialog> OkButtonClickListener) {
+        this.okText = OkText;
+        this.okButtonClickListener = OkButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOkButton(int OkTextResId, OnDialogButtonClickListener<BottomDialog> OkButtonClickListener) {
+        this.okText = getString(OkTextResId);
+        this.okButtonClickListener = OkButtonClickListener;
+        return this;
+    }
+    
+    public CharSequence getOtherButton() {
+        return otherText;
+    }
+    
+    public BottomDialog setOtherButton(CharSequence otherText) {
+        this.otherText = otherText;
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(int OtherTextResId) {
+        this.otherText = getString(OtherTextResId);
+        refreshUI();
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(OnDialogButtonClickListener<BottomDialog> OtherButtonClickListener) {
+        this.otherButtonClickListener = OtherButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(CharSequence OtherText, OnDialogButtonClickListener<BottomDialog> OtherButtonClickListener) {
+        this.otherText = OtherText;
+        this.otherButtonClickListener = OtherButtonClickListener;
+        return this;
+    }
+    
+    public BottomDialog setOtherButton(int OtherTextResId, OnDialogButtonClickListener<BottomDialog> OtherButtonClickListener) {
+        this.otherText = getString(OtherTextResId);
+        this.otherButtonClickListener = OtherButtonClickListener;
+        return this;
+    }
 }

+ 23 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -84,6 +84,11 @@ public class MessageDialog extends BaseDialog {
         return new MessageDialog();
     }
     
+    public MessageDialog(CharSequence title, CharSequence message) {
+        this.title = title;
+        this.message = message;
+    }
+    
     public MessageDialog(CharSequence title, CharSequence message, CharSequence okText) {
         this.title = title;
         this.message = message;
@@ -96,6 +101,11 @@ public class MessageDialog extends BaseDialog {
         this.okText = getString(okTextResId);
     }
     
+    public MessageDialog(int titleResId, int messageResId) {
+        this.title = getString(titleResId);
+        this.message = getString(messageResId);
+    }
+    
     public static MessageDialog show(CharSequence title, CharSequence message, CharSequence okText) {
         MessageDialog messageDialog = new MessageDialog(title, message, okText);
         messageDialog.show();
@@ -108,6 +118,18 @@ public class MessageDialog extends BaseDialog {
         return messageDialog;
     }
     
+    public static MessageDialog show(CharSequence title, CharSequence message) {
+        MessageDialog messageDialog = new MessageDialog(title, message);
+        messageDialog.show();
+        return messageDialog;
+    }
+    
+    public static MessageDialog show(int titleResId, int messageResId) {
+        MessageDialog messageDialog = new MessageDialog(titleResId, messageResId);
+        messageDialog.show();
+        return messageDialog;
+    }
+    
     public MessageDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
         this.title = title;
         this.message = message;
@@ -390,6 +412,7 @@ public class MessageDialog extends BaseDialog {
             showText(btnSelectPositive, okText);
             showText(btnSelectNegative, cancelText);
             showText(btnSelectOther, otherText);
+            
             txtInput.setText(inputText);
             txtInput.setHint(inputHintText);
             if (spaceOtherButton != null) {

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

@@ -133,11 +133,11 @@ public class BaseDialog {
         if (textInfo.getGravity() != -1) {
             textView.setGravity(textInfo.getGravity());
         }
-        Typeface font = Typeface.create(Typeface.SANS_SERIF, textInfo.isBold() ? Typeface.BOLD : Typeface.NORMAL);
-        textView.setTypeface(font);
+        textView.getPaint().setFakeBoldText(textInfo.isBold());
     }
     
     protected void showText(TextView textView, CharSequence text) {
+        if (textView == null) return;
         if (text == null) {
             textView.setVisibility(View.GONE);
             textView.setText("");

+ 69 - 12
DialogX/src/main/res/layout/layout_dialogx_bottom_material.xml

@@ -14,26 +14,26 @@
 
         <com.kongzue.dialogx.util.views.MaxRelativeLayout
             android:id="@+id/bkg"
-            android:clickable="true"
-            android:focusableInTouchMode="true"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentBottom="true"
-            android:background="@drawable/rect_dialogx_material_bottom_bkg_light">
+            android:background="@drawable/rect_dialogx_material_bottom_bkg_light"
+            android:clickable="true"
+            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:orientation="vertical"
-                android:paddingTop="10dp">
-
-                <ImageView
-                    android:id="@+id/img_tab"
-                    android:layout_width="30dp"
-                    android:layout_height="4dp"
-                    android:layout_gravity="center_horizontal"
-                    android:layout_marginBottom="1dp"
-                    android:src="@drawable/rect_dialogx_material_dialogtap" />
+                android:paddingTop="15dp">
 
                 <TextView
                     android:id="@+id/txt_dialog_title"
@@ -67,6 +67,7 @@
                             android:layout_width="match_parent"
                             android:layout_height="wrap_content"
                             android:layout_marginHorizontal="20dp"
+                            android:layout_marginBottom="5dp"
                             android:paddingBottom="5dp"
                             android:text="This is content text."
                             android:textColor="@color/black70"
@@ -86,6 +87,62 @@
 
                 </com.kongzue.dialogx.util.views.BottomDialogScrollView>
 
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingHorizontal="10dp">
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:layout_marginVertical="10dp"
+                        android:background="@drawable/button_dialogx_material_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="Other"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp"
+                        android:visibility="gone" />
+
+                    <Space
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1" />
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:layout_marginVertical="10dp"
+                        android:background="@drawable/button_dialogx_material_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:tag="cancel"
+                        android:text="Cancel"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:layout_marginVertical="10dp"
+                        android:background="@drawable/button_dialogx_material_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="OK"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                </LinearLayout>
+
             </LinearLayout>
 
         </com.kongzue.dialogx.util.views.MaxRelativeLayout>

+ 67 - 9
DialogX/src/main/res/layout/layout_dialogx_bottom_material_dark.xml

@@ -19,21 +19,22 @@
             android:background="@drawable/rect_dialogx_material_bottom_bkg_night"
             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:layout_marginBottom="1dp"
+                android:src="@drawable/rect_dialogx_material_dialogtap_night" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:paddingTop="10dp"
+                android:paddingTop="15dp"
                 android:clickable="true"
                 android:orientation="vertical">
 
-                <ImageView
-                    android:id="@+id/img_tab"
-                    android:layout_width="30dp"
-                    android:layout_height="4dp"
-                    android:layout_gravity="center_horizontal"
-                    android:layout_marginBottom="1dp"
-                    android:src="@drawable/rect_dialogx_material_dialogtap_night" />
-
                 <TextView
                     android:id="@+id/txt_dialog_title"
                     android:layout_width="match_parent"
@@ -67,6 +68,7 @@
                             android:layout_height="wrap_content"
                             android:layout_marginHorizontal="20dp"
                             android:paddingBottom="5dp"
+                            android:layout_marginBottom="5dp"
                             android:text="This is content text."
                             android:textColor="@color/white60"
                             android:textSize="16dp" />
@@ -85,6 +87,62 @@
 
                 </ScrollView>
 
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingHorizontal="10dp">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:layout_marginVertical="10dp"
+                        android:paddingHorizontal="15dp"
+                        android:text="Other"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp"
+                        android:visibility="gone" />
+
+                    <Space
+                        android:id="@+id/space_other_button"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:tag="cancel"
+                        android:layout_marginVertical="10dp"
+                        android:paddingHorizontal="15dp"
+                        android:text="Cancel"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:layout_marginVertical="10dp"
+                        android:paddingHorizontal="15dp"
+                        android:text="OK"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                </LinearLayout>
+
             </LinearLayout>
 
         </com.kongzue.dialogx.util.views.MaxRelativeLayout>

+ 3 - 3
DialogXIOSStyle/build.gradle

@@ -6,7 +6,7 @@ def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
 def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
 
 group = "com.kongzue.dialogx.style.ios"
-version = "0.0.18"
+version = "0.0.19"
 
 android {
     compileSdkVersion 30
@@ -14,8 +14,8 @@ android {
     defaultConfig {
         minSdkVersion 21
         targetSdkVersion 30
-        versionCode 18
-        versionName "0.0.18"
+        versionCode 19
+        versionName "0.0.19"
     }
 
     buildTypes {

+ 3 - 3
DialogXKongzueStyle/build.gradle

@@ -6,7 +6,7 @@ def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
 def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
 
 group = "com.kongzue.dialogx.style.kongzue"
-version = "0.0.18"
+version = "0.0.19"
 
 android {
     compileSdkVersion 30
@@ -14,8 +14,8 @@ android {
     defaultConfig {
         minSdkVersion 21
         targetSdkVersion 30
-        versionCode 18
-        versionName "0.0.18"
+        versionCode 19
+        versionName "0.0.19"
     }
 
     buildTypes {

+ 31 - 23
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue.xml

@@ -85,33 +85,41 @@
 
                 </ScrollView>
 
-                <ImageView
+                <LinearLayout
                     android:layout_width="match_parent"
-                    android:layout_height="1px"
-                    android:background="@color/dialogxKongzueButtonSplitLineColor" />
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:tag="cancelBox">
 
-                <ImageView
-                    android:layout_width="match_parent"
-                    android:layout_height="8dp"
-                    android:background="@color/dialogxKongzueButtonSplitSpaceColor" />
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="1px"
+                        android:background="@color/dialogxKongzueButtonSplitLineColor" />
 
-                <ImageView
-                    android:layout_width="match_parent"
-                    android:layout_height="1px"
-                    android:background="@color/dialogxKongzueButtonSplitLineColor" />
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="8dp"
+                        android:background="@color/dialogxKongzueButtonSplitSpaceColor" />
 
-                <TextView
-                    android:layout_width="match_parent"
-                    android:layout_height="50dp"
-                    android:background="@drawable/button_dialogx_kongzue_menu_light"
-                    android:gravity="center"
-                    android:paddingLeft="15dp"
-                    android:paddingRight="15dp"
-                    android:singleLine="true"
-                    android:tag="cancel"
-                    android:text="取消"
-                    android:textColor="@color/black90"
-                    android:textSize="16dp" />
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="1px"
+                        android:background="@color/dialogxKongzueButtonSplitLineColor" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:background="@drawable/button_dialogx_kongzue_menu_light"
+                        android:gravity="center"
+                        android:paddingLeft="15dp"
+                        android:paddingRight="15dp"
+                        android:singleLine="true"
+                        android:tag="cancel"
+                        android:text="取消"
+                        android:textColor="@color/black90"
+                        android:textSize="16dp" />
+
+                </LinearLayout>
 
             </LinearLayout>
 

+ 25 - 17
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_bottom_kongzue_dark.xml

@@ -68,7 +68,7 @@
                         <RelativeLayout
                             android:id="@+id/box_custom"
                             android:layout_width="match_parent"
-                            android:layout_height="wrap_content"/>
+                            android:layout_height="wrap_content" />
 
                         <ImageView
                             android:layout_width="match_parent"
@@ -79,29 +79,37 @@
                         <RelativeLayout
                             android:id="@+id/box_list"
                             android:layout_width="match_parent"
-                            android:layout_height="wrap_content"/>
+                            android:layout_height="wrap_content" />
 
                     </LinearLayout>
 
                 </ScrollView>
 
-                <ImageView
+                <LinearLayout
                     android:layout_width="match_parent"
-                    android:layout_height="8dp"
-                    android:background="@color/dialogxKongzueDarkButtonSplitSpaceColor" />
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical"
+                    android:tag="cancelBox">
 
-                <TextView
-                    android:layout_width="match_parent"
-                    android:layout_height="50dp"
-                    android:background="@drawable/button_dialogx_kongzue_menu_night"
-                    android:gravity="center"
-                    android:paddingLeft="15dp"
-                    android:paddingRight="15dp"
-                    android:singleLine="true"
-                    android:tag="cancel"
-                    android:text="取消"
-                    android:textColor="@color/white90"
-                    android:textSize="16dp" />
+                    <ImageView
+                        android:layout_width="match_parent"
+                        android:layout_height="8dp"
+                        android:background="@color/dialogxKongzueDarkButtonSplitSpaceColor" />
+
+                    <TextView
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:background="@drawable/button_dialogx_kongzue_menu_night"
+                        android:gravity="center"
+                        android:paddingLeft="15dp"
+                        android:paddingRight="15dp"
+                        android:singleLine="true"
+                        android:tag="cancel"
+                        android:text="取消"
+                        android:textColor="@color/white90"
+                        android:textSize="16dp" />
+
+                </LinearLayout>
 
             </LinearLayout>
 

+ 3 - 3
DialogXMIUIStyle/build.gradle

@@ -6,7 +6,7 @@ def siteUrl = 'https://github.com/kongzue/DialogX' //项目在github主页地址
 def gitUrl = 'https://github.com/kongzue/DialogX.git'   //Git仓库的地址
 
 group = "com.kongzue.dialogx.style.miui"
-version = "0.0.18"
+version = "0.0.19"
 
 android {
     compileSdkVersion 30
@@ -14,8 +14,8 @@ android {
     defaultConfig {
         minSdkVersion 21
         targetSdkVersion 30
-        versionCode 18
-        versionName "0.0.18"
+        versionCode 19
+        versionName "0.0.19"
 
     }
 

+ 3 - 3
app/build.gradle

@@ -31,9 +31,9 @@ dependencies {
     implementation 'androidx.appcompat:appcompat:1.2.0'
     implementation 'com.kongzue.baseframeworkx:baseframework:6.7.6'
 
-    implementation 'com.kongzue.dialogx.style.ios:DialogXIOSStyle:0.0.16'
-    implementation 'com.kongzue.dialogx.style.kongzue:DialogXKongzueStyle:0.0.16'
-    implementation 'com.kongzue.dialogx.style.miui:DialogXMIUIStyle:0.0.16'
+    implementation 'com.kongzue.dialogx.style.ios:DialogXIOSStyle:0.0.19'
+    implementation 'com.kongzue.dialogx.style.kongzue:DialogXKongzueStyle:0.0.19'
+    implementation 'com.kongzue.dialogx.style.miui:DialogXMIUIStyle:0.0.19'
 
     implementation project(path: ':DialogX')
 }

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

@@ -606,8 +606,6 @@ public class MainActivity extends BaseActivity {
                                 dialog.dismiss();
                             }
                         });
-    
-                        dialog.getDialogImpl().boxRoot.setBackgroundResource(R.color.black40);
                     }
                 }).setFullScreen(true);
             }