Skip to content

Commit

Permalink
Make the attachment background the same as the input bar background (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Hocuri authored Dec 19, 2024
1 parent 0c9277d commit 08e4229
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ private void inflateStub() {
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);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="2px"
android:bottom="2px">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#55888888" />
<corners
android:topLeftRadius="@dimen/message_corner_radius"
android:topRightRadius="@dimen/message_corner_radius"
android:bottomRightRadius="@dimen/message_corner_radius" />
<solid android:color="?attr/conversation_item_incoming_bubble_color" />
</shape>
</item>
</layer-list>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="2px"
android:bottom="2px">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#55888888" />
<corners
android:topLeftRadius="@dimen/message_corner_radius"
android:topRightRadius="@dimen/message_corner_radius"
android:bottomLeftRadius="@dimen/message_corner_radius" />
<solid android:color="?attr/conversation_item_incoming_bubble_color" />
</shape>
</item>
</layer-list>
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand Down Expand Up @@ -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"/>

<org.thoughtcrime.securesms.components.DocumentView
android:id="@+id/attachment_document"
Expand All @@ -56,7 +57,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"/>

<org.thoughtcrime.securesms.components.WebxdcView
android:id="@+id/attachment_webxdc"
Expand All @@ -67,7 +68,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"/>

<org.thoughtcrime.securesms.components.VcardView
android:id="@+id/attachment_vcard"
Expand All @@ -78,7 +79,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"/>

</org.thoughtcrime.securesms.components.RemovableEditableMediaView>

Expand Down

0 comments on commit 08e4229

Please sign in to comment.