forked from GitHub-Mirror/riotX-android
Inject RoomListNameFilter
This commit is contained in:
parent
21ba72e5e7
commit
fe88aaffbd
@ -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
|
||||
|
||||
|
@ -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 = ""
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user