diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2015-08-01 17:53:06 +0200 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2015-08-01 17:53:06 +0200 |
commit | a3ea16b90c7a9183e1fc856e44f9e5970ab4d196 (patch) | |
tree | b6b6ebf5fa1823e9519d63cd4ab2715172c98c65 /core/src/main | |
parent | cf519ca0aa1637c716a780b9a2f855a83fb1d6af (diff) | |
download | AntennaPod-a3ea16b90c7a9183e1fc856e44f9e5970ab4d196.zip |
Made dialog better, not to say awesome
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java | 16 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 6 |
2 files changed, 18 insertions, 4 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java index ffaed084a..fea2bbb2b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java +++ b/core/src/main/java/de/danoeh/antennapod/core/dialog/ConfirmationDialog.java @@ -19,6 +19,9 @@ public abstract class ConfirmationDialog { int titleId; int messageId; + int positiveText; + int negativeText; + public ConfirmationDialog(Context context, int titleId, int messageId) { this.context = context; this.titleId = titleId; @@ -30,13 +33,22 @@ public abstract class ConfirmationDialog { dialog.dismiss(); } + public void setPositiveText(int id) { + this.positiveText = id; + } + + public void setNegativeText(int id) { + this.negativeText = id; + } + + public abstract void onConfirmButtonPressed(DialogInterface dialog); public final AlertDialog createNewDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(titleId); builder.setMessage(messageId); - builder.setPositiveButton(R.string.confirm_label, + builder.setPositiveButton(positiveText != 0 ? positiveText : R.string.confirm_label, new DialogInterface.OnClickListener() { @Override @@ -44,7 +56,7 @@ public abstract class ConfirmationDialog { onConfirmButtonPressed(dialog); } }); - builder.setNegativeButton(R.string.cancel_label, + builder.setNegativeButton(negativeText != 0 ? negativeText : R.string.cancel_label, new DialogInterface.OnClickListener() { @Override diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3a9e30ea6..a692dbc73 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -53,6 +53,8 @@ <!-- Other --> <string name="confirm_label">Confirm</string> <string name="cancel_label">Cancel</string> + <string name="yes">Yes</string> + <string name="no">No</string> <string name="author_label">Author</string> <string name="language_label">Language</string> <string name="url_label">URL</string> @@ -75,8 +77,8 @@ <string name="close_label">Close</string> <string name="retry_label">Retry</string> <string name="auto_download_label">Include in auto downloads</string> - <string name="auto_download_apply_to_items_title">Apply Setting to Episodes</string> - <string name="auto_download_apply_to_items_message">Do you want to apply the podcast\'s new <i>Auto Download</i> setting to all of its episodes?</string> + <string name="auto_download_apply_to_items_title">Apply to Previous Episodes</string> + <string name="auto_download_apply_to_items_message">The new <i>Auto Download</i> setting will automatically be applied to new episodes.\nDo you also want to apply it to previous episodes?</string> <string name="auto_delete_label">Auto Delete Episode\n(override global default)</string> <string name="parallel_downloads_suffix">\u0020parallel downloads</string> <string name="feed_auto_download_global">Global</string> |