From 744b36b87c78e5d02681ff2b3b9719a767ab1766 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Sat, 25 Jul 2020 18:01:09 +0300 Subject: [PATCH] Fix #6589 (Changing POI category on an existing object has no impact.(try to change the category by tapping on label icon)) --- .../net/osmand/plus/osmedit/EditPoiDialogFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index 932ef59db5..f31cf04c51 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -112,6 +112,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { private EditPoiData editPoiData; private EditPoiViewPager viewPager; private AutoCompleteTextView poiTypeEditText; + private boolean poiCategoryChanged; private OnSaveButtonClickListener onSaveButtonClickListener; private OpenstreetmapUtil mOpenstreetmapUtil; @@ -298,7 +299,11 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { @Override public void afterTextChanged(Editable s) { if (!getEditPoiData().isInEdit()) { - getEditPoiData().updateTypeTag(s.toString(), true); + if (!poiCategoryChanged) { + getEditPoiData().updateTypeTag(s.toString(), true); + } else { + poiCategoryChanged = false; + } if (!getMyApplication().isApplicationInitializing()) { PoiCategory category = editPoiData.getPoiCategory(); if (category != null) { @@ -643,6 +648,7 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment { } public void setPoiCategory(PoiCategory type) { + poiCategoryChanged = true; editPoiData.updateType(type); poiTypeEditText.setText(editPoiData.getPoiTypeString()); setAdapterForPoiTypeEditText();