Fixed search interaction

This commit is contained in:
M66B
2022-05-16 10:23:27 +02:00
parent 438d90aadf
commit 43dc9b9ff9
4 changed files with 4 additions and 36 deletions

View File

@@ -233,18 +233,10 @@ public class FragmentAnswers extends FragmentBase {
searchView.setQuery(searching, true);
}
getViewLifecycleOwner().getLifecycle().addObserver(new LifecycleObserver() {
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY)
public void onDestroyed() {
menuSearch.collapseActionView();
getViewLifecycleOwner().getLifecycle().removeObserver(this);
}
});
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextChange(String newText) {
if (getView() != null) {
if (getView() != null && menuSearch.isActionViewExpanded()) {
searching = newText;
adapter.search(newText);
}