diff --git a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java index edad4ed693..1d170ce7e9 100644 --- a/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java +++ b/OsmAnd-java/src/net/osmand/osm/MapPoiTypes.java @@ -179,23 +179,34 @@ public class MapPoiTypes { if (skipNonEditable && pc.isNotEditableOsm()) { continue; } - for (PoiType pt : pc.getPoiTypes()) { - if (pt.isReference()) { + for (PoiFilter pf : pc.getPoiFilters()) { + if (skipNonEditable && pf.isNotEditableOsm()) { continue; - } - if (pt.getBaseLangType() != null) { - continue; - } - if (skipNonEditable && pt.isNotEditableOsm()) { - continue; - } - translation.put(pt.getKeyName().replace('_', ' ').toLowerCase(), pt); - translation.put(pt.getTranslation().toLowerCase(), pt); + } + addPoiTypesTranslation(skipNonEditable, translation, pf); } + addPoiTypesTranslation(skipNonEditable, translation, pc); } return translation; } + + private void addPoiTypesTranslation(boolean skipNonEditable, Map translation, PoiFilter pf) { + for (PoiType pt : pf.getPoiTypes()) { + if (pt.isReference()) { + continue; + } + if (pt.getBaseLangType() != null) { + continue; + } + if (skipNonEditable && pt.isNotEditableOsm()) { + continue; + } + translation.put(pt.getKeyName().replace('_', ' ').toLowerCase(), pt); + translation.put(pt.getTranslation().toLowerCase(), pt); + } + } + public List getAllTypesTranslatedNames(StringMatcher matcher) { List tm = new ArrayList(); for (PoiCategory pc : categories) { diff --git a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java index 554c9a9af8..64fd505d75 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java @@ -215,6 +215,8 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment }); valueEditText.setText(vl); + valueEditText.setAdapter(valueAdapter); + valueEditText.setThreshold(3); valueEditText.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { @@ -279,7 +281,8 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment } if (poiType.getEditOsmTag() != null && !poiType.getEditOsmTag().equals(OSMSettings.OSMTagKey.NAME.getValue())) { - stringSet.add(poiType.getEditOsmTag()); + String editOsmTag = poiType.getEditOsmTag(); + stringSet.add(editOsmTag); if (poiType.getOsmTag2() != null) { stringSet.add(poiType.getOsmTag2()); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index 3d137243e6..4532a1349f 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -580,11 +580,16 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { if(!s.getKeyName().contains("osmand")) { addMapEntryAdapter(subCategories, s.getKeyName().replace('_', ' '), s); } + if(!Algorithms.isEmpty(s.getEditOsmValue())) { + addMapEntryAdapter(subCategories, s.getEditOsmValue().replace('_', ' '), s); + } } } } for (Map.Entry s : editPoiData.getAllTranslatedSubTypes().entrySet()) { - addMapEntryAdapter(subCategories, s.getKey(), s.getValue()); + if(!s.getKey().contains("osmand")) { + addMapEntryAdapter(subCategories, s.getKey(), s.getValue()); + } } final ArrayAdapter adapter; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {