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,13 +75,15 @@ public class WikivoyageSearchDialogFragment extends BaseOsmAndDialogFragment imp
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
String newQuery = s.toString();
|
String newQuery = s.toString();
|
||||||
if (newQuery.isEmpty()) {
|
if (!searchQuery.equalsIgnoreCase(newQuery)) {
|
||||||
searchHelper.cancelSearch();
|
|
||||||
switchProgressBarVisibility(false);
|
|
||||||
adapter.setItems(null);
|
|
||||||
} else if (!searchQuery.equalsIgnoreCase(newQuery)) {
|
|
||||||
searchQuery = newQuery;
|
searchQuery = newQuery;
|
||||||
searchHelper.search(searchQuery);
|
if (searchQuery.isEmpty()) {
|
||||||
|
searchHelper.cancelSearch();
|
||||||
|
switchProgressBarVisibility(false);
|
||||||
|
adapter.setItems(null);
|
||||||
|
} else {
|
||||||
|
searchHelper.search(searchQuery);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue