Fix condition for equality check of search queries
This commit is contained in:
parent
ad47daaadc
commit
2291ed1b7c
1 changed files with 8 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue