mirror of https://github.com/M66B/FairEmail.git
Fixed search interaction
This commit is contained in:
parent
438d90aadf
commit
43dc9b9ff9
|
@ -233,18 +233,10 @@ public class FragmentAnswers extends FragmentBase {
|
||||||
searchView.setQuery(searching, true);
|
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() {
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
if (getView() != null) {
|
if (getView() != null && menuSearch.isActionViewExpanded()) {
|
||||||
searching = newText;
|
searching = newText;
|
||||||
adapter.search(newText);
|
adapter.search(newText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,18 +211,10 @@ public class FragmentContacts extends FragmentBase {
|
||||||
searchView.setQuery(searching, true);
|
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() {
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
if (getView() != null) {
|
if (getView() != null && menuSearch.isActionViewExpanded()) {
|
||||||
searching = newText;
|
searching = newText;
|
||||||
adapter.search(newText);
|
adapter.search(newText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -611,18 +611,10 @@ public class FragmentFolders extends FragmentBase {
|
||||||
searchView.setQuery(searching, true);
|
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() {
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
if (getView() != null) {
|
if (getView() != null && menuSearch.isActionViewExpanded()) {
|
||||||
searching = newText;
|
searching = newText;
|
||||||
adapter.search(newText);
|
adapter.search(newText);
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,18 +228,10 @@ public class FragmentRules extends FragmentBase {
|
||||||
searchView.setQuery(searching, true);
|
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() {
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
if (getView() != null) {
|
if (getView() != null && menuSearch.isActionViewExpanded()) {
|
||||||
searching = newText;
|
searching = newText;
|
||||||
adapter.search(newText);
|
adapter.search(newText);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue