Inject RoomListNameFilter

This commit is contained in:
Benoit Marty 2019-07-18 11:39:13 +02:00
parent 21ba72e5e7
commit fe88aaffbd
3 changed files with 4 additions and 8 deletions

View File

@ -18,10 +18,6 @@ package im.vector.riotx.features.home

import im.vector.matrix.android.api.session.room.model.RoomSummary
import im.vector.riotx.core.utils.RxStore
import im.vector.riotx.features.home.room.list.RoomListDisplayModeFilter
import im.vector.riotx.features.home.room.list.RoomListFragment
import io.reactivex.Observable
import io.reactivex.schedulers.Schedulers
import javax.inject.Inject
import javax.inject.Singleton


View File

@ -18,8 +18,9 @@ package im.vector.riotx.features.home.room.list

import im.vector.matrix.android.api.session.room.model.RoomSummary
import io.reactivex.functions.Predicate
import javax.inject.Inject

class RoomListNameFilter : Predicate<RoomSummary> {
class RoomListNameFilter @Inject constructor() : Predicate<RoomSummary> {

var filter: String = ""


View File

@ -26,13 +26,12 @@ import im.vector.riotx.features.home.room.filtered.filteredRoomFooterItem
import javax.inject.Inject

class RoomSummaryController @Inject constructor(private val stringProvider: StringProvider,
private val roomSummaryItemFactory: RoomSummaryItemFactory
private val roomSummaryItemFactory: RoomSummaryItemFactory,
private val roomListNameFilter: RoomListNameFilter
) : TypedEpoxyController<RoomListViewState>() {

var listener: Listener? = null

private val roomListNameFilter = RoomListNameFilter()

override fun buildModels(viewState: RoomListViewState) {
if (viewState.displayMode == RoomListFragment.DisplayMode.FILTERED) {
buildFilteredRooms(viewState)