This commit is contained in:
Roman Inflianskas 2016-07-08 14:23:04 +03:00
parent b4fa964158
commit 1eb4e70d5f

View file

@ -510,12 +510,14 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
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) {
if ((filter.isStandardFilter() && filter.filterId.startsWith(PoiUIFilter.STD_PREFIX)) if (((filter.isStandardFilter() && filter.filterId.startsWith(PoiUIFilter.STD_PREFIX))
|| filter.filterId.startsWith(PoiUIFilter.CUSTOM_FILTER_ID)) { || filter.filterId.startsWith(PoiUIFilter.CUSTOM_FILTER_ID))
&& (filter.getFilterByName() == null)
&& (filter.getSavedFilterByName() == null)) {
standardFilters.add(filter); standardFilters.add(filter);
} }
} }
if (!standardFilters.isEmpty()) { if (standardFilters.size() > 1) {
PoiUIFilter standardFiltersCombined = new PoiUIFilter(standardFilters, app); PoiUIFilter standardFiltersCombined = new PoiUIFilter(standardFilters, app);
filters.removeAll(standardFilters); filters.removeAll(standardFilters);
filters.add(standardFiltersCombined); filters.add(standardFiltersCombined);