aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2015-03-18 18:15:02 -0700
committerScott Jackson <daneren2005@gmail.com>2015-03-18 18:15:02 -0700
commit7e0f41a05329eb37d2e7c3de9ceb8ac9f4472ff4 (patch)
treea073ba97ea9f228b3ca6fc7526fe98d8e7d8052b /src/github
parentf1e64f3cfb11febd1bb0e36360b834e75f9b4957 (diff)
downloaddsub-7e0f41a05329eb37d2e7c3de9ceb8ac9f4472ff4.tar.gz
dsub-7e0f41a05329eb37d2e7c3de9ceb8ac9f4472ff4.tar.bz2
dsub-7e0f41a05329eb37d2e7c3de9ceb8ac9f4472ff4.zip
Add ability to pass onCancel to confirm
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/util/Util.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 5027e0c0..412289fc 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -645,18 +645,24 @@ public final class Util {
}
public static void confirmDialog(Context context, int action, int subject, DialogInterface.OnClickListener onClick) {
- Util.confirmDialog(context, context.getResources().getString(action).toLowerCase(), context.getResources().getString(subject), onClick);
+ Util.confirmDialog(context, context.getResources().getString(action).toLowerCase(), context.getResources().getString(subject), onClick, null);
+ }
+ public static void confirmDialog(Context context, int action, int subject, DialogInterface.OnClickListener onClick, DialogInterface.OnClickListener onCancel) {
+ Util.confirmDialog(context, context.getResources().getString(action).toLowerCase(), context.getResources().getString(subject), onClick, onCancel);
}
public static void confirmDialog(Context context, int action, String subject, DialogInterface.OnClickListener onClick) {
- Util.confirmDialog(context, context.getResources().getString(action).toLowerCase(), subject, onClick);
+ Util.confirmDialog(context, context.getResources().getString(action).toLowerCase(), subject, onClick, null);
+ }
+ public static void confirmDialog(Context context, int action, String subject, DialogInterface.OnClickListener onClick, DialogInterface.OnClickListener onCancel) {
+ Util.confirmDialog(context, context.getResources().getString(action).toLowerCase(), subject, onClick, onCancel);
}
- public static void confirmDialog(Context context, String action, String subject, DialogInterface.OnClickListener onClick) {
+ public static void confirmDialog(Context context, String action, String subject, DialogInterface.OnClickListener onClick, DialogInterface.OnClickListener onCancel) {
new AlertDialog.Builder(context)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.common_confirm)
.setMessage(context.getResources().getString(R.string.common_confirm_message, action, subject))
.setPositiveButton(R.string.common_ok, onClick)
- .setNegativeButton(R.string.common_cancel, null)
+ .setNegativeButton(R.string.common_cancel, onCancel)
.show();
}