Adds displayMode to RoomSummaryListController
This commit is contained in:
parent
7cc79fef0f
commit
a355b625e9
|
@ -337,7 +337,7 @@ class RoomListFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
else -> {
|
||||
pagedControllerFactory.createRoomSummaryListController()
|
||||
pagedControllerFactory.createRoomSummaryListController(roomListParams.displayMode)
|
||||
.also { controller ->
|
||||
section.liveList?.observe(viewLifecycleOwner) { list ->
|
||||
controller.setData(list)
|
||||
|
|
|
@ -20,14 +20,15 @@ import im.vector.app.features.home.RoomListDisplayMode
|
|||
import org.matrix.android.sdk.api.session.room.model.RoomSummary
|
||||
|
||||
class RoomSummaryListController(
|
||||
private val roomSummaryItemFactory: RoomSummaryItemFactory
|
||||
private val roomSummaryItemFactory: RoomSummaryItemFactory,
|
||||
private val displayMode: RoomListDisplayMode
|
||||
) : CollapsableTypedEpoxyController<List<RoomSummary>>() {
|
||||
|
||||
var listener: RoomListListener? = null
|
||||
|
||||
override fun buildModels(data: List<RoomSummary>?) {
|
||||
data?.forEach {
|
||||
add(roomSummaryItemFactory.create(it, emptyMap(), emptySet(), RoomListDisplayMode.ROOMS /* TODO: change */, listener))
|
||||
add(roomSummaryItemFactory.create(it, emptyMap(), emptySet(), displayMode, listener))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ class RoomSummaryPagedControllerFactory @Inject constructor(
|
|||
return RoomSummaryPagedController(roomSummaryItemFactory, displayMode)
|
||||
}
|
||||
|
||||
fun createRoomSummaryListController(): RoomSummaryListController {
|
||||
return RoomSummaryListController(roomSummaryItemFactory)
|
||||
fun createRoomSummaryListController(displayMode: RoomListDisplayMode): RoomSummaryListController {
|
||||
return RoomSummaryListController(roomSummaryItemFactory, displayMode)
|
||||
}
|
||||
|
||||
fun createSuggestedRoomListController(): SuggestedRoomListController {
|
||||
|
|
Loading…
Reference in New Issue