From 98e97c8c8f092fdc1ef553b474ef22f6d2d83f22 Mon Sep 17 00:00:00 2001 From: PavelRatushnyi Date: Fri, 12 Jan 2018 23:52:52 +0200 Subject: [PATCH] Fix osm point category --- .../osmand/plus/osmedit/EditPOIMenuController.java | 6 +++++- .../net/osmand/plus/osmedit/OsmEditingPlugin.java | 13 ------------- .../net/osmand/plus/osmedit/OsmEditsAdapter.java | 13 +++++++++++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java index 7d0d3b90e2..3d6422991e 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java @@ -195,6 +195,10 @@ public class EditPOIMenuController extends MenuController { } private String getCategory() { - return OsmEditingPlugin.getCategory(osmPoint, getMapActivity()); + String category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG); + if (Algorithms.isEmpty(category)) { + category = getMapActivity().getString(R.string.shared_string_without_name); + } + return category; } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 4c63bcb5cf..7c3aa390ab 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -445,19 +445,6 @@ public class OsmEditingPlugin extends OsmandPlugin { } } - public static String getCategory(OsmPoint osmPoint, Context context) { - String category = ""; - if (osmPoint.getGroup() == OsmPoint.Group.POI) { - category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG); - if (Algorithms.isEmpty(category)) { - category = context.getString(R.string.shared_string_without_name); - } - } else if (osmPoint.getGroup() == OsmPoint.Group.BUG) { - category = context.getString(R.string.osn_bug_name); - } - return category; - } - public static String getPrefix(OsmPoint osmPoint) { return (osmPoint.getGroup() == OsmPoint.Group.POI ? "POI" : "Bug") + " id: " + osmPoint.getId() + " "; } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java index 450a9ce993..a2318d9ede 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java @@ -300,8 +300,17 @@ public class OsmEditsAdapter extends ArrayAdapter { return true; } - private String getCategory(OsmPoint point) { - return OsmEditingPlugin.getCategory(point, getContext()); + private String getCategory(OsmPoint osmPoint) { + String category = ""; + if (osmPoint.getGroup() == OsmPoint.Group.POI) { + category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG); + if (Algorithms.isEmpty(category)) { + category = getContext().getString(R.string.shared_string_without_name); + } + } else if (osmPoint.getGroup() == OsmPoint.Group.BUG) { + category = getContext().getString(R.string.osn_bug_name); + } + return category; } private String getDescription(OsmPoint point) {