Merge pull request #7064 from osmandapp/Fix_6814

Fix #6814
This commit is contained in:
Alexey 2019-06-21 10:55:01 +03:00 committed by GitHub
commit 4b697c14ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);
}