summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/SnailSource.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2012-05-09 21:17:10 +0800
committerChih-Chung Chang <chihchung@google.com>2012-05-09 21:17:10 +0800
commit82f7ac999aae05b251cfe2c886020780832cd4a3 (patch)
treed025462eb456fc3fb63a1ac0f18d4080fc9923e0 /src/com/android/gallery3d/data/SnailSource.java
parentebf0f78490f851766f643d3d45fa351f4e92e091 (diff)
downloadandroid_packages_apps_Snap-82f7ac999aae05b251cfe2c886020780832cd4a3.tar.gz
android_packages_apps_Snap-82f7ac999aae05b251cfe2c886020780832cd4a3.tar.bz2
android_packages_apps_Snap-82f7ac999aae05b251cfe2c886020780832cd4a3.zip
Handle ScreenNail size change.
Bug: 6355399 Change-Id: Ice7560c12aa06cf8ac58cc3883f0888b5c6e71a5
Diffstat (limited to 'src/com/android/gallery3d/data/SnailSource.java')
-rw-r--r--src/com/android/gallery3d/data/SnailSource.java26
1 files changed, 6 insertions, 20 deletions
diff --git a/src/com/android/gallery3d/data/SnailSource.java b/src/com/android/gallery3d/data/SnailSource.java
index e74a8bb94..5f663d2ec 100644
--- a/src/com/android/gallery3d/data/SnailSource.java
+++ b/src/com/android/gallery3d/data/SnailSource.java
@@ -15,9 +15,7 @@
*/
package com.android.gallery3d.data;
-import android.util.SparseArray;
import com.android.gallery3d.app.GalleryApp;
-import com.android.gallery3d.ui.ScreenNail;
public class SnailSource extends MediaSource {
private static final String TAG = "SnailSource";
@@ -27,7 +25,6 @@ public class SnailSource extends MediaSource {
private GalleryApp mApplication;
private PathMatcher mMatcher;
private static int sNextId;
- private static SparseArray<ScreenNail> sRegistry = new SparseArray<ScreenNail>();
public SnailSource(GalleryApp application) {
super("snail");
@@ -49,19 +46,17 @@ public class SnailSource extends MediaSource {
return new SnailAlbum(path, item);
case SNAIL_ITEM: {
int id = mMatcher.getIntVar(0);
- return new SnailItem(path, lookupScreenNail(id));
+ return new SnailItem(path);
}
}
return null;
}
- // Registers a ScreenNail and returns the id of it. You can obtain the Path
- // of the MediaItem associated with the ScreenNail by getItemPath(), and the
- // Path of the MediaSet containing that MediaItem by getSetPath().
- public static synchronized int registerScreenNail(ScreenNail s) {
- int id = sNextId++;
- sRegistry.put(id, s);
- return id;
+ // Registers a new SnailAlbum containing a SnailItem and returns the id of
+ // them. You can obtain the Path of the SnailAlbum and SnailItem associated
+ // with the id by getSetPath and getItemPath().
+ public static synchronized int newId() {
+ return sNextId++;
}
public static Path getSetPath(int id) {
@@ -71,13 +66,4 @@ public class SnailSource extends MediaSource {
public static Path getItemPath(int id) {
return Path.fromString("/snail/item").getChild(id);
}
-
- public static synchronized void unregisterScreenNail(ScreenNail s) {
- int index = sRegistry.indexOfValue(s);
- sRegistry.removeAt(index);
- }
-
- private static synchronized ScreenNail lookupScreenNail(int id) {
- return sRegistry.get(id);
- }
}