Clarify "Clear History" UX.
Fixes: 33071825
-Change "Clear history" menu option to "Clear"
-Add verification dialog before user clears history/memory.
Change-Id: I10db6c4f914fc3af0a525f1c22e719b6407dba9b
diff --git a/src/com/android/calculator2/AlertDialogFragment.java b/src/com/android/calculator2/AlertDialogFragment.java
index 12840ae..fdb7427 100644
--- a/src/com/android/calculator2/AlertDialogFragment.java
+++ b/src/com/android/calculator2/AlertDialogFragment.java
@@ -62,10 +62,11 @@
* implement AlertDialogFragment.OnClickListener to respond.
*/
public static void showMessageDialog(Activity activity, @StringRes int title,
- @StringRes int message, @StringRes int positiveButtonLabel) {
+ @StringRes int message, @StringRes int positiveButtonLabel, @Nullable String tag) {
showMessageDialog(activity, title != 0 ? activity.getString(title) : null,
activity.getString(message),
- positiveButtonLabel != 0 ? activity.getString(positiveButtonLabel) : null);
+ positiveButtonLabel != 0 ? activity.getString(positiveButtonLabel) : null,
+ tag);
}
/**
@@ -78,7 +79,8 @@
* implement AlertDialogFragment.OnClickListener to respond.
*/
public static void showMessageDialog(Activity activity, @Nullable CharSequence title,
- CharSequence message, @Nullable CharSequence positiveButtonLabel) {
+ CharSequence message, @Nullable CharSequence positiveButtonLabel, @Nullable String tag)
+ {
final FragmentManager manager = activity.getFragmentManager();
if (manager == null || manager.isDestroyed()) {
return;
@@ -92,7 +94,7 @@
}
args.putCharSequence(KEY_TITLE, title);
dialogFragment.setArguments(args);
- dialogFragment.show(manager, null /* tag */);
+ dialogFragment.show(manager, tag /* tag */);
}
public AlertDialogFragment() {