Fix issue #5350
This commit is contained in:
parent
9ea3c852d7
commit
9752fb70cd
3 changed files with 32 additions and 13 deletions
|
@ -179,7 +179,20 @@ public class MapPoiTypes {
|
|||
if (skipNonEditable && pc.isNotEditableOsm()) {
|
||||
continue;
|
||||
}
|
||||
for (PoiType pt : pc.getPoiTypes()) {
|
||||
for (PoiFilter pf : pc.getPoiFilters()) {
|
||||
if (skipNonEditable && pf.isNotEditableOsm()) {
|
||||
continue;
|
||||
}
|
||||
addPoiTypesTranslation(skipNonEditable, translation, pf);
|
||||
}
|
||||
addPoiTypesTranslation(skipNonEditable, translation, pc);
|
||||
}
|
||||
return translation;
|
||||
}
|
||||
|
||||
|
||||
private void addPoiTypesTranslation(boolean skipNonEditable, Map<String, PoiType> translation, PoiFilter pf) {
|
||||
for (PoiType pt : pf.getPoiTypes()) {
|
||||
if (pt.isReference()) {
|
||||
continue;
|
||||
}
|
||||
|
@ -193,8 +206,6 @@ public class MapPoiTypes {
|
|||
translation.put(pt.getTranslation().toLowerCase(), pt);
|
||||
}
|
||||
}
|
||||
return translation;
|
||||
}
|
||||
|
||||
public List<AbstractPoiType> getAllTypesTranslatedNames(StringMatcher matcher) {
|
||||
List<AbstractPoiType> tm = new ArrayList<AbstractPoiType>();
|
||||
|
|
|
@ -215,6 +215,8 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
|
|||
});
|
||||
|
||||
valueEditText.setText(vl);
|
||||
valueEditText.setAdapter(valueAdapter);
|
||||
valueEditText.setThreshold(3);
|
||||
valueEditText.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
@ -279,7 +281,8 @@ public class AdvancedEditPoiFragment extends BaseOsmAndFragment
|
|||
}
|
||||
if (poiType.getEditOsmTag() != null &&
|
||||
!poiType.getEditOsmTag().equals(OSMSettings.OSMTagKey.NAME.getValue())) {
|
||||
stringSet.add(poiType.getEditOsmTag());
|
||||
String editOsmTag = poiType.getEditOsmTag();
|
||||
stringSet.add(editOsmTag);
|
||||
if (poiType.getOsmTag2() != null) {
|
||||
stringSet.add(poiType.getOsmTag2());
|
||||
}
|
||||
|
|
|
@ -580,12 +580,17 @@ public class EditPoiDialogFragment extends BaseOsmAndDialogFragment {
|
|||
if(!s.getKeyName().contains("osmand")) {
|
||||
addMapEntryAdapter(subCategories, s.getKeyName().replace('_', ' '), s);
|
||||
}
|
||||
if(!Algorithms.isEmpty(s.getEditOsmValue())) {
|
||||
addMapEntryAdapter(subCategories, s.getEditOsmValue().replace('_', ' '), s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, PoiType> s : editPoiData.getAllTranslatedSubTypes().entrySet()) {
|
||||
if(!s.getKey().contains("osmand")) {
|
||||
addMapEntryAdapter(subCategories, s.getKey(), s.getValue());
|
||||
}
|
||||
}
|
||||
final ArrayAdapter<Object> adapter;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
adapter = new ArrayAdapter<>(getActivity(),
|
||||
|
|
Loading…
Reference in a new issue