Fixed the issue with incorrect values being selected in Charging station filter
This commit is contained in:
parent
745e3ab625
commit
a34a396aa7
1 changed files with 4 additions and 2 deletions
|
@ -45,10 +45,12 @@ import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import java.text.MessageFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -451,11 +453,11 @@ public class QuickSearchPoiFilterFragment extends DialogFragment {
|
||||||
extractPoiAdditionals(otherAdditionalCategories, additionalsMap, excludedPoiAdditionalCategories, true);
|
extractPoiAdditionals(otherAdditionalCategories, additionalsMap, excludedPoiAdditionalCategories, true);
|
||||||
|
|
||||||
if (additionalsMap.size() > 0) {
|
if (additionalsMap.size() > 0) {
|
||||||
|
Set<String> filters = new HashSet<>(Arrays.asList(filterByName.split(" ")));
|
||||||
for (Entry<String, List<PoiType>> entry : additionalsMap.entrySet()) {
|
for (Entry<String, List<PoiType>> entry : additionalsMap.entrySet()) {
|
||||||
for (PoiType poiType : entry.getValue()) {
|
for (PoiType poiType : entry.getValue()) {
|
||||||
String keyName = poiType.getKeyName().replace('_', ':').toLowerCase();
|
String keyName = poiType.getKeyName().replace('_', ':').toLowerCase();
|
||||||
index = filterByName.indexOf(keyName);
|
if (filters.contains(keyName)) {
|
||||||
if (index != -1) {
|
|
||||||
selectedPoiAdditionals.add(keyName);
|
selectedPoiAdditionals.add(keyName);
|
||||||
filterByName = filterByName.replaceAll(keyName, "");
|
filterByName = filterByName.replaceAll(keyName, "");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue