From 24e43e8490462dcfff31ed14ad03842249e68103 Mon Sep 17 00:00:00 2001 From: Chumva Date: Thu, 20 Jun 2019 11:31:06 +0300 Subject: [PATCH] Fix #6814 --- OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java | 4 ++-- OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java | 5 +++++ .../osmand/plus/quickaction/actions/ShowHidePoiAction.java | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 99c27e1673..8c10132637 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -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); diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java index 0ed3d8476d..75bfa98d39 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java @@ -139,6 +139,11 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable updateFilterResults(); } + public void removeUnsavedFilterByName() { + filterByName = savedFilterByName; + updateFilterResults(); + } + public void updateFilterResults() { List prev = currentSearchResult; if (prev != null) { diff --git a/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java b/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java index 07bb0c732e..d1fa4d9595 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/actions/ShowHidePoiAction.java @@ -108,7 +108,7 @@ public class ShowHidePoiAction extends QuickAction { for (PoiUIFilter filter : poiFilters) { if (filter.isStandardFilter()) { - filter.setFilterByName(null); + filter.removeUnsavedFilterByName(); } pf.addSelectedPoiFilter(filter); }