From 0e2cd3e14208780c09281bf5ad05cb7d657e261a Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 15 Jan 2016 11:46:21 +0100 Subject: Implements FS#64: Show who wrote last message in conversation overview --- Conversations-Plus-ChangeLog.md | 5 ++++- .../conversationsplus/ui/adapter/ConversationAdapter.java | 14 ++++++++++++-- src/main/res/values-de/strings.xml | 1 + src/main/res/values/strings.xml | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Conversations-Plus-ChangeLog.md b/Conversations-Plus-ChangeLog.md index 5e7b7782..f3ef617c 100644 --- a/Conversations-Plus-ChangeLog.md +++ b/Conversations-Plus-ChangeLog.md @@ -11,9 +11,12 @@ * Fixes FS#82: Strange layout in share with activity * Fixes FS#81: Interactive message loading causes "jumps" * Implements FS#78: Allow installation on SD card +* Implements FS#77: Open list of resources for own jid +* Implements FS#76: Adapt notification icon to new logo * Fixes FS#75: Change color names to reasonable names * Fixes FS#70: Fixed Identity Strings -* Implements FS#67: Display logcat within application +* Implements FS#67: Display logcat within application +* Implements FS#64: Show who wrote last message in conversation overview * Fixes FS#47: Setting "WLAN only" no longer works for received links * Implements FS#26: Introduce dialog to choose whether to send resized picture or original picture * Implements FS#24: Introduce setting for picture resizing diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java index b6d861d4..590a6cfd 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java @@ -112,7 +112,17 @@ public class ConversationAdapter extends ArrayAdapter { mLastMessage.setVisibility(View.VISIBLE); imagePreview.setVisibility(View.GONE); CharSequence msgText = preview.first; - mLastMessage.setText(msgText); + String msgPrefix = null; + if (message.getStatus() == Message.STATUS_SEND + || message.getStatus() == Message.STATUS_SEND_DISPLAYED + || message.getStatus() == Message.STATUS_SEND_FAILED + || message.getStatus() == Message.STATUS_SEND_RECEIVED) { + msgPrefix = activity.getString(R.string.cplus_me); + } else if (conversation.getMode() == Conversation.MODE_MULTI) { + msgPrefix = UIHelper.getMessageDisplayName(message); + } + String lastMessagePreview = ((null == msgPrefix || msgPrefix.isEmpty()) ? "" : (msgPrefix + ": ")) + msgText; + mLastMessage.setText(lastMessagePreview); if (preview.second) { if (conversation.isRead()) { mLastMessage.setTypeface(null, Typeface.ITALIC); @@ -128,7 +138,7 @@ public class ConversationAdapter extends ArrayAdapter { } } - mTimestamp.setText(UIHelper.readableTimeDifference(activity,conversation.getLatestMessage().getTimeSent())); + mTimestamp.setText(UIHelper.readableTimeDifference(activity, message.getTimeSent())); ImageView profilePicture = (ImageView) view.findViewById(R.id.conversation_image); profilePicture.setOnLongClickListener(new ShowResourcesListDialogListener(activity, conversation.getContact())); loadAvatar(conversation, profilePicture); diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml index 617aedd3..22d5bc32 100644 --- a/src/main/res/values-de/strings.xml +++ b/src/main/res/values-de/strings.xml @@ -511,4 +511,5 @@ Unterordner des globalen Bilderordners, um eingehende Bilder zu speichern. Dateiübertragung Nichts zu kopieren. + Ich diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index 62644175..8885622b 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -544,4 +544,5 @@ This is the subdirectory in the pictures directory for incoming files. File Transfer Nothing to copy. + Me -- cgit v1.2.3