Recycle correctly instead of turning it off

Closes #5841
Fixes #5831
This commit is contained in:
FeuRenard 2016-11-08 01:19:08 +01:00 committed by Moxie Marlinspike
parent 06b1045e09
commit 0945b19364

View File

@ -46,7 +46,6 @@ public class GiphyAdapter extends RecyclerView.Adapter<GiphyAdapter.GiphyViewHol
GiphyViewHolder(View view) { GiphyViewHolder(View view) {
super(view); super(view);
super.setIsRecyclable(false);
thumbnail = ViewUtil.findById(view, R.id.thumbnail); thumbnail = ViewUtil.findById(view, R.id.thumbnail);
gifProgress = ViewUtil.findById(view, R.id.gif_progress); gifProgress = ViewUtil.findById(view, R.id.gif_progress);
thumbnail.setOnClickListener(this); thumbnail.setOnClickListener(this);
@ -157,6 +156,12 @@ public class GiphyAdapter extends RecyclerView.Adapter<GiphyAdapter.GiphyViewHol
} }
} }
@Override
public void onViewRecycled(GiphyViewHolder holder) {
super.onViewRecycled(holder);
Glide.clear(holder.thumbnail);
}
@Override @Override
public int getItemCount() { public int getItemCount() {
return images.size(); return images.size();