summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2012-05-15 18:22:13 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-15 18:22:13 -0700
commitbbc3c68f7d56a1d51169436d7b7fb15ebf73c1ac (patch)
treef185806c1933e12ef991e08a00ce251d11d19684 /src/com/android
parentc88fabf51e67d1ff83f4b6439cb135b6b877898a (diff)
parent9ad7d738bd36217c85222865cf0bd539dd31a716 (diff)
downloadandroid_packages_apps_Snap-bbc3c68f7d56a1d51169436d7b7fb15ebf73c1ac.tar.gz
android_packages_apps_Snap-bbc3c68f7d56a1d51169436d7b7fb15ebf73c1ac.tar.bz2
android_packages_apps_Snap-bbc3c68f7d56a1d51169436d7b7fb15ebf73c1ac.zip
Merge "Fix 6046544: Deleting a photo takes multiple steps and the flow is inconsistent with other deleting flows on other core apps" into jb-dev
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java9
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java7
-rw-r--r--src/com/android/gallery3d/ui/MenuExecutor.java8
3 files changed, 13 insertions, 11 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 3f9f05728..52f7c4176 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -525,7 +525,7 @@ public class PhotoPage extends ActivityState implements
DataManager manager = mActivity.getDataManager();
int action = item.getItemId();
- boolean needsConfirm = false;
+ String confirmMsg = null;
switch (action) {
case android.R.id.home: {
onUpPressed();
@@ -568,19 +568,20 @@ public class PhotoPage extends ActivityState implements
return true;
}
case R.id.action_delete:
- needsConfirm = true;
+ confirmMsg = mActivity.getResources().getQuantityString(
+ R.plurals.delete_selection, 1);
case R.id.action_setas:
case R.id.action_rotate_ccw:
case R.id.action_rotate_cw:
case R.id.action_show_on_map:
mSelectionManager.deSelectAll();
mSelectionManager.toggle(path);
- mMenuExecutor.onMenuClicked(item, needsConfirm, null);
+ mMenuExecutor.onMenuClicked(item, confirmMsg, null);
return true;
case R.id.action_import:
mSelectionManager.deSelectAll();
mSelectionManager.toggle(path);
- mMenuExecutor.onMenuClicked(item, needsConfirm,
+ mMenuExecutor.onMenuClicked(item, confirmMsg,
new ImportCompleteListener(mActivity));
return true;
default :
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index d8e60d3a2..c5773ed3e 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -125,14 +125,15 @@ public class ActionModeHandler implements ActionMode.Callback {
}
}
ProgressListener listener = null;
- boolean needsConfirm = false;
+ String confirmMsg = null;
int action = item.getItemId();
if (action == R.id.action_import) {
listener = new ImportCompleteListener(mActivity);
} else if (item.getItemId() == R.id.action_delete) {
- needsConfirm = true;
+ confirmMsg = mActivity.getResources().getQuantityString(
+ R.plurals.delete_selection, mSelectionManager.getSelectedCount());
}
- mMenuExecutor.onMenuClicked(item, needsConfirm, listener);
+ mMenuExecutor.onMenuClicked(item, confirmMsg, listener);
if (action == R.id.action_select_all) {
updateSupportedOperation();
updateSelectionMenu();
diff --git a/src/com/android/gallery3d/ui/MenuExecutor.java b/src/com/android/gallery3d/ui/MenuExecutor.java
index 636da3985..14bdc4d53 100644
--- a/src/com/android/gallery3d/ui/MenuExecutor.java
+++ b/src/com/android/gallery3d/ui/MenuExecutor.java
@@ -232,14 +232,14 @@ public class MenuExecutor {
startAction(action, title, listener);
}
- public void onMenuClicked(MenuItem menuItem, boolean needsConfirm,
+ public void onMenuClicked(MenuItem menuItem, String confirmMsg,
final ProgressListener listener) {
final int action = menuItem.getItemId();
- if (needsConfirm) {
+ if (confirmMsg != null) {
new AlertDialog.Builder(mActivity.getAndroidContext())
- .setMessage(R.string.confirm_action)
- .setPositiveButton(R.string.confirm, new OnClickListener() {
+ .setMessage(confirmMsg)
+ .setPositiveButton(R.string.ok, new OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
onMenuClicked(action, listener);
}