From 43c2b42a82b356863bcf473a73b28a35e1bee0c8 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Fri, 22 Apr 2022 21:33:25 +0200 Subject: [PATCH 1/4] Adds suggested tag in explore rooms --- .../home/room/list/SpaceChildInfoItem.kt | 7 +++++-- .../explore/SpaceDirectoryController.kt | 2 ++ ..._room.xml => item_explore_space_child.xml} | 19 +++++++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) rename vector/src/main/res/layout/{item_suggested_room.xml => item_explore_space_child.xml} (88%) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt b/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt index 99cbd45294..a2cb905f1b 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/SpaceChildInfoItem.kt @@ -40,7 +40,7 @@ import me.gujun.android.span.image import me.gujun.android.span.span import org.matrix.android.sdk.api.util.MatrixItem -@EpoxyModelClass(layout = R.layout.item_suggested_room) +@EpoxyModelClass(layout = R.layout.item_explore_space_child) abstract class SpaceChildInfoItem : VectorEpoxyModel() { @EpoxyAttribute lateinit var avatarRenderer: AvatarRenderer @@ -51,6 +51,7 @@ abstract class SpaceChildInfoItem : VectorEpoxyModel( @EpoxyAttribute var memberCount: Int = 0 @EpoxyAttribute var loading: Boolean = false + @EpoxyAttribute var suggested: Boolean = false @EpoxyAttribute var buttonLabel: String? = null @EpoxyAttribute var errorLabel: String? = null @@ -89,6 +90,7 @@ abstract class SpaceChildInfoItem : VectorEpoxyModel( } } + holder.suggestedTag.visibility = if (suggested) View.VISIBLE else View.GONE holder.joinButton.text = buttonLabel if (loading) { @@ -121,7 +123,8 @@ abstract class SpaceChildInfoItem : VectorEpoxyModel( val titleView by bind(R.id.roomNameView) val joinButton by bind