mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
Inject RoomListNameFilter
This commit is contained in:
parent
21ba72e5e7
commit
fe88aaffbd
3 changed files with 4 additions and 8 deletions
|
@ -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 a new issue