Fix condition for equality check of search queries

This commit is contained in:
Alexander Sytnyk 2018-03-28 19:15:15 +03:00
parent ad47daaadc
commit 2291ed1b7c

View file

@ -75,15 +75,17 @@ public class WikivoyageSearchDialogFragment extends BaseOsmAndDialogFragment imp
@Override
public void afterTextChanged(Editable s) {
String newQuery = s.toString();
if (newQuery.isEmpty()) {
if (!searchQuery.equalsIgnoreCase(newQuery)) {
searchQuery = newQuery;
if (searchQuery.isEmpty()) {
searchHelper.cancelSearch();
switchProgressBarVisibility(false);
adapter.setItems(null);
} else if (!searchQuery.equalsIgnoreCase(newQuery)) {
searchQuery = newQuery;
} else {
searchHelper.search(searchQuery);
}
}
}
});
progressBar = (ProgressBar) toolbar.findViewById(R.id.searchProgressBar);