diff --git a/src/org/thoughtcrime/securesms/ConversationItem.java b/src/org/thoughtcrime/securesms/ConversationItem.java index 51e20c9e8..3d5ea4d95 100644 --- a/src/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/org/thoughtcrime/securesms/ConversationItem.java @@ -101,7 +101,7 @@ public class ConversationItem extends LinearLayout private GlideRequests glideRequests; protected ViewGroup bodyBubble; - protected View reply; + protected View replyView; @Nullable private QuoteView quoteView; private TextView bodyText; private ConversationItemFooter footer; @@ -162,7 +162,7 @@ public class ConversationItem extends LinearLayout this.groupSenderHolder = findViewById(R.id.group_sender_holder); this.quoteView = findViewById(R.id.quote_view); this.container = findViewById(R.id.container); - this.reply = findViewById(R.id.reply_icon); + this.replyView = findViewById(R.id.reply_icon); setOnClickListener(new ClickListener(null)); @@ -215,17 +215,10 @@ public class ConversationItem extends LinearLayout } public boolean disallowSwipe(float downX, float downY) { - if (BuildConfig.DEBUG) { - // If it is possible to reply to a message, it should also be possible to swipe it. - // For this to be possible we need a non-null reply icon. - boolean replyNull = (reply == null); - boolean canReply = ConversationFragment.canReplyToMsg(messageRecord); - if (replyNull == canReply) { - String msg = "(reply == null) was " + replyNull + " but canReplyToMsg() was " + canReply; - throw new AssertionError(msg); - } - } - if (reply == null) return true; + // If it is possible to reply to a message, it should also be possible to swipe it. + // For this to be possible we need a non-null reply icon. + // This means that `replyView != null` must always be the same as ConversationFragment.canReplyToMsg(messageRecord). + if (replyView == null) return true; if (!dcChat.canSend()) return true; if (!hasAudio(messageRecord)) return false; diff --git a/src/org/thoughtcrime/securesms/ConversationSwipeAnimationHelper.java b/src/org/thoughtcrime/securesms/ConversationSwipeAnimationHelper.java index 109144b86..a5380388d 100644 --- a/src/org/thoughtcrime/securesms/ConversationSwipeAnimationHelper.java +++ b/src/org/thoughtcrime/securesms/ConversationSwipeAnimationHelper.java @@ -33,12 +33,12 @@ final class ConversationSwipeAnimationHelper { float progress = dx / TRIGGER_DX; updateBodyBubbleTransition(conversationItem.bodyBubble, dx, sign); - updateReplyIconTransition(conversationItem.reply, dx, progress, sign); + updateReplyIconTransition(conversationItem.replyView, dx, progress, sign); updateContactPhotoHolderTransition(conversationItem.contactPhotoHolder, progress, sign); } public static void trigger(@NonNull ConversationItem conversationItem) { - triggerReplyIcon(conversationItem.reply); + triggerReplyIcon(conversationItem.replyView); } private static void updateBodyBubbleTransition(@NonNull View bodyBubble, float dx, float sign) {