added colon to seperate sender and message preview. only show first name

This commit is contained in:
Daniel Gultsch 2017-03-06 19:42:27 +01:00
parent 9f3543a650
commit 79b2f34685
5 changed files with 13 additions and 4 deletions

View file

@ -76,6 +76,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
if (message.getFileParams().width > 0 if (message.getFileParams().width > 0
&& (message.getTransferable() == null && (message.getTransferable() == null
|| message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) { || message.getTransferable().getStatus() != Transferable.STATUS_DELETED)) {
mSenderName.setVisibility(View.GONE);
mLastMessage.setVisibility(View.GONE); mLastMessage.setVisibility(View.GONE);
imagePreview.setVisibility(View.VISIBLE); imagePreview.setVisibility(View.VISIBLE);
activity.loadBitmap(message, imagePreview); activity.loadBitmap(message, imagePreview);
@ -110,13 +111,13 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
if (message.getStatus() == Message.STATUS_RECEIVED) { if (message.getStatus() == Message.STATUS_RECEIVED) {
if (conversation.getMode() == Conversation.MODE_MULTI) { if (conversation.getMode() == Conversation.MODE_MULTI) {
mSenderName.setVisibility(View.VISIBLE); mSenderName.setVisibility(View.VISIBLE);
mSenderName.setText(UIHelper.getMessageDisplayName(message)); mSenderName.setText(UIHelper.getMessageDisplayName(message).split("\\s+")[0]+':');
} else { } else {
mSenderName.setVisibility(View.GONE); mSenderName.setVisibility(View.GONE);
} }
} else { } else {
mSenderName.setVisibility(View.VISIBLE); mSenderName.setVisibility(View.VISIBLE);
mSenderName.setText(activity.getString(R.string.me)); mSenderName.setText(activity.getString(R.string.me)+':');
} }
} }

View file

@ -66,9 +66,10 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:text="@string/me" android:text="@string/me"
android:layout_marginRight="3sp" android:layout_marginRight="?attr/TextSeparation"
android:textColor="?attr/color_text_secondary" android:textColor="?attr/color_text_secondary"
android:visibility="visible"/> android:visibility="visible"
android:textSize="?attr/TextSizeBody"/>
<LinearLayout android:layout_width="match_parent" <LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -17,6 +17,7 @@
<item name="TextSizeInfo">12sp</item> <item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item> <item name="TextSizeBody">14sp</item>
<item name="TextSeparation">5sp</item>
<item name="IconSize">18sp</item> <item name="IconSize">18sp</item>
<item name="TextSizeHeadline">20sp</item> <item name="TextSizeHeadline">20sp</item>
@ -94,6 +95,7 @@
<item name="TextSizeInfo">12sp</item> <item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item> <item name="TextSizeBody">14sp</item>
<item name="TextSeparation">5sp</item>
<item name="IconSize">18sp</item> <item name="IconSize">18sp</item>
<item name="TextSizeHeadline">20sp</item> <item name="TextSizeHeadline">20sp</item>

View file

@ -4,6 +4,7 @@
<attr name="TextSizeInfo" format="dimension" /> <attr name="TextSizeInfo" format="dimension" />
<attr name="TextSizeBody" format="dimension" /> <attr name="TextSizeBody" format="dimension" />
<attr name="TextSizeHeadline" format="dimension" /> <attr name="TextSizeHeadline" format="dimension" />
<attr name="TextSeparation" format="dimension"/>
<attr name="IconSize" format="dimension"/> <attr name="IconSize" format="dimension"/>

View file

@ -8,6 +8,7 @@
<item name="TextSizeInfo">12sp</item> <item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item> <item name="TextSizeBody">14sp</item>
<item name="TextSizeHeadline">20sp</item> <item name="TextSizeHeadline">20sp</item>
<item name="TextSeparation">5sp</item>
<item name="IconSize">18sp</item> <item name="IconSize">18sp</item>
<item name="attr/color_text_primary">@color/black87</item> <item name="attr/color_text_primary">@color/black87</item>
@ -81,6 +82,7 @@
<item name="android:actionBarTabStyle">@style/ConversationsActionBarTabs</item> <item name="android:actionBarTabStyle">@style/ConversationsActionBarTabs</item>
<item name="TextSizeInfo">12sp</item> <item name="TextSizeInfo">12sp</item>
<item name="TextSizeBody">14sp</item> <item name="TextSizeBody">14sp</item>
<item name="TextSeparation">5sp</item>
<item name="IconSize">18sp</item> <item name="IconSize">18sp</item>
<item name="TextSizeHeadline">20sp</item> <item name="TextSizeHeadline">20sp</item>
@ -152,6 +154,7 @@
<style name="ConversationsTheme.LargerText" parent="ConversationsTheme"> <style name="ConversationsTheme.LargerText" parent="ConversationsTheme">
<item name="TextSizeInfo">14sp</item> <item name="TextSizeInfo">14sp</item>
<item name="TextSizeBody">16sp</item> <item name="TextSizeBody">16sp</item>
<item name="TextSeparation">6sp</item>
<item name="IconSize">20sp</item> <item name="IconSize">20sp</item>
<item name="TextSizeHeadline">22sp</item> <item name="TextSizeHeadline">22sp</item>
</style> </style>
@ -160,6 +163,7 @@
<item name="TextSizeInfo">14sp</item> <item name="TextSizeInfo">14sp</item>
<item name="TextSizeBody">16sp</item> <item name="TextSizeBody">16sp</item>
<item name="IconSize">20sp</item> <item name="IconSize">20sp</item>
<item name="TextSeparation">6sp</item>
<item name="TextSizeHeadline">22sp</item> <item name="TextSizeHeadline">22sp</item>
</style> </style>