Do not crash

This commit is contained in:
ByteHamster 2018-12-23 15:45:30 +01:00
parent 580cc49b1b
commit f23682f538
2 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,7 @@
package de.danoeh.antennapod.adapter;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
@ -39,13 +40,13 @@ class CoverTarget extends CustomViewTarget<ImageView, Drawable> {
ImageView imgvCover = cover.get();
if (fallbackUri != null && txtvPlaceholder != null && imgvCover != null) {
MainActivity activity = mainActivity.get();
Glide.with(activity)
new Handler().post(() -> Glide.with(activity)
.load(fallbackUri)
.apply(new RequestOptions()
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.fitCenter()
.dontAnimate())
.into(new CoverTarget(null, txtvPlaceholder, imgvCover, activity));
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
.fitCenter()
.dontAnimate())
.into(new CoverTarget(null, txtvPlaceholder, imgvCover, activity)));
}
}

View File

@ -50,7 +50,7 @@ project.ext {
eventbusVersion = "2.4.0"
flattr4jVersion = "2.14"
glideVersion = "4.8.0"
glideOkhttpIntegrationVersion = "1.5.0"
glideOkhttpIntegrationVersion = "4.8.0"
iconifyVersion = "2.2.2"
jsoupVersion = "1.11.2"
materialDialogsVersion = "0.9.0.2"