diff options
author | Fenny Fatal <Fenny@Fennyfatal.com> | 2013-07-22 16:00:36 -0600 |
---|---|---|
committer | Fenny Fatal <Fenny@Fennyfatal.com> | 2013-07-22 16:00:36 -0600 |
commit | 5a668ae60367ceccd452d37699842c1e3386f1be (patch) | |
tree | 8d40fb0a737ff1a4df6aae24bddde1a93726f8e8 /subsonic-android/src/github | |
parent | adbfbc61b33e9e1b505f7a05b844af1c1d078b20 (diff) | |
download | dsub-5a668ae60367ceccd452d37699842c1e3386f1be.tar.gz dsub-5a668ae60367ceccd452d37699842c1e3386f1be.tar.bz2 dsub-5a668ae60367ceccd452d37699842c1e3386f1be.zip |
Additional case where the album art is unknown.
It must be reloaded from resources as well, because it's getting recycled by the new more invasive Android GC.
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java index 1fb5f083..331bc629 100644 --- a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java +++ b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java @@ -101,7 +101,10 @@ public class ImageLoader implements Runnable { } public void loadImage(View view, MusicDirectory.Entry entry, boolean large, boolean crossfade) { - if (entry == null || entry.getCoverArt() == null) { + if (largeUnknownImage != null && ((BitmapDrawable)largeUnknownImage).getBitmap().isRecycled()) + createLargeUnknownImage(view.getContext()); + + if (entry == null || entry.getCoverArt() == null) { setUnknownImage(view, large); return; } @@ -116,15 +119,18 @@ public class ImageLoader implements Runnable { } return; } - - if (!large) { + + if (!large) { setUnknownImage(view, large); } queue.offer(new Task(view.getContext(), entry, size, imageSizeLarge, large, new ViewTaskHandler(view, crossfade))); } public void loadImage(Context context, RemoteControlClient remoteControl, MusicDirectory.Entry entry) { - if (entry == null || entry.getCoverArt() == null) { + if (largeUnknownImage != null && ((BitmapDrawable)largeUnknownImage).getBitmap().isRecycled()) + createLargeUnknownImage(context); + + if (entry == null || entry.getCoverArt() == null) { setUnknownImage(remoteControl); return; } |