This commit is contained in:
max-klaus 2020-07-30 18:11:41 +03:00
parent 7cdb927bde
commit 638a9c6231
3 changed files with 14 additions and 7 deletions

View file

@ -206,7 +206,7 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
continue;
addTagView(tag.getKey(), tag.getValue());
}
if (editPoiData.hasEmptyValue()) {
if (editPoiData.hasEmptyValue() && linearLayout.findViewById(R.id.valueEditText) != null) {
linearLayout.findViewById(R.id.valueEditText).requestFocus();
}
editPoiData.setIsInEdit(false);

View file

@ -214,13 +214,14 @@ public class EditPoiData {
}
retrieveType();
PoiType pt = getPoiTypeDefined();
if (pt != null) {
removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + pt.getEditOsmTag()));
String editOsmTag = pt != null ? pt.getEditOsmTag() : null;
if (editOsmTag != null) {
removeTypeTagWithPrefix(!tagValues.containsKey(REMOVE_TAG_PREFIX + editOsmTag));
currentPoiType = pt;
String tagVal = pt.getEditOsmValue() != null ? pt.getEditOsmValue() : "";
tagValues.put(pt.getEditOsmTag(), tagVal);
tagValues.put(editOsmTag, tagVal);
if (userChanges) {
changedTags.add(pt.getEditOsmTag());
changedTags.add(editOsmTag);
}
category = pt.getCategory();
} else if (currentPoiType != null) {

View file

@ -765,8 +765,14 @@ public class ResourceManager {
toAddPoiTypes.put(poiCategory, new TreeMap<String, PoiType>());
}
Map<String, PoiType> poiTypes = toAddPoiTypes.get(poiCategory);
if (poiTypes != null) {
for (String s : entry.getValue()) {
poiTypes.put(s, new PoiType(MapPoiTypes.getDefault(), poiCategory, null, s));
PoiType pt = new PoiType(MapPoiTypes.getDefault(), poiCategory, null, s);
pt.setOsmTag("");
pt.setOsmValue("");
pt.setNotEditableOsm(true);
poiTypes.put(s, pt);
}
}
}
}