Merge pull request #5341 from myslok/clear-cover-targets-to-prevent-folder-cover-race-condition

Clear cover target when setting folder image in CoverLoader
This commit is contained in:
ByteHamster 2021-08-12 20:57:36 +02:00 committed by GitHub
commit e532793597
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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> {