Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class NotifyDialog extends Dialog {
public enum Type{
INFO, CONFIRM
}
private static boolean showing = false;

/**
* start info dialog with one button
Expand Down Expand Up @@ -49,15 +50,17 @@ public static NotifyDialog startConfirm(Context context, String title, String te
public NotifyDialog(Context context, String title, String text, Type type) {
super(context, R.style.Theme_Dialog);

setCancelable(false);
setCanceledOnTouchOutside(false);
if (!showing) {
setCancelable(false);
setCanceledOnTouchOutside(false);

titleStr = title;
textStr = text;
this.type = type;

show();
titleStr = title;
textStr = text;
this.type = type;

showing = true;
show();
}
}

/**
Expand Down Expand Up @@ -103,6 +106,7 @@ private void setOneButtonOptions() {
buttonOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showing = false;
if(oneButtonListener != null){
oneButtonListener.onOkClicked(NotifyDialog.this);
}else{
Expand All @@ -124,6 +128,7 @@ private void setTwoButtonOptions() {
buttonOk.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showing = false;
if (twoButtonListener != null) {
twoButtonListener.onOkClicked(NotifyDialog.this);
} else {
Expand All @@ -136,6 +141,7 @@ public void onClick(View v) {
buttonCancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showing = false;
if(twoButtonListener != null){
twoButtonListener.onCancelClicked(NotifyDialog.this);
}else{
Expand Down