aboutsummaryrefslogtreecommitdiff
path: root/src/github/daneren2005
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-07-28 19:52:13 -0700
committerScott Jackson <daneren2005@gmail.com>2014-07-28 19:52:13 -0700
commit55afe5ec6152a7863cb09fd621d65c22c2a8a01e (patch)
tree5eba7a08a8b4cafe6593b252471207024ad6cfcf /src/github/daneren2005
parent81570c6ce1aa73de1f8b5fdd190fc755c421f5c5 (diff)
downloaddsub-55afe5ec6152a7863cb09fd621d65c22c2a8a01e.tar.gz
dsub-55afe5ec6152a7863cb09fd621d65c22c2a8a01e.tar.bz2
dsub-55afe5ec6152a7863cb09fd621d65c22c2a8a01e.zip
Some fixes to ImageLoader using crossfade incorrectly
Diffstat (limited to 'src/github/daneren2005')
-rw-r--r--src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java4
-rw-r--r--src/github/daneren2005/dsub/util/ImageLoader.java8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
index 14b83317..e4701703 100644
--- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
+++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java
@@ -1160,14 +1160,14 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter
AlertDialog.Builder imageDialog = new AlertDialog.Builder(context);
ImageView fullScreenView = new ImageView(context);
- imageLoader.loadImage(fullScreenView, albumRep, true, true);
+ imageLoader.loadImage(fullScreenView, albumRep, true, false);
imageDialog.setView(fullScreenView);
imageDialog.setCancelable(true);
imageDialog.create();
imageDialog.show();
}
});
- imageLoader.loadImage(coverArtView, albumRep, false, true);
+ imageLoader.loadImage(coverArtView, albumRep, false, false);
TextView titleView = (TextView) header.findViewById(R.id.select_album_title);
if(playlistName != null) {
diff --git a/src/github/daneren2005/dsub/util/ImageLoader.java b/src/github/daneren2005/dsub/util/ImageLoader.java
index ad016b6a..f62741ec 100644
--- a/src/github/daneren2005/dsub/util/ImageLoader.java
+++ b/src/github/daneren2005/dsub/util/ImageLoader.java
@@ -25,6 +25,8 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.TransitionDrawable;
import android.media.RemoteControlClient;
import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
import android.util.DisplayMetrics;
import android.util.Log;
import android.support.v4.util.LruCache;
@@ -48,6 +50,7 @@ public class ImageLoader {
private Context context;
private LruCache<String, Bitmap> cache;
+ private Handler handler;
private Bitmap nowPlaying;
private final int imageSizeDefault;
private final int imageSizeLarge;
@@ -56,6 +59,7 @@ public class ImageLoader {
public ImageLoader(Context context) {
this.context = context;
+ handler = new Handler(Looper.getMainLooper());
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
final int cacheSize = maxMemory / 4;
cache = new LruCache<String, Bitmap>(cacheSize) {
@@ -136,7 +140,7 @@ public class ImageLoader {
Bitmap bitmap = cache.get(getKey(entry.getCoverArt(), size));
if (bitmap != null && !bitmap.isRecycled()) {
final Drawable drawable = Util.createDrawableFromBitmap(this.context, bitmap);
- setImage(view, drawable, large);
+ setImage(view, drawable, crossfade);
if(large) {
nowPlaying = bitmap;
}
@@ -220,7 +224,7 @@ public class ImageLoader {
transitionDrawable.startTransition(250);
// Get rid of transition drawable after transition occurs
- imageView.getHandler().postDelayed(new Runnable() {
+ handler.postDelayed(new Runnable() {
@Override
public void run() {
// Only execute if still on same transition drawable