From 79b2f3468515e991fa85d27517ea86d2ce50c7d1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 6 Mar 2017 19:42:27 +0100 Subject: [PATCH] added colon to seperate sender and message preview. only show first name --- .../siacs/conversations/ui/adapter/ConversationAdapter.java | 5 +++-- src/main/res/layout/conversation_list_row.xml | 5 +++-- src/main/res/values-v21/themes.xml | 2 ++ src/main/res/values/attrs.xml | 1 + src/main/res/values/themes.xml | 4 ++++ 5 files changed, 13 insertions(+), 4 deletions(-) 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 3456a0e15..154b68b50 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -76,6 +76,7 @@ public class ConversationAdapter extends ArrayAdapter { if (message.getFileParams().width > 0 && (message.getTransferable() == null || message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) { + mSenderName.setVisibility(View.GONE); mLastMessage.setVisibility(View.GONE); imagePreview.setVisibility(View.VISIBLE); activity.loadBitmap(message, imagePreview); @@ -110,13 +111,13 @@ public class ConversationAdapter extends ArrayAdapter { if (message.getStatus() == Message.STATUS_RECEIVED) { if (conversation.getMode() == Conversation.MODE_MULTI) { mSenderName.setVisibility(View.VISIBLE); - mSenderName.setText(UIHelper.getMessageDisplayName(message)); + mSenderName.setText(UIHelper.getMessageDisplayName(message).split("\\s+")[0]+':'); } else { mSenderName.setVisibility(View.GONE); } } else { mSenderName.setVisibility(View.VISIBLE); - mSenderName.setText(activity.getString(R.string.me)); + mSenderName.setText(activity.getString(R.string.me)+':'); } } diff --git a/src/main/res/layout/conversation_list_row.xml b/src/main/res/layout/conversation_list_row.xml index 764cb28e2..12605e6ca 100644 --- a/src/main/res/layout/conversation_list_row.xml +++ b/src/main/res/layout/conversation_list_row.xml @@ -66,9 +66,10 @@ android:gravity="center_vertical" android:layout_alignParentLeft="true" android:text="@string/me" - android:layout_marginRight="3sp" + android:layout_marginRight="?attr/TextSeparation" android:textColor="?attr/color_text_secondary" - android:visibility="visible"/> + android:visibility="visible" + android:textSize="?attr/TextSizeBody"/> 12sp 14sp + 5sp 18sp 20sp @@ -94,6 +95,7 @@ 12sp 14sp + 5sp 18sp 20sp diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml index 9ba50ef3a..33637e5b5 100644 --- a/src/main/res/values/attrs.xml +++ b/src/main/res/values/attrs.xml @@ -4,6 +4,7 @@ + diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml index e8f14a35b..ad1640c3b 100644 --- a/src/main/res/values/themes.xml +++ b/src/main/res/values/themes.xml @@ -8,6 +8,7 @@ 12sp 14sp 20sp + 5sp 18sp @color/black87 @@ -81,6 +82,7 @@ @style/ConversationsActionBarTabs 12sp 14sp + 5sp 18sp 20sp @@ -152,6 +154,7 @@ @@ -160,6 +163,7 @@ 14sp 16sp 20sp + 6sp 22sp