Adds displayMode to RoomSummaryListController

This commit is contained in:
ericdecanini 2022-04-29 13:05:08 +02:00
parent 7cc79fef0f
commit a355b625e9
3 changed files with 6 additions and 5 deletions

View File

@ -337,7 +337,7 @@ class RoomListFragment @Inject constructor(
} }
} }
else -> { else -> {
pagedControllerFactory.createRoomSummaryListController() pagedControllerFactory.createRoomSummaryListController(roomListParams.displayMode)
.also { controller -> .also { controller ->
section.liveList?.observe(viewLifecycleOwner) { list -> section.liveList?.observe(viewLifecycleOwner) { list ->
controller.setData(list) controller.setData(list)

View File

@ -20,14 +20,15 @@ import im.vector.app.features.home.RoomListDisplayMode
import org.matrix.android.sdk.api.session.room.model.RoomSummary import org.matrix.android.sdk.api.session.room.model.RoomSummary
class RoomSummaryListController( class RoomSummaryListController(
private val roomSummaryItemFactory: RoomSummaryItemFactory private val roomSummaryItemFactory: RoomSummaryItemFactory,
private val displayMode: RoomListDisplayMode
) : CollapsableTypedEpoxyController<List<RoomSummary>>() { ) : CollapsableTypedEpoxyController<List<RoomSummary>>() {
var listener: RoomListListener? = null var listener: RoomListListener? = null
override fun buildModels(data: List<RoomSummary>?) { override fun buildModels(data: List<RoomSummary>?) {
data?.forEach { data?.forEach {
add(roomSummaryItemFactory.create(it, emptyMap(), emptySet(), RoomListDisplayMode.ROOMS /* TODO: change */, listener)) add(roomSummaryItemFactory.create(it, emptyMap(), emptySet(), displayMode, listener))
} }
} }
} }

View File

@ -27,8 +27,8 @@ class RoomSummaryPagedControllerFactory @Inject constructor(
return RoomSummaryPagedController(roomSummaryItemFactory, displayMode) return RoomSummaryPagedController(roomSummaryItemFactory, displayMode)
} }
fun createRoomSummaryListController(): RoomSummaryListController { fun createRoomSummaryListController(displayMode: RoomListDisplayMode): RoomSummaryListController {
return RoomSummaryListController(roomSummaryItemFactory) return RoomSummaryListController(roomSummaryItemFactory, displayMode)
} }
fun createSuggestedRoomListController(): SuggestedRoomListController { fun createSuggestedRoomListController(): SuggestedRoomListController {