diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 60fcac03d..0132305a3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -164,7 +164,7 @@ public class CoverFragment extends Fragment { new RoundedCorners((int) (16 * getResources().getDisplayMetrics().density))); RequestBuilder cover = Glide.with(this) - .load(ImageResourceUtils.getImageLocation(media)) + .load(ImageResourceUtils.getEpisodeImageLocation(media)) .error(Glide.with(this) .load(ImageResourceUtils.getFallbackImageLocation(media)) .apply(options)) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index f2fe23135..3ca35a37f 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -206,7 +206,7 @@ public class ExternalPlayerFragment extends Fragment { .dontAnimate(); Glide.with(getActivity()) - .load(ImageResourceUtils.getImageLocation(media)) + .load(ImageResourceUtils.getEpisodeListImageLocation(media)) .error(Glide.with(getActivity()) .load(ImageResourceUtils.getFallbackImageLocation(media)) .apply(options)) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 2fc3d4f0e..fd9da89e4 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -299,7 +299,7 @@ public class ItemFragment extends Fragment { .dontAnimate(); Glide.with(getActivity()) - .load(ImageResourceUtils.getImageLocation(item)) + .load(ImageResourceUtils.getEpisodeImageLocation(item)) .error(Glide.with(getActivity()) .load(ImageResourceUtils.getFallbackImageLocation(item)) .apply(options)) diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java index 0e84afe04..0510de968 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java @@ -121,7 +121,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder { if (coverHolder.getVisibility() == View.VISIBLE) { new CoverLoader(activity) - .withUri(ImageResourceUtils.getImageLocation(item)) + .withUri(ImageResourceUtils.getEpisodeListImageLocation(item)) .withFallbackUri(item.getFeed().getImageLocation()) .withPlaceholderView(placeholder) .withCoverView(cover) diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/util/ImageResourceUtils.java b/core/src/main/java/de/danoeh/antennapod/core/feed/util/ImageResourceUtils.java index 22ab03c6d..9d478b676 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/util/ImageResourceUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/util/ImageResourceUtils.java @@ -13,7 +13,18 @@ public final class ImageResourceUtils { private ImageResourceUtils() { } - public static String getImageLocation(ImageResource resource) { + /** + * returns the image location, does prefer the episode cover if available. + */ + public static String getEpisodeImageLocation(ImageResource resource) { + return resource.getImageLocation(); + } + + + /** + * returns the image location, does prefer the episode cover if available and enabled in settings. + */ + public static String getEpisodeListImageLocation(ImageResource resource) { if (UserPreferences.getUseEpisodeCoverSetting()) { return resource.getImageLocation(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/NewEpisodesNotification.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/NewEpisodesNotification.java index d094b1f24..a172c40cb 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/NewEpisodesNotification.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/NewEpisodesNotification.java @@ -113,7 +113,7 @@ public class NewEpisodesNotification { try { return Glide.with(context) .asBitmap() - .load(ImageResourceUtils.getImageLocation(feed)) + .load(ImageResourceUtils.getEpisodeListImageLocation(feed)) .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) .apply(new RequestOptions().centerCrop()) .submit(iconSize, iconSize) diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index d5c85f5f4..0c4e391a0 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -1306,7 +1306,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, p.getEpisodeTitle()); builder.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_SUBTITLE, p.getFeedTitle()); - String imageLocation = ImageResourceUtils.getImageLocation(p); + String imageLocation = ImageResourceUtils.getEpisodeImageLocation(p); if (!TextUtils.isEmpty(imageLocation)) { if (UserPreferences.setLockscreenBackground()) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java index b4c38d1c3..b4b91178b 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackServiceNotificationBuilder.java @@ -75,7 +75,7 @@ public class PlaybackServiceNotificationBuilder { try { icon = Glide.with(context) .asBitmap() - .load(ImageResourceUtils.getImageLocation(playable)) + .load(ImageResourceUtils.getEpisodeImageLocation(playable)) .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) .apply(new RequestOptions().centerCrop()) .submit(iconSize, iconSize) 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 d97271d1a..8521d5980 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 @@ -90,7 +90,7 @@ public abstract class WidgetUpdater { try { icon = Glide.with(context) .asBitmap() - .load(ImageResourceUtils.getImageLocation(widgetState.media)) + .load(ImageResourceUtils.getEpisodeImageLocation(widgetState.media)) .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) .submit(iconSize, iconSize) .get(500, TimeUnit.MILLISECONDS); diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index fc080d71f..f028ea198 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -457,7 +457,7 @@ Episode Cache Total number of downloaded episodes cached on the device. Automatic download will be suspended if this number is reached. Use Episode Cover - Use the episode specific cover whenever available. If unchecked, the app will always use the podcast cover image. + Use the episode specific cover in lists whenever available. If unchecked, the app will always use the podcast cover image. Show Remaining Time Display remaining time of episodes when checked. If unchecked, display total duration of episodes. Use system theme