summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorRay Chen <raychen@google.com>2011-09-19 12:35:51 +0800
committerRay Chen <raychen@google.com>2011-09-19 12:35:51 +0800
commitafa492c195838a0884f59ab2b86d7f5207181d82 (patch)
treec968bf8f5886657d42b96ca6ae38076333939814 /src/com
parentf95aed139ef3292948f1ade97cc48312a62fc30d (diff)
downloadandroid_packages_apps_Snap-afa492c195838a0884f59ab2b86d7f5207181d82.tar.gz
android_packages_apps_Snap-afa492c195838a0884f59ab2b86d7f5207181d82.tar.bz2
android_packages_apps_Snap-afa492c195838a0884f59ab2b86d7f5207181d82.zip
Fix 5331012 [UI] No dropdown label when entering multi-select modes via menu > Select item(s) / group(s) / album(s)
Change-Id: Ie46432dd136447942011f3565ab7a6406c461887
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java4
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java11
2 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index 7d7054897..1feb96ed8 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -521,10 +521,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
break;
}
case SelectionManager.SELECT_ALL_MODE: {
- int count = mSelectionManager.getSelectedCount();
- String format = mActivity.getResources().getQuantityString(
- R.plurals.number_of_items_selected, count);
- mActionModeHandler.setTitle(String.format(format, count));
mActionModeHandler.updateSupportedOperation();
mRootPane.invalidate();
break;
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 87dd3bec2..b8d049b22 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -86,7 +86,7 @@ public class ActionModeHandler implements ActionMode.Callback {
mSelectionMenu = customMenu.addDropDownMenu(
(Button) customView.findViewById(R.id.selection_menu),
R.menu.selection);
- updateSelectAllTitle();
+ updateSelectionMenu();
customMenu.setOnMenuItemClickListener(new OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
return onActionItemClicked(actionMode, item);
@@ -119,12 +119,17 @@ public class ActionModeHandler implements ActionMode.Callback {
result = mMenuExecutor.onMenuClicked(item, listener);
if (item.getItemId() == R.id.action_select_all) {
updateSupportedOperation();
- updateSelectAllTitle();
+ updateSelectionMenu();
}
return result;
}
- private void updateSelectAllTitle() {
+ private void updateSelectionMenu() {
+ // update title
+ int count = mSelectionManager.getSelectedCount();
+ String format = mActivity.getResources().getQuantityString(
+ R.plurals.number_of_items_selected, count);
+ setTitle(String.format(format, count));
// For clients who call SelectionManager.selectAll() directly, we need to ensure the
// menu status is consistent with selection manager.
MenuItem item = mSelectionMenu.findItem(R.id.action_select_all);