fix widget image glider
This commit is contained in:
parent
f2af5192e6
commit
210afaeb3c
|
@ -17,6 +17,7 @@ import android.view.View;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
|
|
||||||
import de.danoeh.antennapod.core.R;
|
import de.danoeh.antennapod.core.R;
|
||||||
import de.danoeh.antennapod.core.glide.ApGlideSettings;
|
import de.danoeh.antennapod.core.glide.ApGlideSettings;
|
||||||
|
@ -101,14 +102,12 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Bitmap icon = null;
|
Bitmap icon = null;
|
||||||
int iconSize = getResources().getDimensionPixelSize(
|
int iconSize = getResources().getDimensionPixelSize(android.R.dimen.app_icon_size);
|
||||||
android.R.dimen.app_icon_size);
|
|
||||||
icon = Glide.with(PlayerWidgetJobService.this)
|
icon = Glide.with(PlayerWidgetJobService.this)
|
||||||
.load(media.getImageLocation())
|
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY)
|
.load(media.getImageLocation())
|
||||||
.centerCrop()
|
.apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY))
|
||||||
.into(iconSize, iconSize)
|
.submit(iconSize, iconSize)
|
||||||
.get();
|
.get();
|
||||||
views.setImageViewBitmap(R.id.imgvCover, icon);
|
views.setImageViewBitmap(R.id.imgvCover, icon);
|
||||||
} catch (Throwable tr) {
|
} catch (Throwable tr) {
|
||||||
|
|
Loading…
Reference in New Issue