summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/AlbumDataLoader.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2012-07-20 12:23:09 -0700
committerMichael Kolb <kolby@google.com>2012-07-26 16:24:07 -0700
commit995c4566bed7df1aa48ba7e1351f964efa73880b (patch)
tree2d3bb1d50855573d3a6c3e74bf5ec7b4605226e3 /src/com/android/gallery3d/app/AlbumDataLoader.java
parent0348d8c50c98fe5befb661032f13615b1673bba3 (diff)
downloadandroid_packages_apps_Gallery2-995c4566bed7df1aa48ba7e1351f964efa73880b.tar.gz
android_packages_apps_Gallery2-995c4566bed7df1aa48ba7e1351f964efa73880b.tar.bz2
android_packages_apps_Gallery2-995c4566bed7df1aa48ba7e1351f964efa73880b.zip
Use actual selection for album/photo details
Bug: 6533154 Change-Id: I21ce95d79567396840f08095b986ecc54263a295
Diffstat (limited to 'src/com/android/gallery3d/app/AlbumDataLoader.java')
-rw-r--r--src/com/android/gallery3d/app/AlbumDataLoader.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/AlbumDataLoader.java b/src/com/android/gallery3d/app/AlbumDataLoader.java
index a99cf93fd..71a575658 100644
--- a/src/com/android/gallery3d/app/AlbumDataLoader.java
+++ b/src/com/android/gallery3d/app/AlbumDataLoader.java
@@ -26,7 +26,7 @@ import com.android.gallery3d.data.DataManager;
import com.android.gallery3d.data.MediaItem;
import com.android.gallery3d.data.MediaObject;
import com.android.gallery3d.data.MediaSet;
-import com.android.gallery3d.ui.AlbumSlotRenderer;
+import com.android.gallery3d.data.Path;
import com.android.gallery3d.ui.SynchronizedHandler;
import java.util.ArrayList;
@@ -133,6 +133,18 @@ public class AlbumDataLoader {
return mSize;
}
+ // Returns the index of the MediaItem with the given path or
+ // -1 if the path is not cached
+ public int findItem(Path id) {
+ for (int i = mContentStart; i < mContentEnd; i++) {
+ MediaItem item = mData[i % DATA_CACHE_SIZE];
+ if (item != null && id == item.getPath()) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
private void clearSlot(int slotIndex) {
mData[slotIndex] = null;
mItemVersion[slotIndex] = MediaObject.INVALID_DATA_VERSION;