From adc6fc8524ce2c1a94e0aa775add538b97491489 Mon Sep 17 00:00:00 2001 From: Jake McGinty Date: Sun, 6 Sep 2015 17:20:01 -1000 Subject: [PATCH] only allow thumbnail clicks when slide is present fixes #4024 Closes #4040 // FREEBIE --- .../securesms/components/ThumbnailView.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/org/thoughtcrime/securesms/components/ThumbnailView.java b/src/org/thoughtcrime/securesms/components/ThumbnailView.java index 34ebf5e22c..6bd8470565 100644 --- a/src/org/thoughtcrime/securesms/components/ThumbnailView.java +++ b/src/org/thoughtcrime/securesms/components/ThumbnailView.java @@ -183,7 +183,11 @@ public class ThumbnailView extends FrameLayout { this.slide = slide; buildGlideRequest(slide, masterSecret).into(image); - setOnClickListener(new ThumbnailClickDispatcher(thumbnailClickListener, slide)); + if (this.slide.getTransferProgress() == PartDatabase.TRANSFER_PROGRESS_DONE) { + setOnClickListener(new ThumbnailClickDispatcher(thumbnailClickListener, slide)); + } else { + setOnClickListener(null); + } downloadButton.setOnClickListener(new ThumbnailClickDispatcher(downloadClickListener, slide)); } @@ -338,10 +342,9 @@ public class ThumbnailView extends FrameLayout { @Override public void onClick(View view) { - if (listener != null) { + if (listener != null) + { listener.onClick(view, slide); - } else { - Log.w(TAG, "onClick, but no thumbnail click listener attached."); } } }