From 62bee51fe35887bb56069512eba1f2a3351b279d Mon Sep 17 00:00:00 2001 From: hss01248 Date: Fri, 23 Mar 2018 19:42:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A9=E7=94=A8=E5=8F=8D=E5=B0=84=E6=9D=A5?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEmdalert=E7=9A=84=E6=A0=87=E9=A2=98=E5=92=8Cms?= =?UTF-8?q?g=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hss01248/dialogutildemo/MainActivity.java | 2 +- .../main/java/com/hss01248/dialog/Tool.java | 37 +- .../hss01248/dialog/config/ConfigBean.java | 324 ++++++++---------- 3 files changed, 174 insertions(+), 189 deletions(-) diff --git a/app/src/main/java/com/hss01248/dialogutildemo/MainActivity.java b/app/src/main/java/com/hss01248/dialogutildemo/MainActivity.java index bc60fb9..9d50aaf 100644 --- a/app/src/main/java/com/hss01248/dialogutildemo/MainActivity.java +++ b/app/src/main/java/com/hss01248/dialogutildemo/MainActivity.java @@ -545,7 +545,7 @@ public void onChoosen( List selectedIndex, List selectedS public void onGetChoose(boolean[] states) { super.onGetChoose(states); } - }).show(); + }).setTitleColor(R.color.dialogutil_ios_btntext_blue).show(); break; case R.id.btn_singlechoose: String[] words2 = new String[]{"12","78","45","89","88","00"}; diff --git a/dialog/src/main/java/com/hss01248/dialog/Tool.java b/dialog/src/main/java/com/hss01248/dialog/Tool.java index ec98ae6..1fa638b 100644 --- a/dialog/src/main/java/com/hss01248/dialog/Tool.java +++ b/dialog/src/main/java/com/hss01248/dialog/Tool.java @@ -16,6 +16,7 @@ import android.support.annotation.NonNull; import android.support.design.widget.BottomSheetBehavior; import android.support.design.widget.BottomSheetDialog; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; @@ -39,6 +40,7 @@ import com.hss01248.dialog.material.MdInputHolder; import com.hss01248.dialog.view.DialogUtil_DialogActivity; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; @@ -96,6 +98,11 @@ public static void showDialog(final Dialog dialog, final ConfigBean bean) { dialog.setOnShowListener(new DialogInterface.OnShowListener() { @Override public void onShow(DialogInterface dialog) { + if (bean.alertDialog!= null){ + setMdBtnStytle(bean); + setTitleMessageStyle(bean.alertDialog,bean); + //setListItemsStyle(bean); + } bean.listener.onShow(); //showSoftKeyBoardDelayed(bean.needSoftKeyboard,bean.viewHolder); //showSoftKeyBoardDelayed(bean.needSoftKeyboard,bean.customContentHolder); @@ -107,11 +114,7 @@ public void onShow(DialogInterface dialog) { public void run() { try { dialog.show(); - if (bean.alertDialog!= null){ - setMdBtnStytle(bean); - setTitleMessageStyle(bean.alertDialog,bean); - //setListItemsStyle(bean); - } + adjustWindow(dialog,bean); }catch (Exception e){ e.printStackTrace(); @@ -128,25 +131,37 @@ public void run() { } private static void setTitleMessageStyle(final Dialog dialog,ConfigBean bean) { - TextView tvMessage = ((TextView)dialog.getWindow().getDecorView().findViewById(android.R.id.message)); - TextView tvTitle = ((TextView)dialog.getWindow().getDecorView().findViewById(android.R.id.title)); - if(tvMessage!=null){ + + try { + Field mAlert = AlertDialog.class.getDeclaredField("mAlert"); + mAlert.setAccessible(true); + Object mAlertController = mAlert.get(dialog); + + + Field mMessage = mAlertController.getClass().getDeclaredField("mMessageView"); + mMessage.setAccessible(true); + TextView tvMessage = (TextView) mMessage.get(mAlertController); if(bean.msgTxtColor !=0){ tvMessage.setTextColor(getColor(bean.context,bean.msgTxtColor)); } if(bean.msgTxtSize !=0){ tvMessage.setTextSize(bean.msgTxtSize); } - } - if(tvTitle!=null){ + Field titleView = mAlertController.getClass().getDeclaredField("mTitleView"); + titleView.setAccessible(true); + TextView tvTitle = (TextView) titleView.get(mAlertController); if(bean.titleTxtColor !=0){ tvTitle.setTextColor(getColor(bean.context,bean.titleTxtColor)); } if(bean.titleTxtSize !=0){ tvTitle.setTextSize(bean.titleTxtSize); } + + } catch (Exception e) { + e.printStackTrace(); } + } private static void adjustWindow(final Dialog dialog, final ConfigBean bean) { @@ -157,6 +172,8 @@ public void onGlobalLayout() { setBottomSheetDialogPeekHeight(bean); adjustWH(dialog,bean); + + dialog.getWindow().getDecorView().getViewTreeObserver().removeGlobalOnLayoutListener(this); } }); diff --git a/dialog/src/main/java/com/hss01248/dialog/config/ConfigBean.java b/dialog/src/main/java/com/hss01248/dialog/config/ConfigBean.java index f32420d..7de6fd1 100644 --- a/dialog/src/main/java/com/hss01248/dialog/config/ConfigBean.java +++ b/dialog/src/main/java/com/hss01248/dialog/config/ConfigBean.java @@ -62,14 +62,76 @@ public class ConfigBean extends MyDialogBuilder implements Styleable { public CharSequence hint1; public CharSequence hint2; - public boolean showAsActivity =false; + public boolean showAsActivity = false; public boolean showAsFragment = false; public DialogUtilDialogFragment mDialogFragment; + public boolean hasBehaviour = true; + public boolean needSoftKeyboard; + /** + * 控制input类dialog中第二个框是否用*号 + */ + public boolean isInput2HideAsPassword = true; + public BottomSheetStyle bottomSheetStyle; + public float forceWidthPercent; + public float forceHeightPercent; + public float maxHeightPercent; + public float maxWidthPercent; + public float bottomSheetDialogMaxHeightPercent; + public boolean isTransparentBehind; + public MyDialogListener listener; + public MyItemDialogListener itemListener; + public boolean cancelable = true;//默认可以点击后退键来dismiss对话框 + public boolean outsideTouchable = true;//默认外部半透明处点击消失 + public boolean dismissAfterButtonClick = true; + public Dialog dialog; + public AlertDialog alertDialog; + public boolean dimBehind = true; + public @DrawableRes + int bgRes; + public boolean useTheShadowBg = true; + public int viewHeight; + //各类对话框特有的参数 + public CharSequence[] wordsMd; + public int defaultChosen;// + public boolean[] checkedItems; + public List wordsIos; + //bottom sheet + public CharSequence bottomTxt = DefaultConfig.bottomTxt; + //bottomsheet + public SuperLvAdapter mAdapter; + public List lvDatas; + public int gridColumns = 4; + public BroadcastReceiver homeKeyReceiver; + //三个以下按钮,颜色按此顺序 + public @ColorRes + int btn1Color = DefaultConfig.iosBtnColor; - - public boolean hasBehaviour = true; + /*public ConfigBean setBgRes(int bgRes) { + this.bgRes = bgRes; + useTheShadowBg = false; + return this; + }*/ + public @ColorRes + int btn2Color = DefaultConfig.mdBtnCancelColor; + public @ColorRes + int btn3Color = DefaultConfig.iosBtnColor; + public @ColorRes + int titleTxtColor = DefaultConfig.titleTxtColor; + public @ColorRes + int msgTxtColor = DefaultConfig.msgTxtColor; + public @ColorRes + int lvItemTxtColor = DefaultConfig.lvItemTxtColor; + public Map colorOfPosition;//listview 的item的特殊颜色:ColorRes + public @ColorRes + int inputTxtColor = DefaultConfig.inputTxtColor; + //字体大小 + public int btnTxtSize = DefaultConfig.btnTxtSize;// in sp + public int titleTxtSize = DefaultConfig.titleTxtSize; + public int msgTxtSize = DefaultConfig.msgTxtSize; + public int itemTxtSize = DefaultConfig.itemTxtSize; + public int inputTxtSize = DefaultConfig.inputTxtSize; public ConfigBean setNeedSoftKeyboard(boolean needSoftKeyboard) { this.needSoftKeyboard = needSoftKeyboard; @@ -81,254 +143,157 @@ public ConfigBean setTitle(String title) { return this; } - public boolean needSoftKeyboard; + + //样式 public ConfigBean setInput2HideAsPassword(boolean input2HideAsPassword) { isInput2HideAsPassword = input2HideAsPassword; return this; } - /** - * 控制input类dialog中第二个框是否用*号 - */ - public boolean isInput2HideAsPassword = true; - public BottomSheetStyle bottomSheetStyle; - - public ConfigBean setBottomSheetStyle(BottomSheetStyle bottomSheetStyle){ + public ConfigBean setBottomSheetStyle(BottomSheetStyle bottomSheetStyle) { this.bottomSheetStyle = bottomSheetStyle; return this; } - - public ConfigBean setCustomContentHolder(SuperLvHolder holder){ + public ConfigBean setCustomContentHolder(SuperLvHolder holder) { this.customContentHolder = holder; return this; } - /** * 只用于bottom_gridview和bottom_listview两种 * 控制是否采用 + * * @param hasBehaviour true:BottomSheetDialog false: 采用普通dialog,无Behaviour */ - public ConfigBean setHasBehaviour(boolean hasBehaviour){ + public ConfigBean setHasBehaviour(boolean hasBehaviour) { this.hasBehaviour = hasBehaviour; return this; } - - - - - /** * the dialog show by wrap-content in x-axi in default - * + *

* you can use the forceWidthPercent: - * to stretch it in x-axi - * to determine the left and right margin if the measuredWidth is greater than or the same as the phone window width - * + * to stretch it in x-axi + * to determine the left and right margin if the measuredWidth is greater than or the same as the phone window width + *

* do not support types: - * case DefaultConfig.TYPE_IOS_LOADING: - case DefaultConfig.TYPE_PROGRESS: - case DefaultConfig.TYPE_BOTTOM_SHEET_CUSTOM: - case DefaultConfig.TYPE_BOTTOM_SHEET_GRID: - case DefaultConfig.TYPE_BOTTOM_SHEET_LIST: + * case DefaultConfig.TYPE_IOS_LOADING: + * case DefaultConfig.TYPE_PROGRESS: + * case DefaultConfig.TYPE_BOTTOM_SHEET_CUSTOM: + * case DefaultConfig.TYPE_BOTTOM_SHEET_GRID: + * case DefaultConfig.TYPE_BOTTOM_SHEET_LIST: + * * @param forceWidthPercent * @return */ - public ConfigBean setForceWidthPercent(@FloatRange(from = 0f,to = 1.0f)float forceWidthPercent) { - if(forceWidthPercent >1.0f || forceWidthPercent <=0f){ + public ConfigBean setForceWidthPercent(@FloatRange(from = 0f, to = 1.0f) float forceWidthPercent) { + if (forceWidthPercent > 1.0f || forceWidthPercent <= 0f) { return this; } this.forceWidthPercent = forceWidthPercent; return this; } - /** * the dialog show by wrap-content in y-axi in default - * + *

* you can use the forceWidthPercent: * to determine the top and bottom margin if the measuredHeight is greater than the phone window * to stretch it in y-axi,no recommend,because that is ugly! - * + *

* do not support types: - * case DefaultConfig.TYPE_IOS_LOADING: - case DefaultConfig.TYPE_PROGRESS: - case DefaultConfig.TYPE_BOTTOM_SHEET_CUSTOM: - case DefaultConfig.TYPE_BOTTOM_SHEET_GRID: - case DefaultConfig.TYPE_BOTTOM_SHEET_LIST: + * case DefaultConfig.TYPE_IOS_LOADING: + * case DefaultConfig.TYPE_PROGRESS: + * case DefaultConfig.TYPE_BOTTOM_SHEET_CUSTOM: + * case DefaultConfig.TYPE_BOTTOM_SHEET_GRID: + * case DefaultConfig.TYPE_BOTTOM_SHEET_LIST: + * * @param forceHeightPercent * @return */ - public ConfigBean setForceHeightPercent(@FloatRange(from = 0f,to = 1.0f) float forceHeightPercent) { - if(forceHeightPercent >1.0f || forceHeightPercent <=0f){ + public ConfigBean setForceHeightPercent(@FloatRange(from = 0f, to = 1.0f) float forceHeightPercent) { + if (forceHeightPercent > 1.0f || forceHeightPercent <= 0f) { return this; } this.forceHeightPercent = forceHeightPercent; return this; } - public ConfigBean setMaxHeightPercent(@FloatRange(from = 0f,to = 1.0f) float maxHeightPercent) { - if(maxHeightPercent >1.0f || maxHeightPercent <=0f){ + public ConfigBean setMaxHeightPercent(@FloatRange(from = 0f, to = 1.0f) float maxHeightPercent) { + if (maxHeightPercent > 1.0f || maxHeightPercent <= 0f) { return this; } this.maxHeightPercent = maxHeightPercent; return this; } - public ConfigBean setMaxWidthPercent(@FloatRange(from = 0f,to = 1.0f) float maxWidthPercent) { - if(maxWidthPercent >1.0f || maxWidthPercent <=0f){ + public ConfigBean setMaxWidthPercent(@FloatRange(from = 0f, to = 1.0f) float maxWidthPercent) { + if (maxWidthPercent > 1.0f || maxWidthPercent <= 0f) { return this; } this.maxWidthPercent = maxWidthPercent; return this; } - public float forceWidthPercent; - public float forceHeightPercent; - public float maxHeightPercent; - public float maxWidthPercent; + + /*可能需要拓展的功能,支持当个item字体大小和颜色设置 (比如底部弹出 ,有的item是红色字这种,有的是蓝色) +支持填充自定义布局 +支持gridview 或者recylerview*/ public ConfigBean setTransparentBehind(boolean transparentBehind) { isTransparentBehind = transparentBehind; return this; } - public float bottomSheetDialogMaxHeightPercent; - public ConfigBean setBottomSheetDialogMaxHeightPercent(float bottomSheetDialogMaxHeightPercent) { this.bottomSheetDialogMaxHeightPercent = bottomSheetDialogMaxHeightPercent; return this; } - public boolean isTransparentBehind; - - - - public MyDialogListener listener; - public MyItemDialogListener itemListener; - - public boolean cancelable = true;//默认可以点击后退键来dismiss对话框 - public boolean outsideTouchable = true;//默认外部半透明处点击消失 - - public boolean dismissAfterButtonClick = true; - - public Dialog dialog; - public AlertDialog alertDialog; - - - public boolean dimBehind = true; - public ConfigBean setDismissAfterButtonClicked(boolean dismissAfterButtonClick) { this.dismissAfterButtonClick = dismissAfterButtonClick; return this; } - /*public ConfigBean setBgRes(int bgRes) { - this.bgRes = bgRes; - useTheShadowBg = false; - return this; - }*/ - - public @DrawableRes int bgRes; - public ConfigBean setBackground(int bgRes) { this.bgRes = bgRes; useTheShadowBg = false; return this; } - - /** - * default background res: R.drawable.shadow,white background ,surround with shadow + * default background res: R.drawable.shadow,white background ,surround with shadow + * * @param useTheWhiteAndShadowBg default is true. set false to disable the shadow background ,and set your own background in your xml * @return */ public ConfigBean setHasShadow(boolean useTheWhiteAndShadowBg) { - if(bgRes>0){ + if (bgRes > 0) { return this; } this.useTheShadowBg = useTheWhiteAndShadowBg; return this; } - public boolean useTheShadowBg = true; - - - - - - public int viewHeight; - - - //各类对话框特有的参数 - public CharSequence[] wordsMd; - public int defaultChosen;// - public boolean[] checkedItems; - - - public List wordsIos; - //bottom sheet - public CharSequence bottomTxt = DefaultConfig.bottomTxt; - - //bottomsheet - public SuperLvAdapter mAdapter; - public List lvDatas; - public int gridColumns = 4; - - public BroadcastReceiver homeKeyReceiver; - - - - //样式 - - //三个以下按钮,颜色按此顺序 - public @ColorRes int btn1Color = DefaultConfig.iosBtnColor; - public @ColorRes int btn2Color= DefaultConfig.mdBtnCancelColor; - public @ColorRes int btn3Color= DefaultConfig.iosBtnColor; - - - - public @ColorRes int titleTxtColor = DefaultConfig.titleTxtColor; - public @ColorRes int msgTxtColor = DefaultConfig.msgTxtColor; - - public @ColorRes int lvItemTxtColor = DefaultConfig.lvItemTxtColor; - public Map colorOfPosition;//listview 的item的特殊颜色:ColorRes - - public @ColorRes int inputTxtColor = DefaultConfig.inputTxtColor; - - - /*可能需要拓展的功能,支持当个item字体大小和颜色设置 (比如底部弹出 ,有的item是红色字这种,有的是蓝色) -支持填充自定义布局 -支持gridview 或者recylerview*/ - - //字体大小 - public int btnTxtSize = DefaultConfig.btnTxtSize;// in sp - public int titleTxtSize = DefaultConfig.titleTxtSize; - public int msgTxtSize = DefaultConfig.msgTxtSize; - public int itemTxtSize = DefaultConfig.itemTxtSize; - public int inputTxtSize = DefaultConfig.inputTxtSize; - - @Override public ConfigBean setBtnColor(@ColorRes int btn1Color, @ColorRes int btn2Color, @ColorRes int btn3Color) { - if (btn1Color>0) - this.btn1Color = btn1Color; - if (btn2Color>0) - this.btn2Color = btn2Color; - if (btn3Color>0) + if (btn1Color != 0) + this.btn1Color = btn1Color; + if (btn2Color != 0) + this.btn2Color = btn2Color; + if (btn3Color != 0) this.btn3Color = btn3Color; return this; } @Override public ConfigBean setListItemColor(@ColorRes int lvItemTxtColor, Map colorOfPosition) { - if (lvItemTxtColor>0) + if (lvItemTxtColor != 0) this.lvItemTxtColor = lvItemTxtColor; - if (colorOfPosition != null && colorOfPosition.size()>0){ + if (colorOfPosition != null && colorOfPosition.size() > 0) { this.colorOfPosition = colorOfPosition; } return this; @@ -336,7 +301,7 @@ public ConfigBean setListItemColor(@ColorRes int lvItemTxtColor, Map0){ + if (colorRes != 0) { this.titleTxtColor = colorRes; } return this; @@ -344,20 +309,20 @@ public ConfigBean setTitleColor(@ColorRes int colorRes) { @Override public ConfigBean setMsgColor(@ColorRes int colorRes) { - if (colorRes >0){ + if (colorRes != 0) { this.msgTxtColor = colorRes; } return this; } - public ConfigBean setActivity(Activity activity){ + public ConfigBean setActivity(Activity activity) { this.context = activity; return this; } @Override public ConfigBean seInputColor(@ColorRes int colorRes) { - if (colorRes >0){ + if (colorRes > 0) { this.inputTxtColor = colorRes; } return this; @@ -365,7 +330,7 @@ public ConfigBean seInputColor(@ColorRes int colorRes) { @Override public ConfigBean setTitleSize(int sizeInSp) { - if (sizeInSp >0 && sizeInSp < 30){ + if (sizeInSp > 0 && sizeInSp < 30) { this.titleTxtSize = sizeInSp; } return this; @@ -373,7 +338,7 @@ public ConfigBean setTitleSize(int sizeInSp) { @Override public ConfigBean setMsgSize(int sizeInSp) { - if (sizeInSp >0 && sizeInSp < 30){ + if (sizeInSp > 0 && sizeInSp < 30) { this.msgTxtSize = sizeInSp; } return this; @@ -381,12 +346,13 @@ public ConfigBean setMsgSize(int sizeInSp) { /** * 最大30sp + * * @param sizeInSp * @return */ @Override public ConfigBean setBtnSize(int sizeInSp) { - if (sizeInSp >0 && sizeInSp < 30){ + if (sizeInSp > 0 && sizeInSp < 30) { this.btnTxtSize = sizeInSp; } return this; @@ -394,7 +360,7 @@ public ConfigBean setBtnSize(int sizeInSp) { @Override public ConfigBean setLvItemSize(int sizeInSp) { - if (sizeInSp >0 && sizeInSp < 30){ + if (sizeInSp > 0 && sizeInSp < 30) { this.itemTxtSize = sizeInSp; } return this; @@ -402,15 +368,15 @@ public ConfigBean setLvItemSize(int sizeInSp) { @Override public ConfigBean setInputSize(int sizeInSp) { - if (sizeInSp >0 && sizeInSp < 30){ + if (sizeInSp > 0 && sizeInSp < 30) { this.inputTxtSize = sizeInSp; } return this; } - private void showAsActivityNow(){ + private void showAsActivityNow() { Activity activity = ActivityStackManager.getInstance().getTopActivity(); - if(activity!=null){ + if (activity != null) { Intent intent = new Intent(activity, DialogUtil_DialogActivity.class); activity.startActivity(intent); showViewWhenActivityIsReady(); @@ -423,15 +389,15 @@ private void showViewWhenActivityIsReady() { @Override public void run() { Activity activity1 = ActivityStackManager.getInstance().getTopActivity(DialogUtil_DialogActivity.class); - if(activity1!=null){ + if (activity1 != null) { //buildByType(ConfigBean.this); DialogUtil_DialogActivity activity2 = (DialogUtil_DialogActivity) activity1; activity2.show(ConfigBean.this); - }else { + } else { showViewWhenActivityIsReady(); } } - },100); + }, 100); } @@ -446,6 +412,7 @@ public void showAsActivity() { /** * 开发中,暂时支持不全,请勿用 + * * @return */ @Deprecated @@ -457,8 +424,8 @@ public DialogUtilDialogFragment showAsFragment() { @Override public Dialog show() { Tool.fixContext(this); - if(listener ==null){ - Log.w("dialogutil","dialog listener is null!"); + if (listener == null) { + Log.w("dialogutil", "dialog listener is null!"); listener = new MyDialogListener() { @Override public void onFirst() { @@ -472,12 +439,12 @@ public void onSecond() { }; } buildByType(this); - if(showAsActivity){ + if (showAsActivity) { showAsActivityNow(); return null; } - if(showAsFragment && context instanceof FragmentActivity){ + if (showAsFragment && context instanceof FragmentActivity) { showAsFragment(); return null; } @@ -494,20 +461,20 @@ public void onSecond() { //Build dialog by tyle : //内部保存loadingdialog对象 - if(type ==DefaultConfig.TYPE_PROGRESS){ + if (type == DefaultConfig.TYPE_PROGRESS) { } - if (dialog != null && !dialog.isShowing()){ - Tool.showDialog(dialog,this); - if(type == DefaultConfig.TYPE_IOS_LOADING || type == DefaultConfig.TYPE_MD_LOADING){ + if (dialog != null && !dialog.isShowing()) { + Tool.showDialog(dialog, this); + if (type == DefaultConfig.TYPE_IOS_LOADING || type == DefaultConfig.TYPE_MD_LOADING) { StyledDialog.setLoadingObj(dialog); } return dialog; - }else if (alertDialog != null && !alertDialog.isShowing()){ - Tool.showDialog(alertDialog,this); - if(type == DefaultConfig.TYPE_IOS_LOADING || type == DefaultConfig.TYPE_MD_LOADING){ + } else if (alertDialog != null && !alertDialog.isShowing()) { + Tool.showDialog(alertDialog, this); + if (type == DefaultConfig.TYPE_IOS_LOADING || type == DefaultConfig.TYPE_MD_LOADING) { StyledDialog.setLoadingObj(dialog); } return alertDialog; @@ -517,19 +484,19 @@ public void onSecond() { private DialogUtilDialogFragment showAsFragmentNow() { - if(context instanceof FragmentActivity){ + if (context instanceof FragmentActivity) { FragmentActivity activity = (FragmentActivity) context; DialogUtilDialogFragment fragment = new DialogUtilDialogFragment(); Dialog dialog = this.dialog; - if(dialog ==null){ + if (dialog == null) { dialog = alertDialog; } - if(dialog ==null){ + if (dialog == null) { return null; } fragment.setConfigbean(this); fragment.setRootView(dialog.getWindow().getDecorView()); - fragment.show(activity.getSupportFragmentManager(),this.toString()); + fragment.show(activity.getSupportFragmentManager(), this.toString()); mDialogFragment = fragment; return fragment; } @@ -547,16 +514,17 @@ public ConfigBean setBtnText(CharSequence btn1Text, @Nullable CharSequence btn2T @Override public ConfigBean setBtnText(CharSequence positiveTxt, @Nullable CharSequence negtiveText) { - return setBtnText(positiveTxt,negtiveText,""); + return setBtnText(positiveTxt, negtiveText, ""); } + @Override public ConfigBean setBtnText(CharSequence positiveTxt) { - return setBtnText(positiveTxt,"",""); + return setBtnText(positiveTxt, "", ""); } @Override public ConfigBean setListener(MyDialogListener listener) { - if (listener!= null){ + if (listener != null) { this.listener = listener; } return this;