OSDN Git Service

Fix multi selection issue
authorBobby Georgescu <georgescu@google.com>
Fri, 19 Apr 2013 18:27:29 +0000 (11:27 -0700)
committerBobby Georgescu <georgescu@google.com>
Fri, 19 Apr 2013 18:27:29 +0000 (11:27 -0700)
Bug: 8663155
Change-Id: Ic6aa98c04b5134df9deb1b14736e614bf1618f03

src/com/android/gallery3d/ui/SelectionManager.java

index 9a2396d..be6811b 100644 (file)
@@ -187,8 +187,10 @@ public class SelectionManager {
                     MediaSet set = mSourceMediaSet.getSubMediaSet(i);
                     Path id = set.getPath();
                     if (!mClickedSet.contains(id)) {
-                        if (expandSet && !expandMediaSet(selected, set, maxSelection)) {
-                            return null;
+                        if (expandSet) {
+                            if (!expandMediaSet(selected, set, maxSelection)) {
+                                return null;
+                            }
                         } else {
                             selected.add(id);
                             if (selected.size() > maxSelection) {
@@ -199,9 +201,11 @@ public class SelectionManager {
                 }
             } else {
                 for (Path id : mClickedSet) {
-                    if (expandSet && !expandMediaSet(selected,
-                            mDataManager.getMediaSet(id), maxSelection)) {
-                        return null;
+                    if (expandSet) {
+                        if (!expandMediaSet(selected, mDataManager.getMediaSet(id),
+                                maxSelection)) {
+                            return null;
+                        }
                     } else {
                         selected.add(id);
                         if (selected.size() > maxSelection) {