From aee794142ede68faabc6544ad1beb57579592ec6 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 18 Mar 2021 09:23:08 +0100 Subject: [PATCH 1/8] use chip view for pill-style unread messages counter Signed-off-by: Andy Scherzinger --- .../ConversationPresenter.kt | 6 +- ...rv_item_conversation_with_last_message.xml | 93 +++++++++---------- 2 files changed, 47 insertions(+), 52 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt b/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt index f8c2685fb..42b9490b0 100644 --- a/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt +++ b/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt @@ -81,11 +81,9 @@ open class ConversationPresenter(context: Context, onElementClick: ((Page, Holde } if (conversation.unreadMention || conversation.type == Conversation.ConversationType.ONE_TO_ONE_CONVERSATION) { - holder.itemView.dialogUnreadBubble!!.background = - context.getDrawable(R.drawable.bubble_circle_unread_mention) + holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.colorPrimary) } else { - holder.itemView.dialogUnreadBubble!!.background = - context.getDrawable(R.drawable.bubble_circle_unread) + holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.grey_600) } } else { holder.itemView.dialogUnreadBubble!!.visibility = View.GONE diff --git a/app/src/main/res/layout/rv_item_conversation_with_last_message.xml b/app/src/main/res/layout/rv_item_conversation_with_last_message.xml index 131d7f0a9..cd22a36b5 100644 --- a/app/src/main/res/layout/rv_item_conversation_with_last_message.xml +++ b/app/src/main/res/layout/rv_item_conversation_with_last_message.xml @@ -3,6 +3,8 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Andy Scherzinger + ~ Copyright (C) 2021 Andy Scherzinger ~ Copyright (C) 2017-2018 Mario Danic ~ ~ This program is free software: you can redistribute it and/or modify @@ -17,27 +19,27 @@ ~ ~ You should have received a copy of the GNU General Public License ~ along with this program. If not, see . - ~ --> + android:layout_marginEnd="@dimen/double_margin_between_elements"> @@ -59,54 +61,50 @@ - + - - - - + - + android:textColor="@color/conversation_date" + tools:text="@string/nc_date_header_yesterday" /> + android:visibility="gone" /> Date: Mon, 22 Mar 2021 11:45:58 +0100 Subject: [PATCH 2/8] re-layout conversation list item layout - unread conversation display - harmonize font-sizes - re-enlarge avatar to 48dp - make unread-bubble bold - use grey tones for text/headline Signed-off-by: Andy Scherzinger --- .../ConversationPresenter.kt | 25 ++- ...rv_item_conversation_with_last_message.xml | 144 +++++++++--------- app/src/main/res/layout/search_layout.xml | 6 +- app/src/main/res/values-night/colors.xml | 16 +- app/src/main/res/values/colors.xml | 8 +- app/src/main/res/values/strings.xml | 2 +- app/src/main/res/values/styles.xml | 5 + 7 files changed, 123 insertions(+), 83 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt b/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt index 42b9490b0..85adbaee7 100644 --- a/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt +++ b/app/src/main/java/com/nextcloud/talk/newarch/features/conversationsList/ConversationPresenter.kt @@ -23,11 +23,14 @@ package com.nextcloud.talk.newarch.features.conversationsList import android.content.Context +import android.graphics.Color +import android.graphics.Typeface import android.graphics.drawable.Drawable import android.text.TextUtils import android.text.format.DateUtils import android.view.View import android.view.ViewGroup +import androidx.core.content.ContextCompat import androidx.core.view.isVisible import coil.api.load import coil.transform.CircleCropTransformation @@ -73,17 +76,33 @@ open class ConversationPresenter(context: Context, onElementClick: ((Page, Holde if (conversation.unreadMessages > 0) { holder.itemView.dialogUnreadBubble!!.visibility = View.VISIBLE - if (conversation.unreadMessages < 100) { + holder.itemView.dialogName.setTypeface( + holder.itemView.dialogName.getTypeface(), + Typeface.BOLD + ) + holder.itemView.dialogDate.setTypeface( + holder.itemView.dialogDate.getTypeface(), + Typeface.BOLD + ) + holder.itemView.dialogLastMessage.setTypeface( + holder.itemView.dialogLastMessage.getTypeface(), + Typeface.BOLD + ) + if (conversation.unreadMessages < 1000) { holder.itemView.dialogUnreadBubble!!.text = conversation.unreadMessages.toLong() .toString() } else { - holder.itemView.dialogUnreadBubble!!.text = context.getString(R.string.nc_99_plus) + holder.itemView.dialogUnreadBubble!!.text = context.getString(R.string.nc_999_plus) } if (conversation.unreadMention || conversation.type == Conversation.ConversationType.ONE_TO_ONE_CONVERSATION) { holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.colorPrimary) + holder.itemView.dialogUnreadBubble!!.setTextColor(Color.WHITE) } else { - holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.grey_600) + holder.itemView.dialogUnreadBubble!!.setChipBackgroundColorResource(R.color.conversation_unread_bubble) + holder.itemView.dialogUnreadBubble!!.setTextColor( + ContextCompat.getColor(context, R.color.conversation_unread_bubble_text) + ) } } else { holder.itemView.dialogUnreadBubble!!.visibility = View.GONE diff --git a/app/src/main/res/layout/rv_item_conversation_with_last_message.xml b/app/src/main/res/layout/rv_item_conversation_with_last_message.xml index cd22a36b5..08b6206a2 100644 --- a/app/src/main/res/layout/rv_item_conversation_with_last_message.xml +++ b/app/src/main/res/layout/rv_item_conversation_with_last_message.xml @@ -22,51 +22,54 @@ --> + android:layout_height="72dp" + android:animateLayoutChanges="true" + android:paddingTop="@dimen/margin_between_elements" + android:paddingBottom="@dimen/margin_between_elements" + android:paddingLeft="@dimen/double_margin_between_elements" + android:paddingRight="@dimen/double_margin_between_elements"> - + - + - + - + - + @@ -82,52 +86,56 @@ style="@style/Widget.MaterialComponents.Chip.Choice" android:layout_width="wrap_content" android:layout_height="18dp" + android:layout_below="@+id/dialogName" android:layout_alignParentEnd="true" - android:layout_alignParentBottom="true" android:layout_marginStart="8dp" + android:layout_marginTop="10dp" android:gravity="top" android:lines="1" - android:textColor="@color/conversation_unread_bubble" + android:textAppearance="@style/ChipUnreadMessagesTextAppearance" + android:textColor="@color/conversation_unread_bubble_text" + app:chipBackgroundColor="@color/conversation_unread_bubble" app:chipEndPadding="-1dp" app:chipMinTouchTargetSize="0dp" app:chipStartPadding="-3dp" app:ensureMinTouchTargetSize="false" tools:text="99+" /> - + - + - + diff --git a/app/src/main/res/layout/search_layout.xml b/app/src/main/res/layout/search_layout.xml index f970e3766..b83070d40 100644 --- a/app/src/main/res/layout/search_layout.xml +++ b/app/src/main/res/layout/search_layout.xml @@ -26,12 +26,12 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - + \ No newline at end of file diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 4c7f0c6e6..e7b0eb185 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -29,15 +29,19 @@ #006AA3 #007CC2 - #9FBDCC - + #1E1E1E - #222222 - #222222 + + #E3E3E3 + #373737 + #D8D8D8 + + #121212 + #121212 @color/grey950 #FFFFFF - #222222 + #121212 @color/fg_default @@ -46,7 +50,7 @@ #0083C9 #6F6F6F @android:color/holo_purple - #222222 + #121212 #EFEFEF #484848 #003F62 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 6f5c60e79..5184312da 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -27,16 +27,20 @@ #006AA3 #007CC2 + @android:color/white + #A5A5A5 + #FFFFFF #37505D - #37505D + #333333 @color/warm_grey_two @color/warm_grey_four - #FFFFFF + #DBDBDB + #222222 #C98879 #37505D diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c2be87d9e..56e6682b4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -337,7 +337,7 @@ You need to promote a new moderator before you can leave %1$s. - 99+ + 999+ Copy Reply diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index c2c1fb076..9fac1f550 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -51,6 +51,11 @@ @color/colorAccent + +