Implements FS#64: Show who wrote last message in conversation overview
This commit is contained in:
parent
d84151487e
commit
0af30b4aec
1 changed files with 13 additions and 2 deletions
|
@ -110,7 +110,18 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
|||
Pair<String,Boolean> preview = UIHelper.getMessagePreview(activity,message);
|
||||
mLastMessage.setVisibility(View.VISIBLE);
|
||||
imagePreview.setVisibility(View.GONE);
|
||||
mLastMessage.setText(preview.first);
|
||||
CharSequence msgText = preview.first;
|
||||
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);
|
||||
|
@ -140,7 +151,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
|||
notificationStatus.setImageResource(R.drawable.ic_notifications_none_grey600_24dp);
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue