From 404097fe302edfa2a192abe05f4dc66323978d98 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Wed, 30 Oct 2024 18:22:21 +0100 Subject: [PATCH] keep old style for "show full message" --- .../securesms/ConversationItem.java | 14 ++++++++++---- .../res/layout/conversation_item_received.xml | 18 ++++++++++++++++++ src/main/res/layout/conversation_item_sent.xml | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/thoughtcrime/securesms/ConversationItem.java b/src/main/java/org/thoughtcrime/securesms/ConversationItem.java index ff908166b..2628cd130 100644 --- a/src/main/java/org/thoughtcrime/securesms/ConversationItem.java +++ b/src/main/java/org/thoughtcrime/securesms/ConversationItem.java @@ -111,6 +111,7 @@ public class ConversationItem extends BaseConversationItem protected ViewGroup contactPhotoHolder; private ViewGroup container; private Button msgActionButton; + private Button showFullButton; private @NonNull Stub mediaThumbnailStub; private @NonNull Stub audioViewStub; @@ -157,6 +158,7 @@ public class ConversationItem extends BaseConversationItem this.container = findViewById(R.id.container); this.replyView = findViewById(R.id.reply_icon); this.msgActionButton = findViewById(R.id.msg_action_button); + this.showFullButton = findViewById(R.id.show_full_button); setOnClickListener(new ClickListener(null)); @@ -406,6 +408,7 @@ public class ConversationItem extends BaseConversationItem int downloadState = messageRecord.getDownloadState(); if (downloadState == DcMsg.DC_DOWNLOAD_AVAILABLE || downloadState == DcMsg.DC_DOWNLOAD_FAILURE || downloadState == DcMsg.DC_DOWNLOAD_IN_PROGRESS) { + showFullButton.setVisibility(View.GONE); msgActionButton.setVisibility(View.VISIBLE); if (downloadState==DcMsg.DC_DOWNLOAD_IN_PROGRESS) { msgActionButton.setEnabled(false); @@ -426,6 +429,7 @@ public class ConversationItem extends BaseConversationItem } }); } else if (messageRecord.getType() == DcMsg.DC_MSG_WEBXDC) { + showFullButton.setVisibility(View.GONE); msgActionButton.setVisibility(View.VISIBLE); msgActionButton.setEnabled(true); msgActionButton.setText(R.string.start_app); @@ -438,10 +442,11 @@ public class ConversationItem extends BaseConversationItem }); } else if (messageRecord.hasHtml()) { - msgActionButton.setVisibility(View.VISIBLE); - msgActionButton.setEnabled(true); - msgActionButton.setText(R.string.show_full_message); - msgActionButton.setOnClickListener(view -> { + msgActionButton.setVisibility(View.GONE); + showFullButton.setVisibility(View.VISIBLE); + showFullButton.setEnabled(true); + showFullButton.setText(R.string.show_full_message); + showFullButton.setOnClickListener(view -> { if (eventListener != null && batchSelected.isEmpty()) { eventListener.onShowFullClicked(messageRecord); } else { @@ -450,6 +455,7 @@ public class ConversationItem extends BaseConversationItem }); } else { msgActionButton.setVisibility(View.GONE); + showFullButton.setVisibility(View.GONE); } } diff --git a/src/main/res/layout/conversation_item_received.xml b/src/main/res/layout/conversation_item_received.xml index cd7322b75..44570085f 100644 --- a/src/main/res/layout/conversation_item_received.xml +++ b/src/main/res/layout/conversation_item_received.xml @@ -194,6 +194,24 @@ android:text="@string/show_full_message" android:textAllCaps="false"/> +