From 5c854984e4dd4f9ba2f7d1da52e56da3641d0317 Mon Sep 17 00:00:00 2001 From: inorichi Date: Sat, 23 Jan 2016 21:58:36 +0100 Subject: [PATCH] Fix #52 --- .../eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java | 6 +++++- .../kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java index 5dfcd50bb8..fff75b078c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java @@ -73,6 +73,7 @@ public class CatalogueFragment extends BaseRxFragment private Subscription queryDebouncerSubscription; private MenuItem displayMode; + private MenuItem searchItem; public static CatalogueFragment newInstance() { return new CatalogueFragment(); @@ -164,7 +165,7 @@ public class CatalogueFragment extends BaseRxFragment inflater.inflate(R.menu.catalogue_list, menu); // Initialize search menu - MenuItem searchItem = menu.findItem(R.id.action_search); + searchItem = menu.findItem(R.id.action_search); final SearchView searchView = (SearchView) searchItem.getActionView(); if (!TextUtils.isEmpty(query)) { @@ -217,6 +218,9 @@ public class CatalogueFragment extends BaseRxFragment @Override public void onDestroyView() { + if (searchItem != null && searchItem.isActionViewExpanded()) { + searchItem.collapseActionView(); + } toolbar.removeView(spinner); super.onDestroyView(); } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.java b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.java index a955b78492..0258f2a40d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.java +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.java @@ -97,7 +97,7 @@ public class MangaInfoPresenter extends BasePresenter { }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) - .doOnCompleted(this::refreshManga); + .doOnNext(manga -> refreshManga()); } public void toggleFavorite() {