From d84610a77a09b5a5d0fae6328d2cb4feadcce484 Mon Sep 17 00:00:00 2001 From: Chumva Date: Mon, 19 Mar 2018 13:56:20 +0200 Subject: [PATCH] added poi synonyms to ui --- OsmAnd/res/values-ru/phrases.xml | 1 + OsmAnd/res/values/phrases.xml | 2 ++ .../net/osmand/plus/search/QuickSearchListAdapter.java | 10 ++++++++++ 3 files changed, 13 insertions(+) diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml index 4c0a5f4dde..0f4dfa44ec 100644 --- a/OsmAnd/res/values-ru/phrases.xml +++ b/OsmAnd/res/values-ru/phrases.xml @@ -1594,6 +1594,7 @@ Продажа воды Телефонные карты Еда для животных + Корм Карты общественного транспорта Напитки и сладости Ваучеры diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml index f65dd93fcd..a3358d6ad0 100644 --- a/OsmAnd/res/values/phrases.xml +++ b/OsmAnd/res/values/phrases.xml @@ -917,6 +917,7 @@ Art gallery Dance floor Nightclub + Disco;Disko Stripclub Ski resort Beach resort @@ -1863,6 +1864,7 @@ Water vending Telephone vouchers Animal food + Feed Public transport plans Drinks and sweets Vouchers diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java index 4b211dbde1..a9a32c244d 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListAdapter.java @@ -19,6 +19,7 @@ import net.osmand.Location; import net.osmand.access.AccessibilityAssistant; import net.osmand.data.Amenity; import net.osmand.data.LatLon; +import net.osmand.osm.AbstractPoiType; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.dashboard.DashLocationFragment; @@ -360,6 +361,15 @@ public class QuickSearchListAdapter extends ArrayAdapter { } String desc = listItem.getTypeName(); + String synonyms[]; + if (listItem.getSearchResult().object instanceof AbstractPoiType) { + AbstractPoiType abstractPoiType = (AbstractPoiType) listItem.getSearchResult().object; + synonyms = abstractPoiType.getSynonyms().split(";"); + String preferredLanguage = app.getLanguage(); + if(!(synonyms[0].isEmpty())){ + desc += " (" + synonyms[0] + ")"; + }} + boolean hasDesc = false; if (!Algorithms.isEmpty(desc) && !desc.equals(name)) { subtitle.setText(desc);