summaryrefslogtreecommitdiffstats
path: root/src/com/android/photos/shims/BitmapJobDrawable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/photos/shims/BitmapJobDrawable.java')
-rw-r--r--src/com/android/photos/shims/BitmapJobDrawable.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/android/photos/shims/BitmapJobDrawable.java b/src/com/android/photos/shims/BitmapJobDrawable.java
index 299becb07..e13e636bb 100644
--- a/src/com/android/photos/shims/BitmapJobDrawable.java
+++ b/src/com/android/photos/shims/BitmapJobDrawable.java
@@ -15,7 +15,6 @@ import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.FutureListener;
import com.android.gallery3d.util.ThreadPool;
import com.android.photos.data.GalleryBitmapPool;
-import com.android.photos.drawables.AutoThumbnailDrawable;
public class BitmapJobDrawable extends Drawable implements Runnable {
@@ -30,6 +29,8 @@ public class BitmapJobDrawable extends Drawable implements Runnable {
}
public void setMediaItem(MediaItem item) {
+ if (mItem == item) return;
+
if (mLoader != null) {
mLoader.cancelLoad();
}
@@ -38,9 +39,11 @@ public class BitmapJobDrawable extends Drawable implements Runnable {
GalleryBitmapPool.getInstance().put(mBitmap);
mBitmap = null;
}
- // TODO: Figure out why ThumbnailLoader doesn't like to be re-used
- mLoader = new ThumbnailLoader(this);
- mLoader.startLoad();
+ if (mItem != null) {
+ // TODO: Figure out why ThumbnailLoader doesn't like to be re-used
+ mLoader = new ThumbnailLoader(this);
+ mLoader.startLoad();
+ }
invalidateSelf();
}