From efb24f7c039a8dad1bb665d8c499d0d2378efd63 Mon Sep 17 00:00:00 2001 From: Rosty Date: Fri, 30 Dec 2016 12:33:37 +0200 Subject: [PATCH] quick action show/hide poi --- OsmAnd/res/values/strings.xml | 14 +++++++------- .../src/net/osmand/plus/poi/PoiFiltersHelper.java | 4 ++++ .../plus/quickaction/QuickActionFactory.java | 10 ++++++++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 8f1737900d..957fb4a8ab 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -139,12 +139,12 @@ District Neighbourhood Search - Open 24/7 + Open 24/7 Memory card Coordinate format Format for the geographical coordinates - Bus - Train + Bus + Train Current track Battery level Change marker\'s position @@ -156,7 +156,7 @@ Direction haptic feedback Indicate target point direction by vibration Enable navigation for OSM Live changes (Beta) - OSM Live navigation + OSM Live navigation Destination is not set Magnetic bearing Relative bearing @@ -261,7 +261,7 @@ This subscription enables hourly updates for all maps around the world. Part of the income goes back to the OSM community and is paid for each OSM contribution. If you love OsmAnd and OSM and want to support them, this is the perfect way to do it. - + Select map marker Other markers Upload anonymously @@ -1080,8 +1080,8 @@ Route information Prefer motorways Prefer motorways - - + + Avoid toll roads Avoid toll roads Avoid unpaved roads diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java index 7ad224d687..09d57d77eb 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiFiltersHelper.java @@ -308,6 +308,10 @@ public class PoiFiltersHelper { saveSelectedPoiFilters(); } + public void hidePoiFilters() { + selectedPoiFilters.clear(); + } + public String getFiltersName(Set filters) { if (filters.isEmpty()) { return application.getResources().getString(R.string.shared_string_none); diff --git a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java index ea7b7e0378..7a2c7178ac 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/QuickActionFactory.java @@ -22,6 +22,7 @@ import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.mapcontextmenu.editors.EditCategoryDialogFragment; import net.osmand.plus.mapcontextmenu.editors.SelectCategoryDialogFragment; +import net.osmand.plus.poi.PoiFiltersHelper; import net.osmand.plus.widgets.AutoCompleteTextViewEx; import java.lang.reflect.Type; @@ -423,8 +424,13 @@ public class QuickActionFactory { @Override public void execute(MapActivity activity) { - activity.getMyApplication().getSettings().SHOW_NEARBY_POI.set( - !activity.getMyApplication().getSettings().SHOW_NEARBY_POI.get()); + PoiFiltersHelper pf = activity.getMyApplication().getPoiFilters(); + + if (pf.getSelectedPoiFilters().isEmpty()){ + + pf.loadSelectedPoiFilters(); + + } else pf.hidePoiFilters(); } @Override