Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
68b438f0d5
2 changed files with 15 additions and 11 deletions
|
@ -2336,7 +2336,7 @@ public class OsmandSettings {
|
||||||
public Set<String> getSelectedPoiFilters() {
|
public Set<String> getSelectedPoiFilters() {
|
||||||
Set<String> result = new LinkedHashSet<>();
|
Set<String> result = new LinkedHashSet<>();
|
||||||
String filtersId = SELECTED_POI_FILTER_FOR_MAP.get();
|
String filtersId = SELECTED_POI_FILTER_FOR_MAP.get();
|
||||||
if (filtersId != null && !filtersId.isEmpty()) {
|
if (filtersId != null && !filtersId.trim().isEmpty()) {
|
||||||
Collections.addAll(result, filtersId.split(","));
|
Collections.addAll(result, filtersId.split(","));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -113,6 +113,13 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
|
||||||
updatePoiAdditionals();
|
updatePoiAdditionals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PoiUIFilter(Set<PoiUIFilter> filtersToMerge, OsmandApplication app) {
|
||||||
|
this(app);
|
||||||
|
combineWithPoiFilters(filtersToMerge);
|
||||||
|
filterId = PoiUIFilter.STD_PREFIX + "combined";
|
||||||
|
name = app.getPoiFilters().getFiltersName(filtersToMerge);
|
||||||
|
}
|
||||||
|
|
||||||
public String getFilterByName() {
|
public String getFilterByName() {
|
||||||
return filterByName;
|
return filterByName;
|
||||||
}
|
}
|
||||||
|
@ -494,6 +501,12 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
|
||||||
poiAdditionals.putAll(f.poiAdditionals);
|
poiAdditionals.putAll(f.poiAdditionals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void combineWithPoiFilters(Set<PoiUIFilter> filters) {
|
||||||
|
for (PoiUIFilter f : filters) {
|
||||||
|
combineWithPoiFilter(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void combineStandardPoiFilters(Set<PoiUIFilter> filters, OsmandApplication app) {
|
public static void combineStandardPoiFilters(Set<PoiUIFilter> filters, OsmandApplication app) {
|
||||||
Set<PoiUIFilter> standardFilters = new TreeSet<>();
|
Set<PoiUIFilter> standardFilters = new TreeSet<>();
|
||||||
for (PoiUIFilter filter : filters) {
|
for (PoiUIFilter filter : filters) {
|
||||||
|
@ -503,16 +516,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!standardFilters.isEmpty()) {
|
if (!standardFilters.isEmpty()) {
|
||||||
PoiUIFilter standardFiltersCombined = null;
|
PoiUIFilter standardFiltersCombined = new PoiUIFilter(standardFilters, app);
|
||||||
for (PoiUIFilter f : standardFilters) {
|
|
||||||
if (standardFiltersCombined == null) {
|
|
||||||
standardFiltersCombined = f;
|
|
||||||
f.filterId = PoiUIFilter.STD_PREFIX + "combined";
|
|
||||||
f.name = app.getPoiFilters().getFiltersName(standardFilters);
|
|
||||||
} else {
|
|
||||||
standardFiltersCombined.combineWithPoiFilter(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
filters.removeAll(standardFilters);
|
filters.removeAll(standardFilters);
|
||||||
filters.add(standardFiltersCombined);
|
filters.add(standardFiltersCombined);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue