From fe88aaffbdc7843bef98b1629be47baf371e40a4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 11:39:13 +0200 Subject: [PATCH] Inject RoomListNameFilter --- .../riotx/features/home/HomeRoomListObservableStore.kt | 4 ---- .../riotx/features/home/room/list/RoomListNameFilter.kt | 3 ++- .../riotx/features/home/room/list/RoomSummaryController.kt | 5 ++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt index 4e0b5b70ed..df8cd411bb 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt @@ -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 diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt index e9dd9813b4..7bb5c305aa 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt @@ -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 { +class RoomListNameFilter @Inject constructor() : Predicate { var filter: String = "" diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt index c439ea20bf..03bedbc7b5 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt @@ -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() { var listener: Listener? = null - private val roomListNameFilter = RoomListNameFilter() - override fun buildModels(viewState: RoomListViewState) { if (viewState.displayMode == RoomListFragment.DisplayMode.FILTERED) { buildFilteredRooms(viewState)