diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2022-06-09 22:55:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-09 22:55:39 +0200 |
commit | 992ca915a00f3aa47cca23d58462bb2b50668e3f (patch) | |
tree | dea4c03bbee23426939774bbbddaaba24db15827 /core/src | |
parent | df53c5bfe57e95211fd6e3f90b4c2480cf5f7bf9 (diff) | |
parent | bf84ba8e26e9e57d328123de1268d672df38a5f1 (diff) | |
download | AntennaPod-992ca915a00f3aa47cca23d58462bb2b50668e3f.zip |
Merge pull request #5930 from TacoTheDank/bumpGlide
Update Glide library
Diffstat (limited to 'core/src')
3 files changed, 9 insertions, 7 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideModule.java b/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideModule.java index 593b683f7..09b0e978a 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideModule.java +++ b/core/src/main/java/de/danoeh/antennapod/core/glide/ApGlideModule.java @@ -31,7 +31,7 @@ public class ApGlideModule extends AppGlideModule { @Override public void applyOptions(@NonNull Context context, @NonNull GlideBuilder builder) { - builder.setDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_ARGB_8888)); + builder.setDefaultRequestOptions(RequestOptions.formatOf(DecodeFormat.PREFER_ARGB_8888)); @SuppressLint("UsableSpace") long spaceAvailable = context.getCacheDir().getUsableSpace(); long imageCacheSize = (spaceAvailable > 2 * GIGABYTES) ? (250 * MEGABYTES) : (50 * MEGABYTES); 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 8f955e3c5..b6a1851fa 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 @@ -119,8 +119,9 @@ public class NewEpisodesNotification { return Glide.with(context) .asBitmap() .load(feed.getImageUrl()) - .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) - .apply(new RequestOptions().centerCrop()) + .apply(new RequestOptions() + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) + .centerCrop()) .submit(iconSize, iconSize) .get(); } catch (Throwable tr) { 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 c348f5773..47b587d77 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 @@ -72,12 +72,14 @@ public class PlaybackServiceNotificationBuilder { public void loadIcon() { int iconSize = (int) (128 * context.getResources().getDisplayMetrics().density); + final RequestOptions options = new RequestOptions() + .diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY) + .centerCrop(); try { icon = Glide.with(context) .asBitmap() .load(playable.getImageLocation()) - .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) - .apply(new RequestOptions().centerCrop()) + .apply(options) .submit(iconSize, iconSize) .get(); } catch (ExecutionException e) { @@ -85,8 +87,7 @@ public class PlaybackServiceNotificationBuilder { icon = Glide.with(context) .asBitmap() .load(ImageResourceUtils.getFallbackImageLocation(playable)) - .apply(RequestOptions.diskCacheStrategyOf(ApGlideSettings.AP_DISK_CACHE_STRATEGY)) - .apply(new RequestOptions().centerCrop()) + .apply(options) .submit(iconSize, iconSize) .get(); } catch (InterruptedException ignore) { |