diff --git a/Android/SpikaChatModule/app/src/main/java/com/clover_studio/spikachatmodule/dialogs/NotifyDialog.java b/Android/SpikaChatModule/app/src/main/java/com/clover_studio/spikachatmodule/dialogs/NotifyDialog.java index 1d4e458..8c4ece8 100644 --- a/Android/SpikaChatModule/app/src/main/java/com/clover_studio/spikachatmodule/dialogs/NotifyDialog.java +++ b/Android/SpikaChatModule/app/src/main/java/com/clover_studio/spikachatmodule/dialogs/NotifyDialog.java @@ -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 @@ -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(); + } } /** @@ -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{ @@ -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 { @@ -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{