Fix issue where thumb resource wasn't set to null after clear.

This commit is contained in:
Alex Hart 2022-03-25 09:20:25 -03:00 committed by Greyson Parrelli
parent 2549c1f97d
commit 8c1ddcf1c0
3 changed files with 7 additions and 2 deletions

View file

@ -428,11 +428,15 @@ public class ThumbnailView extends FrameLayout {
public void clear(GlideRequests glideRequests) {
glideRequests.clear(image);
image.setImageDrawable(null);
if (transferControls.isPresent()) {
getTransferControls().clear();
}
glideRequests.clear(blurhash);
blurhash.setImageDrawable(null);
slide = null;
}

View file

@ -136,6 +136,7 @@ object StoriesLandingItem {
storyMulti.visible = false
}
} else {
storyMulti.clear(GlideApp.with(storyPreview))
storyMulti.visible = false
}

View file

@ -103,9 +103,9 @@ object MyStoriesItem {
if (record.storyType.isTextStory) {
storyPreview.setImageResource(GlideApp.with(storyPreview), StoryTextPostModel.parseFrom(record), 0, 0)
} else if (thumbnail != null) {
storyPreview.setImageResource(GlideApp.with(itemView), thumbnail, false, true)
storyPreview.setImageResource(GlideApp.with(storyPreview), thumbnail, false, true)
} else {
storyPreview.clear(GlideApp.with(itemView))
storyPreview.clear(GlideApp.with(storyPreview))
}
}