mirror of
https://github.com/Tencent/QMUI_Android.git
synced 2026-10-28 19:16:55 +08:00
feature: QMUIDialogBuilder add method setCancelable
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user