From 386ed3f368fc7331f0831a5e9e12e22e315bd726 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 24 Oct 2018 14:45:22 +0200 Subject: [PATCH] Improved chat rooms list UI --- res/drawable-xhdpi/chat_list_indicator.png | Bin 840 -> 0 bytes res/drawable-xhdpi/history_chat_indicator.png | Bin 801 -> 0 bytes res/drawable/unread_message_count_bg.xml | 5 +++++ res/layout-land/call.xml | 6 +++--- res/layout-land/chatlist_cell.xml | 6 +++--- res/layout-land/main.xml | 12 ++++++------ res/layout-sw533dp-land/call.xml | 6 +++--- res/layout-sw533dp-land/chatlist_cell.xml | 6 +++--- res/layout-sw533dp-land/main.xml | 12 ++++++------ res/layout-sw533dp/chatlist_cell.xml | 6 +++--- res/layout-sw533dp/main.xml | 12 ++++++------ res/layout/call.xml | 6 +++--- res/layout/chat.xml | 2 +- res/layout/chatlist_cell.xml | 17 +++++------------ res/layout/main.xml | 12 ++++++------ .../org/linphone/chat/ChatRoomViewHolder.java | 8 ++------ 16 files changed, 55 insertions(+), 61 deletions(-) delete mode 100644 res/drawable-xhdpi/chat_list_indicator.png delete mode 100644 res/drawable-xhdpi/history_chat_indicator.png create mode 100644 res/drawable/unread_message_count_bg.xml diff --git a/res/drawable-xhdpi/chat_list_indicator.png b/res/drawable-xhdpi/chat_list_indicator.png deleted file mode 100644 index 6c3e099bdf62fb06911e8b9608459a7a172f887d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 840 zcmV-O1GoH%P)l`Ty0AhOL=;5)3lu>F1vf6Fg1B*41Q)J!p&%++>#Ieq z7Hy=dBs6VYO}wvU=;WYycc~2 zrU;lV0*(T=fiFO|OpO3{fo`D1&!8b-uUu@p0?6PO)2{V46O7- zGRBguO9Nn~Go=7G0^c=)9tUD}Nc*{V8fZWtn-84--v^o`0Aw{&252p`(#L@X=w~&+ zNqeMLZwyLnM@Jh67Kz>fe{bxw7d5q^tXd{_Z|Y4Y7U*0lWD>NRvG{d5CJwQ z_uhgzwpBs58wB01pxX?BZd1@PgP>yyI%*JfR6$1!f{p-|14=HUN|8*BhHjt!kxz0M89rl(ZE4T1m1!oUX&S9t{6Lk!E7j9=Dpm9G^ms%ogt zK%858M~M@Ln>0#R%9=5|ssV6sx%(gtJPI)I3o3j98v}*|2%G@c%_j1#C0OGaNno=R zA-{uQOemy*{Z5{B>&gAM!p|`!tt-XX7Z+D71}ZJ?x=>t+ zA~qH+Rur)a#cKVNIO)uF5hrPyNz62v5K{5O!KJBn%qyc2rc`2ARq>VGnMahxtEYpH8pF z0b>gWnRZyE?qzJWa2i(kSPb}h-jJ#65%i$j!mEzGM(mA>TFa1$P__@dwO=19c{mRG zquF9HV_4bqiv$RFIqQw|xMg#OOxx|k(-v2E`dwdYlHF+!(l&Pphi7%Uol15`zZYkO zOq+G-bW~Vv=~R{65dDrdPxo@qE-@fnj8~dEnYOx8;RHJ6pu&C8>%FN?7ItO>INm{@ zoZ@8KtV5R{aFu+Nl&pz^PK-NwiFKI)jvF}Up~-aDY>=Z0_e?^Dby-3tx13uz*U3}e zX@@HskSpY>niWOb=^}Jx3t8wcRCUN%b)_PDjpA&!kl{?@pFEXux=%GAzsVHwAAdD= zoaD<)Q#~9NwPNCqk!LeMJlV`g9l_rjI{D57WK{f#w=zTg(KS9f|75;@{3e@?i!U|i zM-!0I=L@`>3F1l1^fbTYgk2cTpkSVe1Cuo}1u_o#4lgV*;s^S@KKpQB#B(^ZM1VgV zQ;zd$V;W>s)YLpEe7?wlzpA-AUh~VG#w;=DjG9gOYS94e?vFuVH{ZTz>Hq^yD%^(m z+YI=vnp#1 zxfN*ZgZ*u;7aqkHT;4+H2;P+RM8BcdHlGX4)$K}FT8|BqwYV0SVYyJ1oW}Q(; fAN_YmXj%UP#OJtrWK@ip00000NkvXXu0mjfzvg*W diff --git a/res/drawable/unread_message_count_bg.xml b/res/drawable/unread_message_count_bg.xml new file mode 100644 index 000000000..4a3f66cab --- /dev/null +++ b/res/drawable/unread_message_count_bg.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/res/layout-land/call.xml b/res/layout-land/call.xml index 819a85c20..cf5c8c257 100644 --- a/res/layout-land/call.xml +++ b/res/layout-land/call.xml @@ -250,10 +250,10 @@ diff --git a/res/layout-land/chatlist_cell.xml b/res/layout-land/chatlist_cell.xml index a4c106663..01d24c2bc 100644 --- a/res/layout-land/chatlist_cell.xml +++ b/res/layout-land/chatlist_cell.xml @@ -64,9 +64,9 @@ diff --git a/res/layout-sw533dp-land/chatlist_cell.xml b/res/layout-sw533dp-land/chatlist_cell.xml index ec24b492b..2cc25b94a 100644 --- a/res/layout-sw533dp-land/chatlist_cell.xml +++ b/res/layout-sw533dp-land/chatlist_cell.xml @@ -61,9 +61,9 @@ diff --git a/res/layout/chat.xml b/res/layout/chat.xml index 8af20df73..eefe0ceae 100644 --- a/res/layout/chat.xml +++ b/res/layout/chat.xml @@ -195,6 +195,6 @@ android:src="@drawable/security_alert_button" android:layout_alignParentRight="true" android:layout_below="@id/top" - android:layout_marginRight="6dp"/> + android:layout_marginRight="12dp"/> diff --git a/res/layout/chatlist_cell.xml b/res/layout/chatlist_cell.xml index 3620a7fdc..d563b87ba 100644 --- a/res/layout/chatlist_cell.xml +++ b/res/layout/chatlist_cell.xml @@ -64,10 +64,10 @@ - - @@ -187,10 +187,10 @@ diff --git a/src/android/org/linphone/chat/ChatRoomViewHolder.java b/src/android/org/linphone/chat/ChatRoomViewHolder.java index 9273781fa..08116fc45 100644 --- a/src/android/org/linphone/chat/ChatRoomViewHolder.java +++ b/src/android/org/linphone/chat/ChatRoomViewHolder.java @@ -46,7 +46,6 @@ public class ChatRoomViewHolder extends RecyclerView.ViewHolder implements View. private Bitmap mDefaultBitmap; private Bitmap mDefaultGroupBitmap; - public TextView lastMessageSenderView; public TextView lastMessageView; public TextView date; public TextView displayName; @@ -65,7 +64,6 @@ public class ChatRoomViewHolder extends RecyclerView.ViewHolder implements View. mDefaultGroupBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.chat_group_avatar); mContext = context; - lastMessageSenderView = itemView.findViewById(R.id.lastMessageSender); lastMessageView = itemView.findViewById(R.id.lastMessage); date = itemView.findViewById(R.id.date); displayName = itemView.findViewById(R.id.sipUri); @@ -82,24 +80,22 @@ public class ChatRoomViewHolder extends RecyclerView.ViewHolder implements View. public void bindChatRoom(ChatRoom room) { mRoom = room; ChatMessage lastMessage = mRoom.getLastMessageInHistory(); - lastMessageView.setVisibility(View.GONE); lastMessageFileTransfer.setVisibility(View.GONE); if (lastMessage != null) { String text = lastMessage.getTextContent(); if (text != null && text.length() > 0) { - lastMessageView.setVisibility(View.VISIBLE); - lastMessageView.setText(text); + lastMessageView.setText(getSender(mRoom) + text); } date.setText(LinphoneUtils.timestampToHumanDate(mContext, mRoom.getLastUpdateTime(), R.string.messages_list_date_format)); for (Content c : lastMessage.getContents()) { if (c.isFile() || c.isFileTransfer()) { + lastMessageView.setText(getSender(mRoom)); lastMessageFileTransfer.setVisibility(View.VISIBLE); } } } - lastMessageSenderView.setText(getSender(mRoom)); displayName.setText(getContact(mRoom)); unreadMessages.setText(String.valueOf(LinphoneManager.getInstance().getUnreadCountForChatRoom(mRoom))); getAvatar(mRoom);