Poi type editing fix.

This commit is contained in:
GaidamakUA 2015-11-12 16:03:56 +02:00
parent 2b49a85e6b
commit f43cfc6d6d
3 changed files with 9 additions and 12 deletions

View file

@ -100,7 +100,6 @@ public class AdvancedEditPoiFragment extends Fragment
mTagsChangedListener = new EditPoiData.TagsChangedListener() { mTagsChangedListener = new EditPoiData.TagsChangedListener() {
@Override @Override
public void onTagsChanged(String anyTag) { public void onTagsChanged(String anyTag) {
LOG.debug("onTagsChanged(" + "anyTag=" + anyTag + ")");
String value = getData().getTagValues().get(anyTag); String value = getData().getTagValues().get(anyTag);
if (Algorithms.objectEquals(anyTag, OSMSettings.OSMTagKey.NAME.getValue())) { if (Algorithms.objectEquals(anyTag, OSMSettings.OSMTagKey.NAME.getValue())) {
nameTextView.setText(value); nameTextView.setText(value);

View file

@ -1,11 +1,5 @@
package net.osmand.plus.osmedit; 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.PlatformUtil;
import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType; import net.osmand.osm.PoiType;
@ -15,6 +9,12 @@ import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log; 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 { public class EditPoiData {
private static final Log LOG = PlatformUtil.getLog(EditPoiData.class); private static final Log LOG = PlatformUtil.getLog(EditPoiData.class);
private Set<TagsChangedListener> mListeners = new HashSet<>(); private Set<TagsChangedListener> mListeners = new HashSet<>();
@ -52,7 +52,7 @@ public class EditPoiData {
} }
public PoiType getPoiTypeDefined() { public PoiType getPoiTypeDefined() {
return allTranslatedSubTypes.get(getPoiTypeString()); return allTranslatedSubTypes.get(getPoiTypeString().toLowerCase());
} }
public String getPoiTypeString() { public String getPoiTypeString() {
@ -188,8 +188,6 @@ public class EditPoiData {
tagValues.remove(pt.getOsmTag()); tagValues.remove(pt.getOsmTag());
tagValues.remove(pt.getOsmTag2()); tagValues.remove(pt.getOsmTag2());
} }
notifyDatasetChanged(POI_TYPE_TAG);
} }
} }

View file

@ -44,6 +44,7 @@ import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleToast; import net.osmand.access.AccessibleToast;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
@ -493,7 +494,6 @@ public class EditPoiDialogFragment extends DialogFragment {
@Override @Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Object item = parent.getAdapter().getItem(position); Object item = parent.getAdapter().getItem(position);
LOG.debug("item=" + item);
//noinspection SuspiciousMethodCalls //noinspection SuspiciousMethodCalls
if (subCategories.containsKey(item)) { if (subCategories.containsKey(item)) {
//noinspection SuspiciousMethodCalls //noinspection SuspiciousMethodCalls