use of de.westnordost.streetcomplete.data.meta.Abbreviations in project StreetComplete by westnordost.
the class AddRoadNameForm method onClickOk.
@Override
protected void onClickOk() {
LinkedList<String> possibleAbbreviations = new LinkedList<>();
for (RoadName roadName : adapter.getData()) {
String name = roadName.name;
if (name.trim().isEmpty()) {
Toast.makeText(getActivity(), R.string.quest_generic_error_a_field_empty, Toast.LENGTH_LONG).show();
return;
}
Abbreviations abbr = abbreviationsByLocale.get(new Locale(roadName.languageCode));
boolean containsAbbreviations = abbr != null && abbr.containsAbbreviations(name);
if (name.contains(".") || containsAbbreviations) {
possibleAbbreviations.add(name);
}
}
confirmPossibleAbbreviationsIfAny(possibleAbbreviations, this::applyNameAnswer);
}
Aggregations