From 20acdf9193855e59b0896d1596b7b891e442805f Mon Sep 17 00:00:00 2001 From: PavelRatushnyi Date: Fri, 12 Jan 2018 23:53:58 +0200 Subject: [PATCH] Revert --- .../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 3d6422991e..7d0d3b90e2 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPOIMenuController.java @@ -195,10 +195,6 @@ public class EditPOIMenuController extends MenuController { } private String getCategory() { - 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; + return OsmEditingPlugin.getCategory(osmPoint, getMapActivity()); } } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 7c3aa390ab..4c63bcb5cf 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -445,6 +445,19 @@ 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 a2318d9ede..450a9ce993 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditsAdapter.java @@ -300,17 +300,8 @@ public class OsmEditsAdapter extends ArrayAdapter { return true; } - 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 getCategory(OsmPoint point) { + return OsmEditingPlugin.getCategory(point, getContext()); } private String getDescription(OsmPoint point) {