inorichi 9 years ago
parent
commit
5c854984e4

+ 5 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueFragment.java

@@ -73,6 +73,7 @@ public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
     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<CataloguePresenter>
         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<CataloguePresenter>
 
     @Override
     public void onDestroyView() {
+        if (searchItem != null && searchItem.isActionViewExpanded()) {
+            searchItem.collapseActionView();
+        }
         toolbar.removeView(spinner);
         super.onDestroyView();
     }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.java

@@ -97,7 +97,7 @@ public class MangaInfoPresenter extends BasePresenter<MangaInfoFragment> {
                 })
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
-                .doOnCompleted(this::refreshManga);
+                .doOnNext(manga -> refreshManga());
     }
 
     public void toggleFavorite() {