From f43cfc6d6df4f7afc7c5e47f3056b2a3988d3ffc Mon Sep 17 00:00:00 2001 From: GaidamakUA Date: Thu, 12 Nov 2015 16:03:56 +0200 Subject: [PATCH] Poi type editing fix. --- .../plus/osmedit/AdvancedEditPoiFragment.java | 1 - .../net/osmand/plus/osmedit/EditPoiData.java | 18 ++++++++---------- .../plus/osmedit/EditPoiDialogFragment.java | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java index fa24292d4f..cd1e960b29 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/AdvancedEditPoiFragment.java @@ -100,7 +100,6 @@ public class AdvancedEditPoiFragment extends Fragment mTagsChangedListener = new EditPoiData.TagsChangedListener() { @Override public void onTagsChanged(String anyTag) { - LOG.debug("onTagsChanged(" + "anyTag=" + anyTag + ")"); String value = getData().getTagValues().get(anyTag); if (Algorithms.objectEquals(anyTag, OSMSettings.OSMTagKey.NAME.getValue())) { nameTextView.setText(value); diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java index 291011d5bf..313089dda7 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiData.java @@ -1,11 +1,5 @@ package net.osmand.plus.osmedit; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - import net.osmand.PlatformUtil; import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiType; @@ -15,6 +9,12 @@ import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; + public class EditPoiData { private static final Log LOG = PlatformUtil.getLog(EditPoiData.class); private Set mListeners = new HashSet<>(); @@ -52,7 +52,7 @@ public class EditPoiData { } public PoiType getPoiTypeDefined() { - return allTranslatedSubTypes.get(getPoiTypeString()); + return allTranslatedSubTypes.get(getPoiTypeString().toLowerCase()); } public String getPoiTypeString() { @@ -188,8 +188,6 @@ public class EditPoiData { tagValues.remove(pt.getOsmTag()); tagValues.remove(pt.getOsmTag2()); } + notifyDatasetChanged(POI_TYPE_TAG); } - - - } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java index c14e0b28b5..de4eb96c23 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/EditPoiDialogFragment.java @@ -44,6 +44,7 @@ import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; + import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.Amenity; @@ -493,7 +494,6 @@ public class EditPoiDialogFragment extends DialogFragment { @Override public void onItemSelected(AdapterView parent, View view, int position, long id) { Object item = parent.getAdapter().getItem(position); - LOG.debug("item=" + item); //noinspection SuspiciousMethodCalls if (subCategories.containsKey(item)) { //noinspection SuspiciousMethodCalls