From 900ad2f7ef852fe52aaa047022ac57cc59e2ae4f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 23 Nov 2017 09:36:51 +0100 Subject: [PATCH] ConversationsAdapter: Use EmojiWrapper instead of EmojiTextView --- .../eu/siacs/conversations/services/NotificationService.java | 2 +- .../siacs/conversations/ui/adapter/ConversationAdapter.java | 5 +++-- src/main/res/layout/conversation_list_row.xml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index aad1ce392..408d7f71c 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -499,7 +499,7 @@ public class NotificationService { for (Message message : messages) { Pair preview = UIHelper.getMessagePreview(mXmppConnectionService, message); // only show user written text - if (preview.second == false) { + if (!preview.second) { uBuilder.addMessage(preview.first); uBuilder.setLatestTimestamp(message.getTimeSent()); } diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index ab32e785f..bf13a39e7 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -26,6 +26,7 @@ import eu.siacs.conversations.entities.Transferable; import eu.siacs.conversations.ui.ConversationActivity; import eu.siacs.conversations.ui.XmppActivity; import eu.siacs.conversations.ui.widget.UnreadCountCustomView; +import eu.siacs.conversations.utils.EmojiWrapper; import eu.siacs.conversations.utils.UIHelper; public class ConversationAdapter extends ArrayAdapter { @@ -52,7 +53,7 @@ public class ConversationAdapter extends ArrayAdapter { } TextView convName = (TextView) view.findViewById(R.id.conversation_name); if (conversation.getMode() == Conversation.MODE_SINGLE || activity.useSubjectToIdentifyConference()) { - convName.setText(conversation.getName()); + convName.setText(EmojiWrapper.transform(conversation.getName())); } else { convName.setText(conversation.getJid().toBareJid().toString()); } @@ -108,7 +109,7 @@ public class ConversationAdapter extends ArrayAdapter { final Pair preview = UIHelper.getMessagePreview(activity,message); if (showPreviewText) { - mLastMessage.setText(preview.first); + mLastMessage.setText(EmojiWrapper.transform(preview.first)); } else { mLastMessageImage.setContentDescription(preview.first); } diff --git a/src/main/res/layout/conversation_list_row.xml b/src/main/res/layout/conversation_list_row.xml index 635df530e..d30045c7f 100644 --- a/src/main/res/layout/conversation_list_row.xml +++ b/src/main/res/layout/conversation_list_row.xml @@ -37,7 +37,7 @@ android:layout_toRightOf="@+id/conversation_image" android:paddingLeft="8dp"> - -