From adac29d756e2e02d82dc7366d219206cf58f2fec Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Thu, 25 Mar 2021 22:33:29 +0100 Subject: [PATCH 1/8] improve conversation list layout and dark-theme-colors Signed-off-by: Andy Scherzinger --- .../talk/adapters/items/ConversationItem.java | 32 ++++++++++--- ...rv_item_conversation_with_last_message.xml | 47 ++++++++++++------- app/src/main/res/values-night/colors.xml | 17 ++++--- app/src/main/res/values/colors.xml | 7 ++- app/src/main/res/values/strings.xml | 3 ++ app/src/main/res/values/styles.xml | 8 ++++ 6 files changed, 82 insertions(+), 32 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java index 822dc8852..32c3d1ac1 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.java @@ -2,6 +2,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 @@ -21,6 +23,8 @@ package com.nextcloud.talk.adapters.items; import android.content.Context; +import android.graphics.Color; +import android.graphics.Typeface; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; @@ -30,14 +34,15 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; +import androidx.core.content.ContextCompat; import androidx.emoji.widget.EmojiTextView; import butterknife.BindView; import butterknife.ButterKnife; -import com.amulyakhare.textdrawable.TextDrawable; import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.drawee.interfaces.DraweeController; import com.facebook.drawee.view.SimpleDraweeView; +import com.google.android.material.chip.Chip; import com.nextcloud.talk.R; import com.nextcloud.talk.application.NextcloudTalkApplication; import com.nextcloud.talk.models.database.UserEntity; @@ -113,17 +118,32 @@ public class ConversationItem extends AbstractFlexibleItem 0) { + holder.dialogName.setTypeface( + holder.dialogName.getTypeface(), + Typeface.BOLD + ); + holder.dialogDate.setTypeface( + holder.dialogDate.getTypeface(), + Typeface.BOLD + ); + holder.dialogLastMessage.setTypeface( + holder.dialogLastMessage.getTypeface(), + Typeface.BOLD + ); holder.dialogUnreadBubble.setVisibility(View.VISIBLE); - if (conversation.getUnreadMessages() < 100) { + if (conversation.getUnreadMessages() < 1000) { holder.dialogUnreadBubble.setText(Long.toString(conversation.getUnreadMessages())); } else { - holder.dialogUnreadBubble.setText("99+"); + holder.dialogUnreadBubble.setText(R.string.tooManyUnreadMessages); } if (conversation.isUnreadMention() || conversation.type == Conversation.ConversationType.ROOM_TYPE_ONE_TO_ONE_CALL) { - holder.dialogUnreadBubble.setBackground(context.getDrawable(R.drawable.bubble_circle_unread_mention)); + holder.dialogUnreadBubble.setChipBackgroundColorResource(R.color.colorPrimary); + holder.dialogUnreadBubble.setTextColor(Color.WHITE); } else { - holder.dialogUnreadBubble.setBackground(context.getDrawable(R.drawable.bubble_circle_unread)); + holder.dialogUnreadBubble.setChipBackgroundColorResource(R.color.conversation_unread_bubble); + holder.dialogUnreadBubble.setTextColor( + ContextCompat.getColor(context, R.color.conversation_unread_bubble_text)); } } else { holder.dialogUnreadBubble.setVisibility(View.GONE); @@ -254,7 +274,7 @@ public class ConversationItem extends AbstractFlexibleItem ~ Copyright (C) 2017-2018 Mario Danic ~ ~ This program is free software: you can redistribute it and/or modify @@ -46,17 +48,19 @@ + android:src="@drawable/ic_star_black_24dp" + app:tint="@color/favorite_icon_tint" + app:tintMode="src_in"/> @@ -64,7 +68,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/dialogName" - android:layout_marginTop="8dp" + android:layout_marginTop="6dp" android:layout_toEndOf="@id/dialogAvatarFrameLayout"> - + 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="999+" /> @@ -103,9 +110,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" + android:layout_marginTop="2dp" android:ellipsize="end" android:maxLines="1" - android:textColor="@color/textColorMaxContrast" /> + android:textSize="14sp" + android:textColor="@color/textColorMaxContrast" + tools:text="yesterday"/> + ~ @author Andy Scherzinger ~ @author Daniel Bailey + ~ @author Mario Danic + ~ Copyright (C) 2021 Andy Scherzinger ~ Copyright (C) 2019 Daniel Bailey + ~ Copyright (C) 2017-2019 Mario Danic ~ ~ This program is free software: you can redistribute it and/or modify ~ it under the terms of the GNU General Public License as published by @@ -22,16 +24,19 @@ --> - #ffffff + #deffffff - #222222 - #222222 + #121212 + #121212 #00AA00 + #373737 + #D8D8D8 + #D8D8D8 @android:color/holo_purple - #222222 + #121212 #484848 #66484848 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index a7ce271d9..c674ac8af 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,6 +3,8 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Andy Scherzinger + ~ Copyright (C) 2021 Andy Scherzinger ~ Copyright (C) 2017-2019 Mario Danic ~ ~ This program is free software: you can redistribute it and/or modify @@ -30,7 +32,8 @@ #000000 - #FFFFFF + #DBDBDB + #222222 #D32F2F #006400 @@ -59,5 +62,5 @@ #46ffffff #BF999999 - + #FFCC00 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0ab52c40d..0228a95f1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,6 +2,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 @@ -356,4 +358,5 @@ M3.27,4.27L19.74,20.74 + 999+ diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index e40d24ebe..f27cfa3ed 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -2,6 +2,8 @@ ~ Nextcloud Talk application ~ ~ @author Mario Danic + ~ @author Andy Scherzinger + ~ Copyright (C) 2021 Andy Scherzinger ~ Copyright (C) 2017-2019 Mario Danic ~ ~ This program is free software: you can redistribute it and/or modify @@ -26,6 +28,7 @@ @color/colorPrimary @color/colorPrimary @color/colorPrimary + @color/bg_default @color/colorPrimary @color/nc_outcoming_text_default @color/nc_incoming_text_default @@ -55,6 +58,11 @@ @color/colorPrimary + +