summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/ui
diff options
context:
space:
mode:
authoryongga <yongga@codeaurora.org>2016-01-09 17:00:05 +0800
committeryongga <yongga@codeaurora.org>2016-01-09 17:00:05 +0800
commitf7c098409ec9b30b01a51fd4a1b33756a6d92898 (patch)
tree6698834336a1f6bb87345666c05c01a63fc29431 /src/com/android/gallery3d/ui
parentb6f034108ac17a4e5456df9620c0b520b99be7ec (diff)
downloadandroid_packages_apps_Gallery2-f7c098409ec9b30b01a51fd4a1b33756a6d92898.tar.gz
android_packages_apps_Gallery2-f7c098409ec9b30b01a51fd4a1b33756a6d92898.tar.bz2
android_packages_apps_Gallery2-f7c098409ec9b30b01a51fd4a1b33756a6d92898.zip
Gallery2: fix display abnormal when select all photos.
The "More" button is still shown when select all, select "Edit/Set picture as" will cause crash because this function just can be used for 1 photo. hide the "More" button when select all. Change-Id: I3b378052c919844f4df007892effb303c5876072 CRs-Fixed: 954079
Diffstat (limited to 'src/com/android/gallery3d/ui')
-rw-r--r--src/com/android/gallery3d/ui/ActionModeHandler.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/ui/ActionModeHandler.java b/src/com/android/gallery3d/ui/ActionModeHandler.java
index 3ff8ed232..e4f4e9d0d 100644
--- a/src/com/android/gallery3d/ui/ActionModeHandler.java
+++ b/src/com/android/gallery3d/ui/ActionModeHandler.java
@@ -284,10 +284,22 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
if (jc.isCancelled() || !mSelectionManager.inSelectionMode()) {
return null;
}
- selected.add(manager.getMediaObject(path));
+ MediaObject mediaObject = manager.getMediaObject(path);
+ if (checkMediaTypeSelectable(mediaObject.getMediaType())) {
+ selected.add(mediaObject);
+ }
}
return selected;
}
+
+ /** Some Media Item is not selectable such as Title item in TimeLine. */
+ private boolean checkMediaTypeSelectable(int type) {
+ if (type == MediaObject.MEDIA_TYPE_TIMELINE_TITLE) {
+ return false;
+ }
+ return true;
+ }
+
// Menu options are determined by selection set itself.
// We cannot expand it because MenuExecuter executes it based on
// the selection set instead of the expanded result.