Skip to content

Commit

Permalink
cancelable of QMUITipDialog #132
Browse files Browse the repository at this point in the history
  • Loading branch information
cgspine committed Dec 26, 2017
1 parent a5a7976 commit a90a446
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public QMUITipDialog(Context context) {
public QMUITipDialog(Context context, int themeResId) {
super(context, themeResId);
setCanceledOnTouchOutside(false);
setCancelable(false);
}

@Override
Expand Down Expand Up @@ -126,13 +125,19 @@ public Builder setTipWord(CharSequence tipWord) {
return this;
}

public QMUITipDialog create(){
return create(true);
}

/**
* 创建 Dialog, 但没有弹出来, 如果要弹出来, 请调用返回值的 {@link Dialog#show()} 方法
*
* @param cancelable 按系统返回键是否可以取消
* @return 创建的 Dialog
*/
public QMUITipDialog create() {
public QMUITipDialog create(boolean cancelable) {
QMUITipDialog dialog = new QMUITipDialog(mContext);
dialog.setCancelable(cancelable);
dialog.setContentView(R.layout.qmui_tip_dialog_layout);
ViewGroup contentWrap = (ViewGroup) dialog.findViewById(R.id.contentWrap);

Expand Down

0 comments on commit a90a446

Please sign in to comment.