This commit is contained in:
Chumva 2019-06-20 11:31:06 +03:00
parent dca473c967
commit 24e43e8490
3 changed files with 8 additions and 3 deletions

View file

@ -308,7 +308,7 @@ public class MapActivityLayers {
PoiUIFilter filter = list.get(i);
if (item.getSelected()) {
if (filter.isStandardFilter()) {
filter.setFilterByName(null);
filter.removeUnsavedFilterByName();
}
getApplication().getPoiFilters().addSelectedPoiFilter(filter);
} else {
@ -376,7 +376,7 @@ public class MapActivityLayers {
activity.showQuickSearch(ShowQuickSearchMode.NEW, true);
} else {
if (pf.isStandardFilter()) {
pf.setFilterByName(null);
pf.removeUnsavedFilterByName();
}
getApplication().getPoiFilters().clearSelectedPoiFilters();
getApplication().getPoiFilters().addSelectedPoiFilter(pf);

View file

@ -139,6 +139,11 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
updateFilterResults();
}
public void removeUnsavedFilterByName() {
filterByName = savedFilterByName;
updateFilterResults();
}
public void updateFilterResults() {
List<Amenity> prev = currentSearchResult;
if (prev != null) {

View file

@ -108,7 +108,7 @@ public class ShowHidePoiAction extends QuickAction {
for (PoiUIFilter filter : poiFilters) {
if (filter.isStandardFilter()) {
filter.setFilterByName(null);
filter.removeUnsavedFilterByName();
}
pf.addSelectedPoiFilter(filter);
}