Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-02-06 14:01:29 +01:00
commit e9501ca518
3 changed files with 38 additions and 33 deletions

View file

@ -155,7 +155,7 @@
<string name="poi_vehicle_inspection">Пункт техосмотра</string>
<string name="poi_car_wash">Автомойка</string>
<string name="poi_fuel">Автомобильная заправка</string>
<string name="poi_charging_station">Зарядная станция</string>
<string name="poi_electricity_combined_charging">Зарядная станция</string>
<string name="poi_vehicle_ramp">Ремонтная эстакада/яма</string>
<string name="poi_compressed_air">Подкачка шин</string>
<string name="poi_parking">Парковка</string>

View file

@ -331,7 +331,7 @@
<string name="poi_fuel_electricity">Electricity</string>
<string name="poi_aeroway_fuel">Aircraft fuel station</string>
<string name="poi_waterway_fuel">Gas station for boats</string>
<string name="poi_charging_station">Charging station</string>
<string name="poi_electricity_combined_charging">Charging station</string>
<string name="poi_vehicle_ramp">Vehicle ramp</string>
<string name="poi_compressed_air">Compressed air</string>
<string name="poi_parking">Parking</string>

View file

@ -97,7 +97,8 @@ public class AmenityMenuBuilder extends MenuBuilder {
ll.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
copyToClipboard(txt, view.getContext());
String textToCopy = !Algorithms.isEmpty(textPrefix) ? textPrefix + ": " + txt : txt;
copyToClipboard(textToCopy, view.getContext());
return true;
}
});
@ -429,8 +430,10 @@ public class AmenityMenuBuilder extends MenuBuilder {
for (String c : e.getValue().split(";")) {
if (sb.length() > 0) {
sb.append(", ");
sb.append(poiTypes.getPoiTranslation("cuisine_" + c).toLowerCase());
} else {
sb.append(poiTypes.getPoiTranslation("cuisine_" + c));
}
sb.append(poiTypes.getPoiTranslation("cuisine_" + c).toLowerCase());
}
textPrefix = app.getString(R.string.poi_cuisine);
vl = sb.toString();
@ -501,30 +504,33 @@ public class AmenityMenuBuilder extends MenuBuilder {
}
}
if (cuisineRow != null && poiAdditionalCategories.size() == 0) {
infoRows.add(cuisineRow);
if (cuisineRow != null) {
boolean hasCuisineOrDish = poiAdditionalCategories.get(Amenity.CUISINE) != null
|| poiAdditionalCategories.get(Amenity.DISH) != null;
if (!hasCuisineOrDish) {
infoRows.add(cuisineRow);
}
}
for (List<PoiType> categoryTypes : poiAdditionalCategories.values()) {
Drawable icon;
PoiType pType = categoryTypes.get(0);
String poiAdditionalCategoryName = pType.getPoiAdditionalCategory();
String poiAddidionalIconName = poiTypes.getPoiAdditionalCategoryIconName(poiAdditionalCategoryName);
icon = getRowIcon(view.getContext(), poiAddidionalIconName);
if (icon == null) {
icon = getRowIcon(view.getContext(), poiAdditionalCategoryName);
}
if (icon == null) {
icon = getRowIcon(view.getContext(), pType.getIconKeyName());
}
if (icon == null) {
icon = getRowIcon(R.drawable.ic_action_note_dark);
}
if (categoryTypes.size() == 1) {
String vl = pType.getTranslation();
infoRows.add(new AmenityInfoRow(poiAdditionalCategoryName, icon, pType.getPoiAdditionalCategoryTranslation(), vl, false, null,
0, false, false, false, pType.getOrder(), pType.getKeyName(), false, false, false, 0));
} else {
for (Map.Entry<String, List<PoiType>> e : poiAdditionalCategories.entrySet()) {
String categoryName = e.getKey();
List<PoiType> categoryTypes = e.getValue();
if (categoryTypes.size() > 0) {
Drawable icon;
PoiType pType = categoryTypes.get(0);
String poiAdditionalCategoryName = pType.getPoiAdditionalCategory();
String poiAddidionalIconName = poiTypes.getPoiAdditionalCategoryIconName(poiAdditionalCategoryName);
icon = getRowIcon(view.getContext(), poiAddidionalIconName);
if (icon == null) {
icon = getRowIcon(view.getContext(), poiAdditionalCategoryName);
}
if (icon == null) {
icon = getRowIcon(view.getContext(), pType.getIconKeyName());
}
if (icon == null) {
icon = getRowIcon(R.drawable.ic_action_note_dark);
}
StringBuilder sb = new StringBuilder();
for (PoiType pt : categoryTypes) {
if (sb.length() > 0) {
@ -532,7 +538,8 @@ public class AmenityMenuBuilder extends MenuBuilder {
}
sb.append(pt.getTranslation());
}
CollapsableView collapsableView = getPoiAdditionalCollapsableView(view.getContext(), true, categoryTypes, cuisineRow);
boolean cuisineOrDish = categoryName.equals(Amenity.CUISINE) || categoryName.equals(Amenity.DISH);
CollapsableView collapsableView = getPoiAdditionalCollapsableView(view.getContext(), true, categoryTypes, cuisineOrDish ? cuisineRow : null);
infoRows.add(new AmenityInfoRow(poiAdditionalCategoryName, icon, pType.getPoiAdditionalCategoryTranslation(), sb.toString(), true, collapsableView,
0, false, false, false, pType.getOrder(), pType.getKeyName(), false, false, false, 1));
}
@ -644,13 +651,11 @@ public class AmenityMenuBuilder extends MenuBuilder {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AbstractPoiType parent = pt.getParentType();
if (parent != null) {
PoiUIFilter filter = app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + parent.getKeyName());
//PoiUIFilter filter = app.getPoiFilters().getCustomPOIFilter();
if (amenity.getType() != null) {
PoiUIFilter filter = app.getPoiFilters().getFilterById(PoiUIFilter.STD_PREFIX + amenity.getType().getKeyName());
if (filter != null) {
filter.clearFilter();
filter.setTypeToAccept(pt.getCategory(), true);
filter.setTypeToAccept(amenity.getType(), true);
filter.updateTypesToAccept(pt);
filter.setFilterByName(pt.getKeyName().replace('_', ':').toLowerCase());
getMapActivity().showQuickSearch(filter);
@ -667,7 +672,7 @@ public class AmenityMenuBuilder extends MenuBuilder {
if (textCuisineRow != null) {
TextViewEx button = buildButtonInCollapsableView(context, true, false, false);
String name = textCuisineRow.textPrefix + ": " + textCuisineRow.text;
String name = textCuisineRow.textPrefix + ": " + textCuisineRow.text.toLowerCase();
button.setText(name);
view.addView(button);
}