diff options
author | Hannes Johansson <hannes.johansson91@gmail.com> | 2021-08-11 00:32:04 +0200 |
---|---|---|
committer | Hannes Johansson <hannes.johansson91@gmail.com> | 2021-08-11 00:39:43 +0200 |
commit | d8a5c4dc5272771b90fef96ecc9a7fec112c988d (patch) | |
tree | fb9d53feb6e1dfbc2076c1ca3c33853acc1e1e8c /app/src/main/java | |
parent | 2d6fff41821fe0011927e6218f64a153cf3ac16a (diff) | |
download | AntennaPod-d8a5c4dc5272771b90fef96ecc9a7fec112c988d.zip |
Clear cover target when setting folder image
To prevent race conditions from recycled views in GridView
Diffstat (limited to 'app/src/main/java')
-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> { |