From 3d57cb880cfd180f7dc91328b05ab8e5b3a4ce60 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Fri, 4 Mar 2022 11:57:58 +0100 Subject: [PATCH] Unread line: follow unread counter color Change-Id: Ia3cd51364517276cfc438fe0f7700d11de7ff00a --- .../app/features/home/room/list/RoomSummaryItem.kt | 9 +++++++++ vector/src/main/res/layout/item_room.xml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt index 1da348c596..4ae13878ee 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItem.kt @@ -78,6 +78,15 @@ abstract class RoomSummaryItem : VectorEpoxyModel() { holder.lastEventView.text = lastFormattedEvent.charSequence holder.unreadCounterBadgeView.render(UnreadCounterBadgeView.State(unreadNotificationCount, showHighlighted, unreadCount ?: 0, markedUnread)) holder.unreadIndentIndicator.isVisible = hasUnreadMessage + // Mirror unreadCounterBadgeView colors + holder.unreadIndentIndicator.setBackgroundColor( + when { + showHighlighted -> ThemeUtils.getColor(holder.unreadIndentIndicator.context, R.attr.colorError) + unreadNotificationCount > 0 || markedUnread -> ThemeUtils.getColor(holder.unreadIndentIndicator.context, R.attr.colorAccent) + hasUnreadMessage -> ThemeUtils.getColor(holder.unreadIndentIndicator.context, R.attr.vctr_content_tertiary) // same color as unread counter bg would be hard to spot + else -> 0 + } + ) holder.draftView.isVisible = hasDraft avatarRenderer.render(matrixItem, holder.avatarImageView) holder.roomAvatarDecorationImageView.render(encryptionTrustLevel) diff --git a/vector/src/main/res/layout/item_room.xml b/vector/src/main/res/layout/item_room.xml index 06aa49363c..922e8cfba5 100644 --- a/vector/src/main/res/layout/item_room.xml +++ b/vector/src/main/res/layout/item_room.xml @@ -15,7 +15,7 @@ android:id="@+id/roomUnreadIndicator" android:layout_width="4dp" android:layout_height="0dp" - android:background="?vctr_content_secondary" + tools:background="?colorAccent" android:visibility="gone" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"