fix images disappearing when in recyclerviews
Fixes #3142 Closes #3288 // FREEBIE
This commit is contained in:
parent
bd2e984963
commit
bb6b86ad59
2 changed files with 5 additions and 5 deletions
|
@ -166,6 +166,7 @@ public class ConversationItem extends LinearLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unbind() {
|
public void unbind() {
|
||||||
|
mediaThumbnail.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageRecord getMessageRecord() {
|
public MessageRecord getMessageRecord() {
|
||||||
|
|
|
@ -53,11 +53,6 @@ public class ThumbnailView extends ForegroundImageView {
|
||||||
super(context, attrs, defStyle);
|
super(context, attrs, defStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override protected void onDetachedFromWindow() {
|
|
||||||
Glide.clear(this);
|
|
||||||
super.onDetachedFromWindow();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setImageResource(@Nullable MasterSecret masterSecret,
|
public void setImageResource(@Nullable MasterSecret masterSecret,
|
||||||
long id, long timestamp,
|
long id, long timestamp,
|
||||||
@NonNull ListenableFutureTask<SlideDeck> slideDeckFuture)
|
@NonNull ListenableFutureTask<SlideDeck> slideDeckFuture)
|
||||||
|
@ -97,6 +92,10 @@ public class ThumbnailView extends ForegroundImageView {
|
||||||
this.thumbnailClickListener = listener;
|
this.thumbnailClickListener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
if (isContextValid()) Glide.clear(this);
|
||||||
|
}
|
||||||
|
|
||||||
@TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
|
@TargetApi(VERSION_CODES.JELLY_BEAN_MR1)
|
||||||
private boolean isContextValid() {
|
private boolean isContextValid() {
|
||||||
return !(getContext() instanceof Activity) ||
|
return !(getContext() instanceof Activity) ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue