feature: QMUIDialogBuilder add method setCancelable

This commit is contained in:
cgspine
2018-02-26 16:01:47 +08:00
parent 78e1055ecb
commit 516a286368
@@ -40,6 +40,7 @@ public abstract class QMUIDialogBuilder<T extends QMUIDialogBuilder> {
protected QMUIDialog mDialog;
protected LayoutInflater mInflater;
protected String mTitle;
private boolean mCancelable = true;
protected LinearLayout mRootView;
protected LinearLayout mDialogWrapper;
@@ -90,6 +91,13 @@ public abstract class QMUIDialogBuilder<T extends QMUIDialogBuilder> {
return setTitle(mContext.getResources().getString(resId));
}
@SuppressWarnings("unchecked")
public T setCancelable(boolean cancelable) {
mCancelable = cancelable;
return (T) this;
}
//region 添加action
/**
@@ -270,7 +278,7 @@ public abstract class QMUIDialogBuilder<T extends QMUIDialogBuilder> {
mDialog.addContentView(mRootView, new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
mDialog.setCancelable(mCancelable);
onAfter(mDialog, mRootView);
return mDialog;
}