Update poi type immediately

This commit is contained in:
Victor Shcherb 2015-11-18 12:04:55 +01:00
parent adf414222b
commit 6de3ce5513

View file

@ -252,6 +252,10 @@ public class EditPoiDialogFragment extends DialogFragment {
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
if (!getEditPoiData().isInEdit()) { if (!getEditPoiData().isInEdit()) {
PoiType pt = getEditPoiData().getAllTranslatedSubTypes().get(s.toString());
if(pt != null) {
poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation());
}
getEditPoiData().updateTypeTag(s.toString()); getEditPoiData().updateTypeTag(s.toString());
} }
} }
@ -513,9 +517,7 @@ public class EditPoiDialogFragment extends DialogFragment {
//noinspection SuspiciousMethodCalls //noinspection SuspiciousMethodCalls
PoiType pt = subCategories.get(item); PoiType pt = subCategories.get(item);
String keyName = pt.getKeyName(); String keyName = pt.getKeyName();
if(pt != null) {
poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation()); poiTypeTextInputLayout.setHint(pt.getCategory().getTranslation());
}
poiTypeEditText.setText(keyName); poiTypeEditText.setText(keyName);
} }
} }