This commit is contained in:
PavelRatushnyi 2018-01-12 23:53:58 +02:00
parent 98e97c8c8f
commit 20acdf9193
3 changed files with 16 additions and 16 deletions

View file

@ -195,10 +195,6 @@ public class EditPOIMenuController extends MenuController {
} }
private String getCategory() { private String getCategory() {
String category = ((OpenstreetmapPoint) osmPoint).getEntity().getTag(EditPoiData.POI_TYPE_TAG); return OsmEditingPlugin.getCategory(osmPoint, getMapActivity());
if (Algorithms.isEmpty(category)) {
category = getMapActivity().getString(R.string.shared_string_without_name);
}
return category;
} }
} }

View file

@ -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) { public static String getPrefix(OsmPoint osmPoint) {
return (osmPoint.getGroup() == OsmPoint.Group.POI ? "POI" : "Bug") + " id: " + osmPoint.getId() + " "; return (osmPoint.getGroup() == OsmPoint.Group.POI ? "POI" : "Bug") + " id: " + osmPoint.getId() + " ";
} }

View file

@ -300,17 +300,8 @@ public class OsmEditsAdapter extends ArrayAdapter<Object> {
return true; return true;
} }
private String getCategory(OsmPoint osmPoint) { private String getCategory(OsmPoint point) {
String category = ""; return OsmEditingPlugin.getCategory(point, getContext());
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) { private String getDescription(OsmPoint point) {