diff options
author | Qi Ling <qling@sta.samsung.com> | 2011-04-21 19:34:19 -0700 |
---|---|---|
committer | madan ankapura <mankapur@sta.samsung.com> | 2011-04-21 19:54:07 -0700 |
commit | 5a084ed36e1b1211b650e7815d8a4dbf9d7d6081 (patch) | |
tree | f09da15531a07dc4b969a9f2b7345b0a67c52356 | |
parent | 586c41f0a6e871dd606830bfbac5e7460bb8d53b (diff) | |
download | Gallery3D-5a084ed36e1b1211b650e7815d8a4dbf9d7d6081.tar.gz |
Fixed the "Select All" issue in Gallery3D
Two issues:
1) "Select All" doesn't select all videos and photos in one album
2) "Select All" deselects some items previously selected
The problem is caused by the same IDs in the image table and video table
in database. The ID generation for each item is fine. But we cannot use
ID as the only criteria for the uniqueness of items. If one image has the
id "100" in the image table and one video has the id "100" in the video
table, and both of them happen to be in the same bucket, then only one
will be selected when we do "Select All".
Change-Id: I6431827779a43dfaaf57338627ae3572f1b7a58b
Signed-off-by: madan ankapura <mankapur@sta.samsung.com>
-rw-r--r-- | src/com/cooliris/media/MediaBucketList.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/cooliris/media/MediaBucketList.java b/src/com/cooliris/media/MediaBucketList.java index a1a30e9..131e19c 100644 --- a/src/com/cooliris/media/MediaBucketList.java +++ b/src/com/cooliris/media/MediaBucketList.java @@ -130,7 +130,8 @@ public final class MediaBucketList { // Search for the bucket for this media set for (int i = 0; i < numSelectedBuckets; ++i) { final MediaBucket bucketCompare = selectedBuckets.get(i); - if (bucketCompare.mediaSet != null && mediaSetToAdd != null && bucketCompare.mediaSet.mId == mediaSetToAdd.mId) { + if (bucketCompare != null && bucketCompare.mediaSet != null + && mediaSetToAdd != null && bucketCompare.mediaSet == mediaSetToAdd) { // We found the MediaSet. if (!hasExpandedMediaSet) { // Remove this bucket from the list since this bucket was @@ -171,7 +172,7 @@ public final class MediaBucketList { boolean foundIndex = false; for (int j = 0; j < numPresentItems; ++j) { final MediaItem selectedItem = selectedItems.get(j); - if (selectedItem != null && item != null && selectedItem.mId == item.mId) { + if (selectedItem != null && item != null && selectedItem == item) { // This index was already present, we need to // remove it. foundIndex = true; |