diff --git a/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java b/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java index b27325cf8..3d4cdbcf2 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java +++ b/core/src/main/java/de/danoeh/antennapod/core/widget/WidgetUpdater.java @@ -13,6 +13,9 @@ import android.view.View; import android.widget.RemoteViews; import com.bumptech.glide.Glide; +import com.bumptech.glide.load.resource.bitmap.FitCenter; +import com.bumptech.glide.load.resource.bitmap.RoundedCorners; +import com.bumptech.glide.request.RequestOptions; import java.util.concurrent.TimeUnit; @@ -83,10 +86,16 @@ public abstract class WidgetUpdater { views.setOnClickPendingIntent(R.id.imgvCover, startMediaPlayer); views.setOnClickPendingIntent(R.id.butPlaybackSpeed, startPlaybackSpeedDialog); + int radius = context.getResources().getDimensionPixelSize(R.dimen.widget_inner_radius); + RequestOptions options = new RequestOptions() + .dontAnimate() + .transform(new FitCenter(), new RoundedCorners(radius)); + try { icon = Glide.with(context) .asBitmap() .load(widgetState.media.getImageLocation()) + .apply(options) .submit(iconSize, iconSize) .get(500, TimeUnit.MILLISECONDS); views.setImageViewBitmap(R.id.imgvCover, icon); @@ -95,6 +104,7 @@ public abstract class WidgetUpdater { icon = Glide.with(context) .asBitmap() .load(ImageResourceUtils.getFallbackImageLocation(widgetState.media)) + .apply(options) .submit(iconSize, iconSize) .get(500, TimeUnit.MILLISECONDS); views.setImageViewBitmap(R.id.imgvCover, icon); diff --git a/core/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml index dc8047acb..cddff1c47 100644 --- a/core/src/main/res/values/dimens.xml +++ b/core/src/main/res/values/dimens.xml @@ -1,6 +1,7 @@ 0dp + 4dp 64dp 12sp 14sp