From 334922786815e5a64d843066a7b8c99f69104722 Mon Sep 17 00:00:00 2001 From: inorichi Date: Wed, 30 Sep 2015 21:11:16 +0200 Subject: [PATCH] Observing filter changes shouldn't be needed --- .../mangafeed/presenter/LibraryPresenter.java | 15 +-------------- .../mangafeed/ui/fragment/LibraryFragment.java | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java b/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java index 67579e3df5..af8d80d342 100644 --- a/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java +++ b/app/src/main/java/eu/kanade/mangafeed/presenter/LibraryPresenter.java @@ -30,9 +30,6 @@ public class LibraryPresenter extends BasePresenter { @Inject PreferencesHelper prefs; - private Subscription searchViewSubscription; - private PublishSubject> searchViewPublishSubject; - public LibraryPresenter(LibraryView view) { this.view = view; App.getComponent(view.getActivity()).inject(this); @@ -54,14 +51,6 @@ public class LibraryPresenter extends BasePresenter { view.getActivity().startActivity(intent); } - public void initializeSearch() { - searchViewPublishSubject = PublishSubject.create(); - searchViewSubscription = Observable.switchOnNext(searchViewPublishSubject) - .subscribeOn(Schedulers.io()) - .observeOn(AndroidSchedulers.mainThread()) - .subscribe(view.getAdapter().getFilter()::filter); - } - public void initializeMangas() { db.manga.get() .observeOn(mainThread()) @@ -69,9 +58,7 @@ public class LibraryPresenter extends BasePresenter { } public void onQueryTextChange(String query) { - if (searchViewPublishSubject != null) { - searchViewPublishSubject.onNext(Observable.just(query)); - } + view.getAdapter().getFilter().filter(query); } } diff --git a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java b/app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java index ed131ba996..59b21aecb3 100644 --- a/app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java +++ b/app/src/main/java/eu/kanade/mangafeed/ui/fragment/LibraryFragment.java @@ -65,7 +65,6 @@ public class LibraryFragment extends BaseFragment implements LibraryView { setupToolbar(); setMangaClickListener(); presenter.initializeMangas(); - presenter.initializeSearch(); } @Override