From ad9d36e58c45a8b4e28e7fca1c24db90586b9902 Mon Sep 17 00:00:00 2001 From: Maxime Naturel Date: Mon, 7 Feb 2022 17:54:13 +0100 Subject: [PATCH] Setting item count text only when > 0 --- .../vector/app/features/home/room/list/SectionHeaderAdapter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt b/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt index c96660942d..b6a3777ded 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/SectionHeaderAdapter.kt @@ -88,7 +88,7 @@ class SectionHeaderAdapter constructor( DrawableCompat.setTint(it, tintColor) } roomCategoryCounterView.setCompoundDrawablesWithIntrinsicBounds(null, null, expandedArrowDrawable, null) - roomCategoryCounterView.text = roomsSectionData.itemCount.toString() + roomCategoryCounterView.text = roomsSectionData.itemCount.takeIf { it > 0 }?.toString().orEmpty() roomCategoryUnreadCounterBadgeView.render(UnreadCounterBadgeView.State(roomsSectionData.notificationCount, roomsSectionData.isHighlighted)) } }