Clean check for currentPoiType

This commit is contained in:
Chumva 2018-09-12 15:00:57 +03:00
parent dcd05c455f
commit 8503fe766f

View file

@ -172,9 +172,15 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
linearLayout.removeAllViews();
editPoiData.setIsInEdit(true);
PoiType pt = editPoiData.getCurrentPoiType();
String currentPoiTypeKey = "";
if (pt != null) {
currentPoiTypeKey = pt.getEditOsmTag();
}
for (Entry<String, String> tag : editPoiData.getTagValues().entrySet()) {
if (tag.getKey().equals(EditPoiData.POI_TYPE_TAG) || tag.getKey().equals(pt != null ? pt.getEditOsmTag() : null)
|| tag.getKey().equals(OSMSettings.OSMTagKey.NAME.getValue()) || tag.getKey().startsWith(EditPoiData.REMOVE_TAG_PREFIX))
if (tag.getKey().equals(EditPoiData.POI_TYPE_TAG)
|| tag.getKey().equals(OSMSettings.OSMTagKey.NAME.getValue())
|| tag.getKey().startsWith(EditPoiData.REMOVE_TAG_PREFIX)
|| tag.getKey().equals(currentPoiTypeKey))
continue;
addTagView(tag.getKey(), tag.getValue());
}