Trigger AfterTextInput on cancel iff TextInputCancelled is not defined
@@ -383,10 +383,11 @@ public final class Notifier extends AndroidNonvisibleComponent implements Compon
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
HideKeyboard((View) input);
- TextInputCanceled();
+ if (!TextInputCanceled()) {
//User pressed CANCEL. Raise AfterTextInput with CANCEL
AfterTextInput(cancelButtonText);
}
+ }
});
}
alertDialog.show();
@@ -414,14 +415,15 @@ public final class Notifier extends AndroidNonvisibleComponent implements Compon
/**
* Event raised when the user cancels
- * {@link #ShowChooseDialog(String, String, String, String, boolean)},
* {@link #ShowPasswordDialog(String, String, boolean)}, or
* {@link #ShowTextDialog(String, String, boolean)}.
+ *
+ * @return true if the event was successfully dispatched, otherwise false.
*/
@SimpleEvent(
description = "Event raised when the user canceled ShowTextDialog.")
- public void TextInputCanceled() {
- EventDispatcher.dispatchEvent(this, "TextInputCanceled");
+ public boolean TextInputCanceled() {
+ return EventDispatcher.dispatchEvent(this, "TextInputCanceled");
}
