Fixed #2200 bug when search queue took space into account.
This commit is contained in:
parent
d41eee60b1
commit
efb58c6369
2 changed files with 6 additions and 5 deletions
|
@ -316,12 +316,13 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
|
||||
private void changeFilter(CharSequence s) {
|
||||
String queue = s.toString().trim();
|
||||
// if (!isNameSearch() ) {
|
||||
amenityAdapter.getFilter().filter(s);
|
||||
amenityAdapter.getFilter().filter(queue);
|
||||
String cfilter = filter == null || filter.getFilterByName() == null ? "" :
|
||||
filter.getFilterByName().toLowerCase();
|
||||
if(!isNameSearch() && !s.toString().toLowerCase().startsWith(cfilter)) {
|
||||
filter.setFilterByName(s.toString());
|
||||
if(!isNameSearch() && !queue.toString().toLowerCase().startsWith(cfilter)) {
|
||||
filter.setFilterByName(queue.toString());
|
||||
runNewSearchQuery(location, SEARCH_AGAIN);
|
||||
}
|
||||
updateButtonState();
|
||||
|
|
|
@ -157,8 +157,8 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
|
|||
filters.add(pf);
|
||||
}
|
||||
}
|
||||
List<AbstractPoiType> res =
|
||||
app.getPoiTypes().getAllTypesTranslatedNames(new CollatorStringMatcher(s, StringMatcherMode.CHECK_STARTS_FROM_SPACE));
|
||||
List<AbstractPoiType> res = app.getPoiTypes().getAllTypesTranslatedNames(
|
||||
new CollatorStringMatcher(s, StringMatcherMode.CHECK_STARTS_FROM_SPACE));
|
||||
final Collator inst = Collator.getInstance();
|
||||
Collections.sort(res, new Comparator<AbstractPoiType>() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue