Adds displayMode to RoomSummaryListController
This commit is contained in:
parent
7cc79fef0f
commit
a355b625e9
|
@ -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)
|
||||||
|
|
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue