Skip to content

Commit

Permalink
set canselable
Browse files Browse the repository at this point in the history
  • Loading branch information
Far5had70 committed Nov 18, 2018
1 parent 57dfae4 commit fb594f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ private void singleAction() {
.setButtonTextSize(13)
.setHeaderIconEnable(true)
.setButtonEnable(true)
.setCancelableTouchOutside(false)
.setTypeFace(Typeface.createFromAsset(getAssets(), "bsans.ttf"))
.setSingleButtonListener(new SingleButtonListener() {
@Override
Expand Down
7 changes: 7 additions & 0 deletions falert/src/main/java/com/waspar/falert/Falert.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class Falert extends DialogFragment implements View.OnClickListener {
private boolean autoDismiss = true;
private boolean iconEnable = true;
private boolean buttonEnable = true;
private boolean cancelable = true;
private String positiveText = null;
private String negativeText = null;
private int alertRadius = 40;
Expand Down Expand Up @@ -66,6 +67,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
show();
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
setCancelable(cancelable);
return view;
}

Expand Down Expand Up @@ -362,6 +364,11 @@ public Falert setStrokeSingleButtonColor(int strokeSingleButtonColor) {
return this;
}

public Falert setCancelableTouchOutside(boolean cancelable) {
this.cancelable = cancelable;
return this;
}

public Falert show() {

//View v = View.inflate(this.context, R.layout.layout_falert, (ViewGroup)null);
Expand Down

0 comments on commit fb594f5

Please sign in to comment.