From 4e2e9260bbc67a4ce0352ec413b6c3fa0524f510 Mon Sep 17 00:00:00 2001 From: Arne Date: Sat, 16 Nov 2024 23:29:39 +0100 Subject: [PATCH] bold nicknames in message bubbles --- .../conversations/ui/adapter/MessageAdapter.java | 7 ++++++- src/main/res/layout/item_message_received.xml | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index b0fb71295..42574a7bf 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -397,7 +397,9 @@ public class MessageAdapter extends ArrayAdapter { if (mForceNames || multiReceived || (message.getTrueCounterpart() != null && message.getContact() != null)) { final String displayName = UIHelper.getMessageDisplayName(message); if (displayName != null) { - timeInfoBuilder.add(displayName); + timeInfoBuilder.add(""); + viewHolder.username.setVisibility(View.VISIBLE); + viewHolder.username.setText(displayName); } } if (bodyLanguage != null) { @@ -1181,6 +1183,7 @@ public class MessageAdapter extends ArrayAdapter { viewHolder.messageBody = view.findViewById(R.id.message_body); } viewHolder.time = view.findViewById(R.id.message_time); + viewHolder.username = view.findViewById(R.id.username); viewHolder.subject = view.findViewById(R.id.message_subject); viewHolder.inReplyTo = view.findViewById(R.id.in_reply_to); viewHolder.inReplyToBox = view.findViewById(R.id.in_reply_to_box); @@ -1210,6 +1213,7 @@ public class MessageAdapter extends ArrayAdapter { viewHolder.messageBody = view.findViewById(R.id.message_body); } viewHolder.time = view.findViewById(R.id.message_time); + viewHolder.username = view.findViewById(R.id.username); viewHolder.subject = view.findViewById(R.id.message_subject); viewHolder.inReplyTo = view.findViewById(R.id.in_reply_to); viewHolder.inReplyToQuote = view.findViewById(R.id.in_reply_to_quote); @@ -1967,6 +1971,7 @@ public class MessageAdapter extends ArrayAdapter { protected ImageView indicator; protected ImageView indicatorReceived; protected TextView time; + protected TextView username; protected TextView subject; protected TextView inReplyTo; protected TextView inReplyToQuote; diff --git a/src/main/res/layout/item_message_received.xml b/src/main/res/layout/item_message_received.xml index 3783b7715..32d96e9be 100644 --- a/src/main/res/layout/item_message_received.xml +++ b/src/main/res/layout/item_message_received.xml @@ -140,6 +140,17 @@ android:textAppearance="?textAppearanceBodySmall" android:textColor="?colorOnTertiaryContainer" tools:text="10:42" /> + +