From 30c6518630ff889056443e91e94d4b553ca6381c Mon Sep 17 00:00:00 2001 From: Maxime Naturel <maxime.naturel@niji.fr> Date: Wed, 9 Feb 2022 11:16:37 +0100 Subject: [PATCH] Updating remaining category item --- .../vector/app/features/home/room/list/RoomCategoryItem.kt | 7 +++++-- .../im/vector/app/features/home/room/list/RoomsSection.kt | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt index 31129139bf..e9def535db 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomCategoryItem.kt @@ -40,21 +40,24 @@ abstract class RoomCategoryItem : VectorEpoxyModel<RoomCategoryItem.Holder>() { override fun bind(holder: Holder) { super.bind(holder) - // TODO do we need to update the binding? do not understand how it is used in the app val tintColor = ThemeUtils.getColor(holder.rootView.context, R.attr.vctr_content_secondary) val expandedArrowDrawableRes = if (expanded) R.drawable.ic_expand_more else R.drawable.ic_expand_less val expandedArrowDrawable = ContextCompat.getDrawable(holder.rootView.context, expandedArrowDrawableRes)?.also { DrawableCompat.setTint(it, tintColor) } holder.unreadCounterBadgeView.render(UnreadCounterBadgeView.State(unreadNotificationCount, showHighlighted)) - holder.titleView.setCompoundDrawablesWithIntrinsicBounds(null, null, expandedArrowDrawable, null) holder.titleView.text = title + with(holder.counterView) { + text = "" + setCompoundDrawablesWithIntrinsicBounds(null, null, expandedArrowDrawable, null) + } holder.rootView.onClick(listener) } class Holder : VectorEpoxyHolder() { val unreadCounterBadgeView by bind<UnreadCounterBadgeView>(R.id.roomCategoryUnreadCounterBadgeView) val titleView by bind<TextView>(R.id.roomCategoryTitleView) + val counterView by bind<TextView>(R.id.roomCategoryCounterView) val rootView by bind<ViewGroup>(R.id.roomCategoryRootView) } } diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomsSection.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomsSection.kt index b504c2b515..357df5ecd3 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomsSection.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomsSection.kt @@ -27,7 +27,6 @@ data class RoomsSection( val sectionName: String, // can be a paged list or a regular list val livePages: LiveData<PagedList<RoomSummary>>? = null, - // TODO liveList is not used : can we delete this livedata? val liveList: LiveData<List<RoomSummary>>? = null, val liveSuggested: LiveData<SuggestedRoomInfo>? = null, val isExpanded: MutableLiveData<Boolean> = MutableLiveData(true),