From 3ed82c1726b3e0f9a1ededc0c7e4ae837f6ed4f5 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Thu, 2 Nov 2017 18:12:06 -0700 Subject: [PATCH] Glide -> glideRequests in GiphyAdapter // FREEBIE --- .../thoughtcrime/securesms/giph/ui/GiphyAdapter.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/org/thoughtcrime/securesms/giph/ui/GiphyAdapter.java b/src/org/thoughtcrime/securesms/giph/ui/GiphyAdapter.java index 8761ae087b..ab89e38ab9 100644 --- a/src/org/thoughtcrime/securesms/giph/ui/GiphyAdapter.java +++ b/src/org/thoughtcrime/securesms/giph/ui/GiphyAdapter.java @@ -101,11 +101,10 @@ class GiphyAdapter extends RecyclerView.Adapter { } } - return Glide.with(context) - .load(forMms ? new GiphyPaddedUrl(image.getGifMmsUrl(), image.getMmsGifSize()) : - new GiphyPaddedUrl(image.getGifUrl(), image.getGifSize())) - .downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) - .get(); + return glideRequests.load(forMms ? new GiphyPaddedUrl(image.getGifMmsUrl(), image.getMmsGifSize()) : + new GiphyPaddedUrl(image.getGifUrl(), image.getGifSize())) + .downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) + .get(); } public synchronized void setModelReady() { @@ -172,7 +171,7 @@ class GiphyAdapter extends RecyclerView.Adapter { @Override public void onViewRecycled(GiphyViewHolder holder) { super.onViewRecycled(holder); - Glide.with(context).clear(holder.thumbnail); + glideRequests.clear(holder.thumbnail); } @Override