diff options
author | Geist5000 <geist5000@gmail.com> | 2021-02-15 16:04:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-15 16:04:03 +0100 |
commit | aaeea78b37377cc09252c89a35fe9ae2e8542c68 (patch) | |
tree | 00cadf825fb10a6e2be84fc1c72d22d8c7aca81e /core | |
parent | 394122dadee4028d12d0e2efc446a2562791ee7b (diff) | |
download | AntennaPod-aaeea78b37377cc09252c89a35fe9ae2e8542c68.zip |
changed the "Use Episode Cover" setting to only apply to list items. (#4908)
Diffstat (limited to 'core')
6 files changed, 17 insertions, 6 deletions
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 @@ <string name="pref_episode_cache_title">Episode Cache</string> <string name="pref_episode_cache_summary">Total number of downloaded episodes cached on the device. Automatic download will be suspended if this number is reached.</string> <string name="pref_episode_cover_title">Use Episode Cover</string> - <string name="pref_episode_cover_summary">Use the episode specific cover whenever available. If unchecked, the app will always use the podcast cover image.</string> + <string name="pref_episode_cover_summary">Use the episode specific cover in lists whenever available. If unchecked, the app will always use the podcast cover image.</string> <string name="pref_show_remain_time_title">Show Remaining Time</string> <string name="pref_show_remain_time_summary">Display remaining time of episodes when checked. If unchecked, display total duration of episodes.</string> <string name="pref_theme_title_use_system">Use system theme</string> |