From 08e422953307175982d5f78a1d591a3abb71785d Mon Sep 17 00:00:00 2001 From: Hocuri Date: Thu, 19 Dec 2024 13:30:24 +0100 Subject: [PATCH] Make the attachment background the same as the input bar background (#3477) * Make the attachment background the same as the input bar background Two different users recently complained that they find drafting images confusing. One of them thought that they had already sent it, the other one didn't know how to send it (both of them figured it out after ~10s, but still, it's nicer to avoid such confusion). In both cases, the problem was that the background of the attached file is the same as the chat background, not the same as the input bar, even though the attached file belongs to the input bar and not to the chat. * Add a stroke around the to-be attachment --- .../securesms/mms/AttachmentManager.java | 5 ----- ..._bubble_background_sent_alone_with_border.xml | 16 ++++++++++++++++ ..._bubble_background_sent_alone_with_border.xml | 16 ++++++++++++++++ ...versation_activity_attachment_editor_stub.xml | 9 +++++---- 4 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 src/main/res/drawable-ldrtl/message_bubble_background_sent_alone_with_border.xml create mode 100644 src/main/res/drawable/message_bubble_background_sent_alone_with_border.xml diff --git a/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java b/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java index 867b2a4d4..f8d6025e1 100644 --- a/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java +++ b/src/main/java/org/thoughtcrime/securesms/mms/AttachmentManager.java @@ -126,11 +126,6 @@ public class AttachmentManager { removableMediaView.setRemoveClickListener(new RemoveButtonListener()); removableMediaView.setEditClickListener(new EditButtonListener()); thumbnail.setOnClickListener(new ThumbnailClickListener()); - int incomingBubbleColor = ThemeUtil.getThemedColor(context, R.attr.conversation_item_incoming_bubble_color); - audioView.getBackground().setColorFilter(incomingBubbleColor, PorterDuff.Mode.MULTIPLY); - documentView.getBackground().setColorFilter(incomingBubbleColor, PorterDuff.Mode.MULTIPLY); - webxdcView.getBackground().setColorFilter(incomingBubbleColor, PorterDuff.Mode.MULTIPLY); - vcardView.getBackground().setColorFilter(incomingBubbleColor, PorterDuff.Mode.MULTIPLY); } } diff --git a/src/main/res/drawable-ldrtl/message_bubble_background_sent_alone_with_border.xml b/src/main/res/drawable-ldrtl/message_bubble_background_sent_alone_with_border.xml new file mode 100644 index 000000000..315f63174 --- /dev/null +++ b/src/main/res/drawable-ldrtl/message_bubble_background_sent_alone_with_border.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/src/main/res/drawable/message_bubble_background_sent_alone_with_border.xml b/src/main/res/drawable/message_bubble_background_sent_alone_with_border.xml new file mode 100644 index 000000000..e8ac29c9a --- /dev/null +++ b/src/main/res/drawable/message_bubble_background_sent_alone_with_border.xml @@ -0,0 +1,16 @@ + + + + + + + + + + diff --git a/src/main/res/layout/conversation_activity_attachment_editor_stub.xml b/src/main/res/layout/conversation_activity_attachment_editor_stub.xml index 81c2b18c5..9e752fd30 100644 --- a/src/main/res/layout/conversation_activity_attachment_editor_stub.xml +++ b/src/main/res/layout/conversation_activity_attachment_editor_stub.xml @@ -4,6 +4,7 @@ android:id="@+id/attachment_editor" android:layout_width="match_parent" android:layout_height="wrap_content" + android:background="?attr/input_panel_bg_color" android:gravity="center_horizontal" android:visibility="gone"> @@ -45,7 +46,7 @@ android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:padding="8dp" - android:background="@drawable/message_bubble_background_sent_alone"/> + android:background="@drawable/message_bubble_background_sent_alone_with_border"/> + android:background="@drawable/message_bubble_background_sent_alone_with_border"/> + android:background="@drawable/message_bubble_background_sent_alone_with_border"/> + android:background="@drawable/message_bubble_background_sent_alone_with_border"/>