summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeking_ling <lingbjsz@gmail.com>2023-05-07 17:43:35 +0800
committerGitHub <noreply@github.com>2023-05-07 11:43:35 +0200
commitc759eed50d9c07c2314ff28800a17ae5cac9d35c (patch)
tree786a8d90828f915b6da07946f43f5aba9cb810d4
parentb8a1c1f49ac57a6c0cee9ccab45f565e6bf6b67f (diff)
downloadAntennaPod-c759eed50d9c07c2314ff28800a17ae5cac9d35c.zip
Fix Glide leaking reference to activity (#6446)
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java4
3 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java
index 1d06bf07c..d5c67c675 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java
@@ -69,7 +69,7 @@ public class CoverLoader {
CoverTarget coverTarget = new CoverTarget(fallbackTitle, imgvCover, textAndImageCombined);
if (resource != 0) {
- Glide.with(activity).clear(coverTarget);
+ Glide.with(imgvCover).clear(coverTarget);
imgvCover.setImageResource(resource);
CoverTarget.setTitleVisibility(fallbackTitle, textAndImageCombined);
return;
@@ -79,13 +79,13 @@ public class CoverLoader {
.fitCenter()
.dontAnimate();
- RequestBuilder<Drawable> builder = Glide.with(activity)
+ RequestBuilder<Drawable> builder = Glide.with(imgvCover)
.as(Drawable.class)
.load(uri)
.apply(options);
if (fallbackUri != null) {
- builder = builder.error(Glide.with(activity)
+ builder = builder.error(Glide.with(imgvCover)
.as(Drawable.class)
.load(fallbackUri)
.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 b45f44108..b52ebcaae 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
@@ -203,9 +203,9 @@ public class ExternalPlayerFragment extends Fragment {
.fitCenter()
.dontAnimate();
- Glide.with(getActivity())
+ Glide.with(this)
.load(ImageResourceUtils.getEpisodeListImageLocation(media))
- .error(Glide.with(getActivity())
+ .error(Glide.with(this)
.load(ImageResourceUtils.getFallbackImageLocation(media))
.apply(options))
.apply(options)
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
index f59d5dbd4..6f3aaa6a5 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedItemlistFragment.java
@@ -498,7 +498,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
}
private void loadFeedImage() {
- Glide.with(getActivity())
+ Glide.with(this)
.load(feed.getImageUrl())
.apply(new RequestOptions()
.placeholder(R.color.image_readability_tint)
@@ -507,7 +507,7 @@ public class FeedItemlistFragment extends Fragment implements AdapterView.OnItem
.dontAnimate())
.into(viewBinding.imgvBackground);
- Glide.with(getActivity())
+ Glide.with(this)
.load(feed.getImageUrl())
.apply(new RequestOptions()
.placeholder(R.color.light_gray)