diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java index f17b7a2ab..acc2c2eb2 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/ConversationAdapter.java @@ -84,6 +84,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { } TextView mLastMessage = (TextView) view.findViewById(R.id.conversation_lastmsg); TextView mTimestamp = (TextView) view.findViewById(R.id.conversation_lastupdate); + TextView mSenderName = (TextView) view.findViewById(R.id.sender_name); ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage); ImageView notificationStatus = (ImageView) view.findViewById(R.id.notification_status); TextView mUnread = (TextView) view.findViewById(R.id.conversation_unread); @@ -125,16 +126,31 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { if (preview.second) { if (conversation.isRead()) { mLastMessage.setTypeface(null, Typeface.ITALIC); + mSenderName.setTypeface(null, Typeface.NORMAL); } else { mLastMessage.setTypeface(null, Typeface.BOLD_ITALIC); + mSenderName.setTypeface(null, Typeface.BOLD); } } else { if (conversation.isRead()) { mLastMessage.setTypeface(null, Typeface.NORMAL); + mSenderName.setTypeface(null, Typeface.NORMAL); } else { mLastMessage.setTypeface(null, Typeface.BOLD); + mSenderName.setTypeface(null, Typeface.BOLD); } } + if (message.getStatus() == Message.STATUS_RECEIVED) { + if (conversation.getMode() == Conversation.MODE_MULTI) { + mSenderName.setVisibility(View.VISIBLE); + mSenderName.setText(UIHelper.getMessageDisplayName(message)); + } else { + mSenderName.setVisibility(View.GONE); + } + } else { + mSenderName.setVisibility(View.VISIBLE); + mSenderName.setText(activity.getString(R.string.me)); + } } long muted_till = conversation.getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL, 0); @@ -158,6 +174,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { if (conversation.getIncomingChatState().equals(ChatState.COMPOSING)) { mLastMessage.setText(R.string.is_typing); mLastMessage.setTypeface(null, Typeface.BOLD_ITALIC); + mSenderName.setVisibility(View.GONE); } return view; } |