This commit is contained in:
inorichi 2016-01-23 21:58:36 +01:00
parent 6c844cfd9c
commit 5c854984e4
2 changed files with 6 additions and 2 deletions

View File

@ -73,6 +73,7 @@ public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
private Subscription queryDebouncerSubscription; private Subscription queryDebouncerSubscription;
private MenuItem displayMode; private MenuItem displayMode;
private MenuItem searchItem;
public static CatalogueFragment newInstance() { public static CatalogueFragment newInstance() {
return new CatalogueFragment(); return new CatalogueFragment();
@ -164,7 +165,7 @@ public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
inflater.inflate(R.menu.catalogue_list, menu); inflater.inflate(R.menu.catalogue_list, menu);
// Initialize search 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(); final SearchView searchView = (SearchView) searchItem.getActionView();
if (!TextUtils.isEmpty(query)) { if (!TextUtils.isEmpty(query)) {
@ -217,6 +218,9 @@ public class CatalogueFragment extends BaseRxFragment<CataloguePresenter>
@Override @Override
public void onDestroyView() { public void onDestroyView() {
if (searchItem != null && searchItem.isActionViewExpanded()) {
searchItem.collapseActionView();
}
toolbar.removeView(spinner); toolbar.removeView(spinner);
super.onDestroyView(); super.onDestroyView();
} }

View File

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