diff options
author | Hannes Johansson <hannes.johansson91@gmail.com> | 2021-08-11 00:32:04 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-08-17 19:53:57 +0200 |
commit | b80c26615c4ccc82a9ba1e5a3ce4beb6ce1d0f56 (patch) | |
tree | 08a6c1037c181559248a5c55a8f7a25406e550a4 /app/src | |
parent | cac665272a532879afc31a60321e91f2c9675e16 (diff) | |
download | AntennaPod-b80c26615c4ccc82a9ba1e5a3ce4beb6ce1d0f56.zip |
Backport: Clear cover target when setting folder image
To prevent race conditions from recycled views in GridView
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java | 5 |
1 files changed, 4 insertions, 1 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 aeaf526be..5d7593564 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/CoverLoader.java @@ -72,7 +72,10 @@ public class CoverLoader { } public void load() { + CoverTarget coverTarget = new CoverTarget(txtvPlaceholder, imgvCover, textAndImageCombined); + if (resource != 0) { + Glide.with(activity).clear(coverTarget); imgvCover.setImageResource(resource); CoverTarget.setPlaceholderVisibility(txtvPlaceholder, textAndImageCombined); return; @@ -93,7 +96,7 @@ public class CoverLoader { .apply(options)); } - builder.into(new CoverTarget(txtvPlaceholder, imgvCover, textAndImageCombined)); + builder.into(coverTarget); } static class CoverTarget extends CustomViewTarget<ImageView, Drawable> { |