From 046c906bc5c40d0d3f72a72175dd15cd97028196 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 13 Nov 2019 12:29:02 +0300 Subject: [PATCH 1/2] Fix string --- OsmAnd/res/values-fi/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-fi/strings.xml b/OsmAnd/res/values-fi/strings.xml index e9a301e532..b7f1d73458 100644 --- a/OsmAnd/res/values-fi/strings.xml +++ b/OsmAnd/res/values-fi/strings.xml @@ -2046,7 +2046,7 @@ Jos pidät OsmAndista ja OSMsta ja haluat tukea niitä, on tämä täydellinen t Muokkaa pistettä Lisää piste Tallenna jälkenä - Lisäsit %1 pistettä. Kirjoita tiedostonimi ja paina \"Tallenna\". + Lisäsit %1$s pistettä. Kirjoita tiedostonimi ja paina \"Tallenna\". Ole ystävällinen ja lähetä tästä ilmoituksesta ruutukaappaus osoitteeseen support@osmand.net Hanki OsmAnd Live avataksesi kaikki toiminnot: Voit ladata rajattomasti päivittäisiä karttapäivityksiä, käyttää kaikkia ilmaisia sekä maksullisia plugineja, Wikipediaa, Wikivoyagea ja paljon muuta. Oletustyylin muunnos, joka lisää jalkakäytävien ja pyöräteiden kontrastia. Käyttää vanhoja Mapnikin värejä. From 8c921c72a68259d8fc5c08308df90f37fe67c215 Mon Sep 17 00:00:00 2001 From: Nazar Date: Wed, 13 Nov 2019 11:56:04 +0200 Subject: [PATCH 2/2] Fix #7259 --- .../osmand/aidlapi/OsmAndCustomizationConstants.java | 1 + .../osmand/plus/activities/MapActivityActions.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/OsmAnd-api/src/net/osmand/aidlapi/OsmAndCustomizationConstants.java b/OsmAnd-api/src/net/osmand/aidlapi/OsmAndCustomizationConstants.java index a863364318..a8c0aebb1e 100644 --- a/OsmAnd-api/src/net/osmand/aidlapi/OsmAndCustomizationConstants.java +++ b/OsmAnd-api/src/net/osmand/aidlapi/OsmAndCustomizationConstants.java @@ -76,6 +76,7 @@ public interface OsmAndCustomizationConstants { String MAP_CONTEXT_MENU_CHANGE_MARKER_POSITION = MAP_CONTEXT_MENU_ACTIONS + "change_m_position"; String MAP_CONTEXT_MENU_MARK_AS_PARKING_LOC = MAP_CONTEXT_MENU_ACTIONS + "mark_as_parking"; String MAP_CONTEXT_MENU_MEASURE_DISTANCE = MAP_CONTEXT_MENU_ACTIONS + "measure_distance"; + String MAP_CONTEXT_MENU_AVOID_ROAD = MAP_CONTEXT_MENU_ACTIONS + "avoid_road"; String MAP_CONTEXT_MENU_EDIT_GPX_WP = MAP_CONTEXT_MENU_ACTIONS + "edit_gpx_waypoint"; String MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT = MAP_CONTEXT_MENU_ACTIONS + "add_gpx_waypoint"; String MAP_CONTEXT_MENU_UPDATE_MAP = MAP_CONTEXT_MENU_ACTIONS + "update_map"; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index a752646aa8..463fe6a259 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -99,6 +99,7 @@ import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SEARCH_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SETTINGS_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_TRAVEL_GUIDES_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT; +import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_AVOID_ROAD; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_DIRECTIONS_FROM_ID; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_EDIT_GPX_WP; import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_MEASURE_DISTANCE; @@ -126,6 +127,7 @@ public class MapActivityActions implements DialogProvider { public static final int EDIT_GPX_WAYPOINT_ITEM_ORDER = 9000; public static final int ADD_GPX_WAYPOINT_ITEM_ORDER = 9000; public static final int MEASURE_DISTANCE_ITEM_ORDER = 13000; + public static final int AVOID_ROAD_ITEM_ORDER = 14000; private static final int DIALOG_ADD_FAVORITE = 100; private static final int DIALOG_REPLACE_FAVORITE = 101; @@ -390,6 +392,13 @@ public class MapActivityActions implements DialogProvider { .setOrder(MEASURE_DISTANCE_ITEM_ORDER) .createItem()); + adapter.addItem(itemBuilder + .setTitleId(R.string.avoid_road, mapActivity) + .setId(MAP_CONTEXT_MENU_AVOID_ROAD) + .setIcon(R.drawable.ic_action_alert) + .setOrder(AVOID_ROAD_ITEM_ORDER) + .createItem()); + adapter.sortItemsByOrder(); final ArrayAdapter listAdapter = @@ -417,6 +426,8 @@ public class MapActivityActions implements DialogProvider { } else if (standardId == R.string.measurement_tool) { mapActivity.getContextMenu().close(); MeasurementToolFragment.showInstance(mapActivity.getSupportFragmentManager(), new LatLon(latitude, longitude)); + } else if (standardId == R.string.avoid_road) { + getMyApplication().getAvoidSpecificRoads().addImpassableRoad(mapActivity, new LatLon(latitude, longitude), true, false); } } });