diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-10-20 19:45:26 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-10-20 19:45:26 +0200 |
commit | 59e861ee6904296cbe8dd43c4a29513c2e928981 (patch) | |
tree | a3bf768814ece1c377caefca35bc535c758a47c5 /src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java | |
parent | 2860088f0ea1cd5753756861c71cc7c118094f32 (diff) | |
parent | 9ec29bb1dcf664fea606105b7e700641a4b44ae4 (diff) |
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java index c29832a5..3305e8e1 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/dialogs/UserDecisionDialog.java @@ -15,13 +15,11 @@ import eu.siacs.conversations.R; * The user also has the choice to save his answer for the future. * A UserDecisionListener is used to provide the functionality to be performed by clicking on yes, or no. */ -public class UserDecisionDialog extends AbstractAlertDialog { - protected final UserDecisionListener listener; +public class UserDecisionDialog extends SimpleConfirmDialog { protected final CheckBox rememberCheckBox; public UserDecisionDialog(Activity context, int questionResourceId, UserDecisionListener userDecisionListener) { - super(context, questionResourceId); - this.listener = userDecisionListener; + super(context, questionResourceId, userDecisionListener); int viewId = R.layout.dialog_userdecision; View view = context.getLayoutInflater().inflate(viewId, null); @@ -36,10 +34,10 @@ public class UserDecisionDialog extends AbstractAlertDialog { public void decide(UserDecision baseDecision) { switch (baseDecision) { case ALWAYS: - this.listener.onYes(); + this.callback.onYes(); break; case NEVER: - this.listener.onNo(); + this.callback.onNo(); break; case ASK: this.show(); @@ -51,9 +49,9 @@ public class UserDecisionDialog extends AbstractAlertDialog { @Override public void onClick(DialogInterface dialog, int which) { - listener.onYes(); + callback.onYes(); if (rememberCheckBox.isChecked()) { - listener.onRemember(UserDecision.ALWAYS); + ((UserDecisionListener)callback).onRemember(UserDecision.ALWAYS); } } } @@ -62,9 +60,9 @@ public class UserDecisionDialog extends AbstractAlertDialog { @Override public void onClick(DialogInterface dialog, int which) { - listener.onNo(); + callback.onNo(); if (rememberCheckBox.isChecked()) { - listener.onRemember(UserDecision.NEVER); + ((UserDecisionListener)callback).onRemember(UserDecision.NEVER); } } } |