Update search poi

This commit is contained in:
Victor Shcherb 2015-04-10 00:15:50 +02:00
parent 4af70a04af
commit d236bc718c
42 changed files with 206 additions and 81 deletions

View file

@ -108,6 +108,24 @@ public class MapPoiTypes {
return null; return null;
} }
public AbstractPoiType getAnyPoiTypeByKey(String name) {
for(PoiCategory pc : categories) {
if(pc.getKeyName().equals(name)) {
return pc;
}
for(PoiFilter pf : pc.getPoiFilters()) {
if(pf.getKeyName().equals(name)) {
return pf;
}
}
PoiType pt = pc.getPoiTypeByKeyName(name);
if(pt != null && !pt.isReference()) {
return pt;
}
}
return null;
}
public Map<String, PoiType> getAllTranslatedNames() { public Map<String, PoiType> getAllTranslatedNames() {
Map<String, PoiType> translation = new TreeMap<String, PoiType>(); Map<String, PoiType> translation = new TreeMap<String, PoiType>();
for(PoiCategory pc : categories) { for(PoiCategory pc : categories) {
@ -208,6 +226,7 @@ public class MapPoiTypes {
parser.setInput(is, "UTF-8"); parser.setInput(is, "UTF-8");
PoiCategory lastCategory = null; PoiCategory lastCategory = null;
PoiFilter lastFilter = null; PoiFilter lastFilter = null;
PoiType lastType = null;
while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) { while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) {
if (tok == XmlPullParser.START_TAG) { if (tok == XmlPullParser.START_TAG) {
String name = parser.getName(); String name = parser.getName();
@ -230,6 +249,16 @@ public class MapPoiTypes {
lastFilter.addPoiType(tp); lastFilter.addPoiType(tp);
} }
lastCategory.addPoiType(tp); lastCategory.addPoiType(tp);
} else if(name.equals("poi_additional")){
PoiType tp = new PoiType(this,
lastCategory, parser.getAttributeValue("","name"));
tp.setOsmTag(parser.getAttributeValue("","tag"));
tp.setOsmValue(parser.getAttributeValue("","value"));
tp.setOsmTag2(parser.getAttributeValue("","tag2"));
tp.setOsmValue2(parser.getAttributeValue("","value2"));
if(lastType != null) {
lastType.addPoiAdditional(tp);
}
} else if(name.equals("poi_type")){ } else if(name.equals("poi_type")){
PoiType tp = new PoiType(this, PoiType tp = new PoiType(this,
lastCategory, parser.getAttributeValue("","name")); lastCategory, parser.getAttributeValue("","name"));
@ -237,7 +266,7 @@ public class MapPoiTypes {
tp.setOsmValue(parser.getAttributeValue("","value")); tp.setOsmValue(parser.getAttributeValue("","value"));
tp.setOsmTag2(parser.getAttributeValue("","tag2")); tp.setOsmTag2(parser.getAttributeValue("","tag2"));
tp.setOsmValue2(parser.getAttributeValue("","value2")); tp.setOsmValue2(parser.getAttributeValue("","value2"));
lastType = tp;
if(lastFilter != null) { if(lastFilter != null) {
lastFilter.addPoiType(tp); lastFilter.addPoiType(tp);
} }
@ -247,6 +276,8 @@ public class MapPoiTypes {
String name = parser.getName(); String name = parser.getName();
if (name.equals("poi_filter")) { if (name.equals("poi_filter")) {
lastFilter = null; lastFilter = null;
} else if (name.equals("poi_type")) {
lastType = null;
} }
} }
} }

View file

@ -1,6 +1,9 @@
package net.osmand.osm; package net.osmand.osm;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map; import java.util.Map;
public class PoiType extends AbstractPoiType { public class PoiType extends AbstractPoiType {
@ -11,6 +14,7 @@ public class PoiType extends AbstractPoiType {
private String osmTag2; private String osmTag2;
private String osmValue; private String osmValue;
private String osmValue2; private String osmValue2;
private List<PoiType> poiAdditionals = null;
public PoiType(MapPoiTypes poiTypes, PoiCategory category, String name) { public PoiType(MapPoiTypes poiTypes, PoiCategory category, String name) {
super(name, poiTypes); super(name, poiTypes);
@ -77,6 +81,20 @@ public class PoiType extends AbstractPoiType {
return category; return category;
} }
public void addPoiAdditional(PoiType tp) {
if(poiAdditionals == null) {
poiAdditionals = new ArrayList<PoiType>();
}
poiAdditionals.add(tp);
}
public List<PoiType> getPoiAdditionals() {
if(poiAdditionals == null) {
return Collections.emptyList();
}
return poiAdditionals;
}
public Map<PoiCategory, LinkedHashSet<String>> putTypes(Map<PoiCategory, LinkedHashSet<String>> acceptedTypes) { public Map<PoiCategory, LinkedHashSet<String>> putTypes(Map<PoiCategory, LinkedHashSet<String>> acceptedTypes) {
PoiType rt = getReferenceType(); PoiType rt = getReferenceType();
PoiType poiType = rt != null ? rt : this; PoiType poiType = rt != null ? rt : this;
@ -90,4 +108,6 @@ public class PoiType extends AbstractPoiType {
return acceptedTypes; return acceptedTypes;
} }
} }

View file

@ -49,7 +49,7 @@
<ImageButton <ImageButton
android:id="@+id/all" android:id="@+id/all"
android:contentDescription="@string/flat_list_waypoints" android:contentDescription="@string/shared_string_all"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"

View file

@ -135,7 +135,7 @@
<string name="duration">Praciahlaść</string> <string name="duration">Praciahlaść</string>
<string name="distance">Adliehlaść</string> <string name="distance">Adliehlaść</string>
<string name="index_tours">Pajezdkі</string> <string name="index_tours">Pajezdkі</string>
<string name="flat_list_waypoints">Usie</string> <string name="shared_string_all">Usie</string>
<string name="waypoints">Kropkі šliachu</string> <string name="waypoints">Kropkі šliachu</string>
<string name="targets">Celі</string> <string name="targets">Celі</string>
<string name="announce_gpx_waypoints">Ahalošvać maršrutnyja punkty GPX</string> <string name="announce_gpx_waypoints">Ahalošvać maršrutnyja punkty GPX</string>

View file

@ -1673,7 +1673,7 @@
<string name="speak_favorites">Абвяшчаць выбраныя паблізу</string> <string name="speak_favorites">Абвяшчаць выбраныя паблізу</string>
<string name="speak_poi">Абвяшчаць навакольныя POI</string> <string name="speak_poi">Абвяшчаць навакольныя POI</string>
<string name="targets">Цэлі</string> <string name="targets">Цэлі</string>
<string name="flat_list_waypoints">Усе</string> <string name="shared_string_all">Усе</string>
<string name="index_tours">Паездкі</string> <string name="index_tours">Паездкі</string>
<string name="record_plugin_description">"Модуль актывуе функцыі для запісу і захоўваньня вашых сьлядоў уручную націскам на віджэт запісу GPX на экране мапы, або таксама аўтаматычна запісвае ўсе вашы маршруты навігацыі ў файл GPX.\n\nЗапісанымі сьлядамі можна падзяліцца з вашымі сябрамі або выкарыстоўваць іх для адсылкі ў OSM. Спартсмэны могуць выкарыстоўваць запісаныя сьляды для кантролю за трэніроўкамі. Некаторы базавы аналіз трэкаў можа быць выкананы непасрэдна ў OsmAnd, напрыклад, час праходжаньня кругу, сярэдняя хуткасьць і г.д., трэкі, вядома, пазней таксама могуць быць прааналізаваны ў спецыяльных інструмэнтах аналізу іншых вытворцаў. "</string> <string name="record_plugin_description">"Модуль актывуе функцыі для запісу і захоўваньня вашых сьлядоў уручную націскам на віджэт запісу GPX на экране мапы, або таксама аўтаматычна запісвае ўсе вашы маршруты навігацыі ў файл GPX.\n\nЗапісанымі сьлядамі можна падзяліцца з вашымі сябрамі або выкарыстоўваць іх для адсылкі ў OSM. Спартсмэны могуць выкарыстоўваць запісаныя сьляды для кантролю за трэніроўкамі. Некаторы базавы аналіз трэкаў можа быць выкананы непасрэдна ў OsmAnd, напрыклад, час праходжаньня кругу, сярэдняя хуткасьць і г.д., трэкі, вядома, пазней таксама могуць быць прааналізаваны ў спецыяльных інструмэнтах аналізу іншых вытворцаў. "</string>
<string name="record_plugin_name">Запіс падарожжа</string> <string name="record_plugin_name">Запіс падарожжа</string>

View file

@ -1653,7 +1653,7 @@ OsmAnd е с отворен код и активно да се развива.
<string name="duration">Продължителност</string> <string name="duration">Продължителност</string>
<string name="distance">Разстояние</string> <string name="distance">Разстояние</string>
<string name="index_tours">Пътувания</string> <string name="index_tours">Пътувания</string>
<string name="flat_list_waypoints">Всички</string> <string name="shared_string_all">Всички</string>
<string name="waypoints">Точки</string> <string name="waypoints">Точки</string>
<string name="targets">Дестинации</string> <string name="targets">Дестинации</string>
<string name="way_alarms">Предупреждения</string> <string name="way_alarms">Предупреждения</string>

View file

@ -1756,7 +1756,7 @@
<string name="speak_favorites">Indica els preferits propers</string> <string name="speak_favorites">Indica els preferits propers</string>
<string name="speak_poi">Indica els PDI propers</string> <string name="speak_poi">Indica els PDI propers</string>
<string name="index_tours">Itineraris</string> <string name="index_tours">Itineraris</string>
<string name="flat_list_waypoints">Totes</string> <string name="shared_string_all">Totes</string>
<string name="record_plugin_description">"Aquest connector activa la funcionalitat d\'enregistrar i desar els vostres trajectes, sigui prement sobre la pantalla del mapa el giny de gravació GPX, o sigui desant-los tots en un arxiu GPX automàticament.\n\nLes rutes enregistrades es poden compartir amb els vostres amics o aportar-les per ser utilitzades a OSM. Els atletes poden utilitzar els seus registres per monitoritzar els seus entrenaments. Es pot fer una anàlisi bàsica de les rutes directament a OsmAnd com la durada de cada volta, velocitat mitjana, etc., i, per descomptat, es poden analitzar amb eines especialitzades de tercers. "</string> <string name="record_plugin_description">"Aquest connector activa la funcionalitat d\'enregistrar i desar els vostres trajectes, sigui prement sobre la pantalla del mapa el giny de gravació GPX, o sigui desant-los tots en un arxiu GPX automàticament.\n\nLes rutes enregistrades es poden compartir amb els vostres amics o aportar-les per ser utilitzades a OSM. Els atletes poden utilitzar els seus registres per monitoritzar els seus entrenaments. Es pot fer una anàlisi bàsica de les rutes directament a OsmAnd com la durada de cada volta, velocitat mitjana, etc., i, per descomptat, es poden analitzar amb eines especialitzades de tercers. "</string>
<string name="record_plugin_name">Enregistrament de trajectes</string> <string name="record_plugin_name">Enregistrament de trajectes</string>
<string name="int_hour">h</string> <string name="int_hour">h</string>

View file

@ -1708,7 +1708,7 @@ s často kladenými otázkami.</string>
<string name="duration">Trvání</string> <string name="duration">Trvání</string>
<string name="distance">Vzdálenost</string> <string name="distance">Vzdálenost</string>
<string name="index_tours">Cesty</string> <string name="index_tours">Cesty</string>
<string name="flat_list_waypoints">Všechny</string> <string name="shared_string_all">Všechny</string>
<string name="save_track_to_gpx_globally">"Ukládat trasu do GPX souboru"</string> <string name="save_track_to_gpx_globally">"Ukládat trasu do GPX souboru"</string>
<string name="waypoints">Body na trase</string> <string name="waypoints">Body na trase</string>
<string name="targets">Cíle</string> <string name="targets">Cíle</string>

View file

@ -1719,7 +1719,7 @@
<string name="way_alarms">Trafikadvarsler</string> <string name="way_alarms">Trafikadvarsler</string>
<string name="speak_favorites">Favoritter i nærheden</string> <string name="speak_favorites">Favoritter i nærheden</string>
<string name="speak_poi">Interessepunkt (IP) i nærheden</string> <string name="speak_poi">Interessepunkt (IP) i nærheden</string>
<string name="flat_list_waypoints">Alle</string> <string name="shared_string_all">Alle</string>
<string name="index_tours">Ture</string> <string name="index_tours">Ture</string>
<string name="distance">Afstand</string> <string name="distance">Afstand</string>
<string name="duration">Varighed</string> <string name="duration">Varighed</string>

View file

@ -1938,7 +1938,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an
<string name="duration">Dauer</string> <string name="duration">Dauer</string>
<string name="distance">Distanz</string> <string name="distance">Distanz</string>
<string name="index_tours">Touren</string> <string name="index_tours">Touren</string>
<string name="flat_list_waypoints">Alle</string> <string name="shared_string_all">Alle</string>
<string name="waypoints">Wegpunkte</string> <string name="waypoints">Wegpunkte</string>
<string name="targets">Ziele</string> <string name="targets">Ziele</string>
<string name="way_alarms">Verkehrswarnungen</string> <string name="way_alarms">Verkehrswarnungen</string>

View file

@ -1561,7 +1561,7 @@
<string name="gpx_monitoring_stop">Παύση καταγραφής GPX</string> <string name="gpx_monitoring_stop">Παύση καταγραφής GPX</string>
<string name="gpx_start_new_segment">Έναρξη νέου τμήματος</string> <string name="gpx_start_new_segment">Έναρξη νέου τμήματος</string>
<string name="osmo_settings">Παρακολούθηση OsMo</string> <string name="osmo_settings">Παρακολούθηση OsMo</string>
<string name="flat_list_waypoints">Όλα</string> <string name="shared_string_all">Όλα</string>
<string name="targets">Προορισμοί</string> <string name="targets">Προορισμοί</string>
<string name="way_alarms">Προειδοποιήσεις κυκλοφορίας</string> <string name="way_alarms">Προειδοποιήσεις κυκλοφορίας</string>
<string name="speak_favorites">Ανακοίνωση κοντινών Αγαπημένων</string> <string name="speak_favorites">Ανακοίνωση κοντινών Αγαπημένων</string>

View file

@ -1784,7 +1784,7 @@
<string name="way_alarms">Advertencias de tráfico</string> <string name="way_alarms">Advertencias de tráfico</string>
<string name="speak_favorites">Anunciar favoritos cercanos</string> <string name="speak_favorites">Anunciar favoritos cercanos</string>
<string name="speak_poi">Anunciar PDI cercano</string> <string name="speak_poi">Anunciar PDI cercano</string>
<string name="flat_list_waypoints">Todos</string> <string name="shared_string_all">Todos</string>
<string name="index_tours">Excursiones</string> <string name="index_tours">Excursiones</string>
<string name="int_hour">h</string> <string name="int_hour">h</string>
<string name="duration">Duración</string> <string name="duration">Duración</string>

View file

@ -1903,7 +1903,7 @@ OsmAnd منبع باز است و فعالانه در حال توسعه است.
<string name="duration">مدت زمان</string> <string name="duration">مدت زمان</string>
<string name="distance">فاصله</string> <string name="distance">فاصله</string>
<string name="index_tours">سفرها</string> <string name="index_tours">سفرها</string>
<string name="flat_list_waypoints">همه</string> <string name="shared_string_all">همه</string>
<string name="waypoints">نقاط بین راهی</string> <string name="waypoints">نقاط بین راهی</string>
<string name="targets">مقاصد</string> <string name="targets">مقاصد</string>
<string name="way_alarms">موانع ترافیکی</string> <string name="way_alarms">موانع ترافیکی</string>

View file

@ -1790,7 +1790,7 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="way_alarms">Alertes de circulation</string> <string name="way_alarms">Alertes de circulation</string>
<string name="speak_favorites">Annoncer les favoris proches</string> <string name="speak_favorites">Annoncer les favoris proches</string>
<string name="speak_poi">Annoncer les points d\'intérêt proches</string> <string name="speak_poi">Annoncer les points d\'intérêt proches</string>
<string name="flat_list_waypoints">Tous</string> <string name="shared_string_all">Tous</string>
<string name="index_tours">Tours</string> <string name="index_tours">Tours</string>
<string name="record_plugin_description">"Ce greffon permet d\'enregistrer vos itinéraires au format GPX : soit automatiquement soit grâce à un bouton supplémentaire affiché sur la carte.\n\nLes traces ainsi enregistrées peuvent être partagées avec vos amis ou utilisées pour contribuer à OSM. Les sportifs peuvent utiliser ces enregistrements pour leurs entraînements. Certaines analyses des traces peuvent être réalisées directement dans OmsAnd (comme la vitesse moyenne, la durée de l\'itinéraire ...). Enfin les fichiers GPX locaux peuvent être exportés pour être utilisés par d\'autres applications. "</string> <string name="record_plugin_description">"Ce greffon permet d\'enregistrer vos itinéraires au format GPX : soit automatiquement soit grâce à un bouton supplémentaire affiché sur la carte.\n\nLes traces ainsi enregistrées peuvent être partagées avec vos amis ou utilisées pour contribuer à OSM. Les sportifs peuvent utiliser ces enregistrements pour leurs entraînements. Certaines analyses des traces peuvent être réalisées directement dans OmsAnd (comme la vitesse moyenne, la durée de l\'itinéraire ...). Enfin les fichiers GPX locaux peuvent être exportés pour être utilisés par d\'autres applications. "</string>
<string name="record_plugin_name">Enregistrement d\'itinéraire</string> <string name="record_plugin_name">Enregistrement d\'itinéraire</string>

View file

@ -53,7 +53,7 @@
<string name="duration">Duración</string> <string name="duration">Duración</string>
<string name="distance">Distancia</string> <string name="distance">Distancia</string>
<string name="index_tours">Visitas</string> <string name="index_tours">Visitas</string>
<string name="flat_list_waypoints">Todo</string> <string name="shared_string_all">Todo</string>
<string name="waypoints">Puntos de pasaxe</string> <string name="waypoints">Puntos de pasaxe</string>
<string name="targets">Destinos</string> <string name="targets">Destinos</string>
<string name="announce_gpx_waypoints">Anunciar os puntos de pasaxe do GPX</string> <string name="announce_gpx_waypoints">Anunciar os puntos de pasaxe do GPX</string>

View file

@ -1195,7 +1195,7 @@
<string name="save_track_to_gpx_globally">Spremi rutu kao GPX trag</string> <string name="save_track_to_gpx_globally">Spremi rutu kao GPX trag</string>
<string name="duration">Trajanje</string> <string name="duration">Trajanje</string>
<string name="distance">Udaljenost</string> <string name="distance">Udaljenost</string>
<string name="flat_list_waypoints">Sve</string> <string name="shared_string_all">Sve</string>
<string name="targets">Destinacije</string> <string name="targets">Destinacije</string>
<string name="way_alarms">Prometna upozorenja</string> <string name="way_alarms">Prometna upozorenja</string>
<string name="speak_favorites">Najavi favorite u blizini</string> <string name="speak_favorites">Najavi favorite u blizini</string>

View file

@ -1695,7 +1695,7 @@
<string name="rendering_attr_osmcTraces_description">OSMC stílusú túrajelzések megjelenítése</string> <string name="rendering_attr_osmcTraces_description">OSMC stílusú túrajelzések megjelenítése</string>
<string name="index_tours">Túrák</string> <string name="index_tours">Túrák</string>
<string name="flat_list_waypoints">Összes</string> <string name="shared_string_all">Összes</string>
<string name="waypoints">Útpontok</string> <string name="waypoints">Útpontok</string>
<string name="targets">Úti célok</string> <string name="targets">Úti célok</string>
<string name="way_alarms">Forgalmi figyelmeztetések</string> <string name="way_alarms">Forgalmi figyelmeztetések</string>

View file

@ -1893,7 +1893,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="speak_favorites">Annuncia i preferiti nelle vicinanze</string> <string name="speak_favorites">Annuncia i preferiti nelle vicinanze</string>
<string name="speak_poi">Annuncia PDI nelle vicinanze</string> <string name="speak_poi">Annuncia PDI nelle vicinanze</string>
<string name="index_tours">Itinerari</string> <string name="index_tours">Itinerari</string>
<string name="flat_list_waypoints">Tutto</string> <string name="shared_string_all">Tutto</string>
<string name="record_plugin_description">"Questo componente aggiuntivo attiva la funzionalità di registrazione delle tue tracce o manualmente attraverso il pulsante dedicato nello schermo della mappa oppure automaticamente tenendo traccia di tutti i tuoi spostamenti in un file GPX.\n\nLe tracce registrate possono essere condivise con i tuoi amici o essere usate per chi contribuire a OSM. Gli atleti possono utilizzate le tracce registrate per monitorare i loro allenamenti. Alcuni analisi di base possono essere fatte direttamente in OsmAnd, come il tempo sul giro, la velocità media ecc., le tracce naturalmente possono essere in seguito analizzate con strumenti di analisi esterni. "</string> <string name="record_plugin_description">"Questo componente aggiuntivo attiva la funzionalità di registrazione delle tue tracce o manualmente attraverso il pulsante dedicato nello schermo della mappa oppure automaticamente tenendo traccia di tutti i tuoi spostamenti in un file GPX.\n\nLe tracce registrate possono essere condivise con i tuoi amici o essere usate per chi contribuire a OSM. Gli atleti possono utilizzate le tracce registrate per monitorare i loro allenamenti. Alcuni analisi di base possono essere fatte direttamente in OsmAnd, come il tempo sul giro, la velocità media ecc., le tracce naturalmente possono essere in seguito analizzate con strumenti di analisi esterni. "</string>
<string name="record_plugin_name">Registrazione viaggio</string> <string name="record_plugin_name">Registrazione viaggio</string>
<string name="int_hour">h</string> <string name="int_hour">h</string>

View file

@ -1793,7 +1793,7 @@ POIの更新は利用できません</string>
<string name="route_descr_destination">目的地</string> <string name="route_descr_destination">目的地</string>
<string name="index_tours">旅行</string> <string name="index_tours">旅行</string>
<string name="flat_list_waypoints">全て</string> <string name="shared_string_all">全て</string>
<string name="waypoints">経由地点</string> <string name="waypoints">経由地点</string>
<string name="targets">目的地</string> <string name="targets">目的地</string>
<string name="way_alarms">交通警告</string> <string name="way_alarms">交通警告</string>

View file

@ -1942,7 +1942,7 @@
<string name="duration">경과시간</string> <string name="duration">경과시간</string>
<string name="distance">거리</string> <string name="distance">거리</string>
<string name="index_tours">여행</string> <string name="index_tours">여행</string>
<string name="flat_list_waypoints">모두</string> <string name="shared_string_all">모두</string>
<string name="waypoints">경유지</string> <string name="waypoints">경유지</string>
<string name="targets">도착지</string> <string name="targets">도착지</string>
<string name="way_alarms">교통 경고</string> <string name="way_alarms">교통 경고</string>

View file

@ -1774,7 +1774,7 @@
<string name="shared_string_more">Dar…</string> <string name="shared_string_more">Dar…</string>
<string name="download_additional_maps">Atsiųsti trūkstamus žemėlapius %1$s (%2$d MB)?</string> <string name="download_additional_maps">Atsiųsti trūkstamus žemėlapius %1$s (%2$d MB)?</string>
<string name="index_tours">Turai</string> <string name="index_tours">Turai</string>
<string name="flat_list_waypoints">Visi</string> <string name="shared_string_all">Visi</string>
<string name="targets">Tikslai</string> <string name="targets">Tikslai</string>
<string name="waypoints">Tarpiniai taškai</string> <string name="waypoints">Tarpiniai taškai</string>
<string name="way_alarms">Eismo perspėjimai</string> <string name="way_alarms">Eismo perspėjimai</string>

View file

@ -1782,7 +1782,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="duration">Laiks</string> <string name="duration">Laiks</string>
<string name="distance">Attālums</string> <string name="distance">Attālums</string>
<string name="index_tours">Braucieni</string> <string name="index_tours">Braucieni</string>
<string name="flat_list_waypoints">Visi</string> <string name="shared_string_all">Visi</string>
<string name="waypoints">Ceļapunkti</string> <string name="waypoints">Ceļapunkti</string>
<string name="targets">Galamērķi</string> <string name="targets">Galamērķi</string>
<string name="rendering_value_browse_map_name">Atvērt karti</string> <string name="rendering_value_browse_map_name">Atvērt karti</string>

View file

@ -823,7 +823,7 @@
<string name="duration">Varighet</string> <string name="duration">Varighet</string>
<string name="distance">Avstand</string> <string name="distance">Avstand</string>
<string name="index_tours">Turer</string> <string name="index_tours">Turer</string>
<string name="flat_list_waypoints">Alle</string> <string name="shared_string_all">Alle</string>
<string name="shared_string_more">Mer…</string> <string name="shared_string_more">Mer…</string>
<string name="rendering_value_browse_map_name">Se gjennom kart</string> <string name="rendering_value_browse_map_name">Se gjennom kart</string>
<string name="rendering_attr_coloredBuildings_name">Fargekod bygninger etter type</string> <string name="rendering_attr_coloredBuildings_name">Fargekod bygninger etter type</string>

View file

@ -1889,7 +1889,7 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A
<string name="way_alarms">Filemeldingen</string> <string name="way_alarms">Filemeldingen</string>
<string name="speak_favorites">Meld favorieten in de buurt</string> <string name="speak_favorites">Meld favorieten in de buurt</string>
<string name="speak_poi">Meld POI in de buurt</string> <string name="speak_poi">Meld POI in de buurt</string>
<string name="flat_list_waypoints">Alle</string> <string name="shared_string_all">Alle</string>
<string name="index_tours">Reizen</string> <string name="index_tours">Reizen</string>
<string name="record_plugin_name">Route opname</string> <string name="record_plugin_name">Route opname</string>
<string name="int_hour">u.</string> <string name="int_hour">u.</string>

View file

@ -1884,7 +1884,7 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
<string name="duration">Czas trwania</string> <string name="duration">Czas trwania</string>
<string name="distance">Odległość</string> <string name="distance">Odległość</string>
<string name="index_tours">Wycieczki</string> <string name="index_tours">Wycieczki</string>
<string name="flat_list_waypoints">Wszystkie</string> <string name="shared_string_all">Wszystkie</string>
<string name="waypoints">Punkty trasy</string> <string name="waypoints">Punkty trasy</string>
<string name="targets">Kierunki</string> <string name="targets">Kierunki</string>
<string name="way_alarms">Ostrzeżenia ruchu drogowego</string> <string name="way_alarms">Ostrzeżenia ruchu drogowego</string>

View file

@ -1361,7 +1361,7 @@
<string name="int_hour">h</string> <string name="int_hour">h</string>
<string name="duration">Durată</string> <string name="duration">Durată</string>
<string name="distance">Distanță</string> <string name="distance">Distanță</string>
<string name="flat_list_waypoints">Toate</string> <string name="shared_string_all">Toate</string>
<string name="waypoints">Puncte de referință</string> <string name="waypoints">Puncte de referință</string>
<string name="targets">Destinații</string> <string name="targets">Destinații</string>
<string name="download_additional_maps">Descarcă hărțile lipsă %1$s (%2$d MB)?</string> <string name="download_additional_maps">Descarcă hărțile lipsă %1$s (%2$d MB)?</string>

View file

@ -1705,7 +1705,7 @@
<string name="speak_favorites">Объявлять близлежащие избранные</string> <string name="speak_favorites">Объявлять близлежащие избранные</string>
<string name="speak_poi">Объявлять близлежащие POI</string> <string name="speak_poi">Объявлять близлежащие POI</string>
<string name="index_tours">Туры</string> <string name="index_tours">Туры</string>
<string name="flat_list_waypoints">Все</string> <string name="shared_string_all">Все</string>
<string name="distance">Расстояние</string> <string name="distance">Расстояние</string>
<string name="gpx_info_subtracks">"Подтрек: %1$s "</string> <string name="gpx_info_subtracks">"Подтрек: %1$s "</string>
<string name="route_descr_destination">Пункт назначения</string> <string name="route_descr_destination">Пункт назначения</string>

View file

@ -1714,7 +1714,7 @@
<string name="way_alarms">Avisos de tràficu</string> <string name="way_alarms">Avisos de tràficu</string>
<string name="speak_favorites">Annùntzia sos Prefèrridos a curtzu</string> <string name="speak_favorites">Annùntzia sos Prefèrridos a curtzu</string>
<string name="speak_poi">Annùntzia PDI a curtzu</string> <string name="speak_poi">Annùntzia PDI a curtzu</string>
<string name="flat_list_waypoints">Totus</string> <string name="shared_string_all">Totus</string>
<string name="index_tours">Itineràrios</string> <string name="index_tours">Itineràrios</string>
<string name="record_plugin_description">"Custu plugin ativat sa funtzionalidade de registratzione de sas rastas tuas carcande su pursante in sischermu de sa mapa e ammustrat sas impostaduras pro sa registratzione de sos biàgios tuos in documentos GPX localmente o in lìnia impreande unu servìtziu web. <string name="record_plugin_description">"Custu plugin ativat sa funtzionalidade de registratzione de sas rastas tuas carcande su pursante in sischermu de sa mapa e ammustrat sas impostaduras pro sa registratzione de sos biàgios tuos in documentos GPX localmente o in lìnia impreande unu servìtziu web.
\n\nSas rastas registradas podent èssere cumpartzida cun sos amigos tuos o èssere impreadas pro cuntribuire a OSM. Sos atletas podent impreare sas rastas pro compidare sos allenamentos issoro. Carchi anàlisi de base podet èssere fata deretamente in OsmAnd, comente tempus de giru, lestresa mèdia etc., e sas rastas podent, est craru, èssere analizadas fintzas prus a tardu cun ainas estèrnas de anàlisi. "</string> \n\nSas rastas registradas podent èssere cumpartzida cun sos amigos tuos o èssere impreadas pro cuntribuire a OSM. Sos atletas podent impreare sas rastas pro compidare sos allenamentos issoro. Carchi anàlisi de base podet èssere fata deretamente in OsmAnd, comente tempus de giru, lestresa mèdia etc., e sas rastas podent, est craru, èssere analizadas fintzas prus a tardu cun ainas estèrnas de anàlisi. "</string>

View file

@ -1867,7 +1867,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda,
<string name="way_alarms">Dopravné varovania</string> <string name="way_alarms">Dopravné varovania</string>
<string name="speak_favorites">Oznamovať blízke obľúbené body</string> <string name="speak_favorites">Oznamovať blízke obľúbené body</string>
<string name="speak_poi">Oznamovať blízke body záujmu</string> <string name="speak_poi">Oznamovať blízke body záujmu</string>
<string name="flat_list_waypoints">Všetky</string> <string name="shared_string_all">Všetky</string>
<string name="index_tours">Výlety</string> <string name="index_tours">Výlety</string>
<string name="record_plugin_description">"Tento modul zapne funkciu nahratia a uloženia vašich stôp stlačením tlačidla nahrávania GPX na mape. Taktiež umožňuje nastaviť automatické zaznamenávanie navigačných trás do GPX súboru.\n\nZaznamenané stopy môžete zdieľať s priateľmi alebo odoslať ako príspevok do OSM. Atléti môžu použiť záznamy na sledovanie svojich tréningov. Základná analýza môže byť vykonaná už priamo v OsmAnd, napr. trvanie stopy, priemerná rýchlosť. Stopy môžu následne skúmať ďalšie špecializované programy. "</string> <string name="record_plugin_description">"Tento modul zapne funkciu nahratia a uloženia vašich stôp stlačením tlačidla nahrávania GPX na mape. Taktiež umožňuje nastaviť automatické zaznamenávanie navigačných trás do GPX súboru.\n\nZaznamenané stopy môžete zdieľať s priateľmi alebo odoslať ako príspevok do OSM. Atléti môžu použiť záznamy na sledovanie svojich tréningov. Základná analýza môže byť vykonaná už priamo v OsmAnd, napr. trvanie stopy, priemerná rýchlosť. Stopy môžu následne skúmať ďalšie špecializované programy. "</string>
<string name="record_plugin_name">Zaznamenávanie výletov</string> <string name="record_plugin_name">Zaznamenávanie výletov</string>

View file

@ -1857,7 +1857,7 @@ Seznam držav (praktično ves svet!): Afganistan, Albanija, Alžirija, Andora, A
<string name="int_hour">ur</string> <string name="int_hour">ur</string>
<string name="duration">Trajanje</string> <string name="duration">Trajanje</string>
<string name="distance">Razdalja</string> <string name="distance">Razdalja</string>
<string name="flat_list_waypoints">Vse</string> <string name="shared_string_all">Vse</string>
<string name="targets">Cilji</string> <string name="targets">Cilji</string>
<string name="confirm_every_run">Vsakič vprašaj</string> <string name="confirm_every_run">Vsakič vprašaj</string>
<string name="save_global_track_interval">Splošni interval beleženja</string> <string name="save_global_track_interval">Splošni interval beleženja</string>

View file

@ -1597,7 +1597,7 @@
<string name="speak_favorites">Meddela om närbelägna favoriter</string> <string name="speak_favorites">Meddela om närbelägna favoriter</string>
<string name="speak_poi">Meddela om närbelägna intresssepunkter</string> <string name="speak_poi">Meddela om närbelägna intresssepunkter</string>
<string name="index_tours">Rundturer</string> <string name="index_tours">Rundturer</string>
<string name="flat_list_waypoints">Alla</string> <string name="shared_string_all">Alla</string>
<string name="record_plugin_description">"Denna modul aktiveras funktionen att antingen spela in och spara dina spår genom att du trycker på widgeten GPX-inspelning på kartskärmen eller alla dina rutter sparas automatiskt i en GPX-fil. <string name="record_plugin_description">"Denna modul aktiveras funktionen att antingen spela in och spara dina spår genom att du trycker på widgeten GPX-inspelning på kartskärmen eller alla dina rutter sparas automatiskt i en GPX-fil.
\n\nInspelade spår kan delas ut till vänner eller användas som bidrag till OSM. Idrottsmän kan använda inspelade spår för att följa sin träning. Viss grundläggande spåranalys kan göras direkt i OsmAnd, såsom varvtider, genomsnittshastighet etc och spår kan givetvis också analyseras i efterhand i speciella analysverktyg från tredje part. "</string> \n\nInspelade spår kan delas ut till vänner eller användas som bidrag till OSM. Idrottsmän kan använda inspelade spår för att följa sin träning. Viss grundläggande spåranalys kan göras direkt i OsmAnd, såsom varvtider, genomsnittshastighet etc och spår kan givetvis också analyseras i efterhand i speciella analysverktyg från tredje part. "</string>
<string name="record_plugin_name">Inspelning av resor</string> <string name="record_plugin_name">Inspelning av resor</string>

View file

@ -1906,7 +1906,7 @@ OsmAnd має відкриті сирці і активно розвиваєть
<string name="duration">Тривалісьть</string> <string name="duration">Тривалісьть</string>
<string name="distance">Віддаль</string> <string name="distance">Віддаль</string>
<string name="index_tours">Подорожі</string> <string name="index_tours">Подорожі</string>
<string name="flat_list_waypoints">Усі</string> <string name="shared_string_all">Усі</string>
<string name="waypoints">Путьові точки</string> <string name="waypoints">Путьові точки</string>
<string name="targets">Цілі</string> <string name="targets">Цілі</string>
<string name="way_alarms">Перешкоди</string> <string name="way_alarms">Перешкоди</string>

View file

@ -1711,7 +1711,7 @@
<string name="way_alarms">交通狀況提醒</string> <string name="way_alarms">交通狀況提醒</string>
<string name="speak_favorites">通報附近我的最愛</string> <string name="speak_favorites">通報附近我的最愛</string>
<string name="speak_poi">通報附近 POI</string> <string name="speak_poi">通報附近 POI</string>
<string name="flat_list_waypoints">全部</string> <string name="shared_string_all">全部</string>
<string name="index_tours">旅遊</string> <string name="index_tours">旅遊</string>
<string name="record_plugin_description">"這個外掛元件在地圖螢幕上,以手動點觸 GPX 記錄小工具以啟動去記錄和儲存您軌跡的功能,或是自動記錄您所有的導航路線到 GPX 檔案。\n\n記錄的軌跡可以與您的朋友共享或用作為 OSM 的貢獻。運動選手可以使用記錄的軌跡,監看他們的訓練。一些基本的軌跡分析,可以直接在 OsmAnd 進行,如一圈的時間、平均速度等,而軌跡當然也可於事後在專門的第三方分析工具解析。 "</string> <string name="record_plugin_description">"這個外掛元件在地圖螢幕上,以手動點觸 GPX 記錄小工具以啟動去記錄和儲存您軌跡的功能,或是自動記錄您所有的導航路線到 GPX 檔案。\n\n記錄的軌跡可以與您的朋友共享或用作為 OSM 的貢獻。運動選手可以使用記錄的軌跡,監看他們的訓練。一些基本的軌跡分析,可以直接在 OsmAnd 進行,如一圈的時間、平均速度等,而軌跡當然也可於事後在專門的第三方分析工具解析。 "</string>
<string name="record_plugin_name">正在記錄行程</string> <string name="record_plugin_name">正在記錄行程</string>

View file

@ -10,6 +10,8 @@
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
--> -->
<string name="agps_info">A-GPS info</string> <string name="agps_info">A-GPS info</string>
<string name="shared_string_manage">Manage</string>
<string name="shared_string_edit">Edit</string>
<string name="shared_string_places">Places</string> <string name="shared_string_places">Places</string>
<string name="shared_string_search">Search</string> <string name="shared_string_search">Search</string>
<string name="shared_string_show_description">Show description</string> <string name="shared_string_show_description">Show description</string>
@ -204,7 +206,6 @@
<string name="proxy_pref_descr">Setup a proxy internet communication</string> <string name="proxy_pref_descr">Setup a proxy internet communication</string>
<string name="settings_privacy">Privacy</string> <string name="settings_privacy">Privacy</string>
<string name="points">Points</string> <string name="points">Points</string>
<string name="osm_editing_manage">Manage</string>
<string name="navigation_over_track">Start navigation along track?</string> <string name="navigation_over_track">Start navigation along track?</string>
<string name="avoid_roads_msg">You can trigger an alternative route by selecting roads to avoid</string> <string name="avoid_roads_msg">You can trigger an alternative route by selecting roads to avoid</string>
<string name="speak_pedestrian">Announce pedestrian crosswalks</string> <string name="speak_pedestrian">Announce pedestrian crosswalks</string>
@ -358,7 +359,7 @@
<string name="duration">Duration</string> <string name="duration">Duration</string>
<string name="distance">Distance</string> <string name="distance">Distance</string>
<string name="index_tours">Tours</string> <string name="index_tours">Tours</string>
<string name="flat_list_waypoints">All</string> <string name="shared_string_all">All</string>
<string name="waypoints">Waypoints</string> <string name="waypoints">Waypoints</string>
<string name="targets">Destinations</string> <string name="targets">Destinations</string>
<string name="announce_gpx_waypoints">Announce GPX waypoints</string> <string name="announce_gpx_waypoints">Announce GPX waypoints</string>

View file

@ -194,11 +194,6 @@ public class AppInitializer implements IProgress {
} }
public void startMapActivity(final Activity ctx) {
final Intent mapIndent = new Intent(ctx, ((OsmandApplication)ctx.getApplication()).getAppCustomization().getMapActivity());
ctx.startActivityForResult(mapIndent, 0);
}
// TODO // TODO
private void applicationInstalledFirstTime(final Activity ctx) { private void applicationInstalledFirstTime(final Activity ctx) {
final OsmandApplication app = (OsmandApplication)ctx.getApplication(); final OsmandApplication app = (OsmandApplication)ctx.getApplication();

View file

@ -112,6 +112,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
} }
final double lat = latitude; final double lat = latitude;
final double lon = longitude; final double lon = longitude;
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
newIntent.putExtra(SearchPOIActivity.AMENITY_FILTER, filter.getFilterId()); newIntent.putExtra(SearchPOIActivity.AMENITY_FILTER, filter.getFilterId());
if (searchNearBy) { if (searchNearBy) {
AlertDialog.Builder b = new AlertDialog.Builder(EditPOIFilterActivity.this); AlertDialog.Builder b = new AlertDialog.Builder(EditPOIFilterActivity.this);
@ -261,7 +262,16 @@ public class EditPOIFilterActivity extends OsmandListActivity {
check.setChecked(filter.isTypeAccepted(model)); check.setChecked(filter.isTypeAccepted(model));
TextView text = (TextView) row.findViewById(R.id.filter_poi_label); TextView text = (TextView) row.findViewById(R.id.filter_poi_label);
text.setText(model.getTranslation()); String textString = model.getTranslation();
Set<String> subtypes = filter.getAcceptedSubtypes(model);
if(filter.isTypeAccepted(model)) {
if(subtypes == null) {
textString += " (" + getString(R.string.shared_string_all) +")";
} else {
textString += " (" + subtypes.size() +")";
}
}
text.setText(textString);
addRowListener(model, text, check); addRowListener(model, text, check);
return (row); return (row);
} }

View file

@ -23,6 +23,7 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.SQLiteTileSource; import net.osmand.plus.SQLiteTileSource;
import net.osmand.plus.activities.search.SearchActivity;
import net.osmand.plus.helpers.GpxUiHelper; import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.poi.PoiFiltersHelper; import net.osmand.plus.poi.PoiFiltersHelper;
import net.osmand.plus.poi.PoiLegacyFilter; import net.osmand.plus.poi.PoiLegacyFilter;
@ -262,7 +263,9 @@ public class MapActivityLayers {
for (PoiLegacyFilter f : poiFilters.getTopDefinedPoiFilters()) { for (PoiLegacyFilter f : poiFilters.getTopDefinedPoiFilters()) {
addFilterToList(adapter, list, f); addFilterToList(adapter, list, f);
} }
addFilterToList(adapter, list, poiFilters.getCustomPOIFilter()); list.add(poiFilters.getCustomPOIFilter());
adapter.item(R.string.shared_string_search).iconColor(R.drawable.ic_action_search_dark).reg();
Builder builder = new AlertDialog.Builder(activity); Builder builder = new AlertDialog.Builder(activity);
ListAdapter listAdapter = adapter.createListAdapter(activity, app.getSettings().isLightContent()); ListAdapter listAdapter = adapter.createListAdapter(activity, app.getSettings().isLightContent());
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener(){ builder.setAdapter(listAdapter, new DialogInterface.OnClickListener(){
@ -272,12 +275,10 @@ public class MapActivityLayers {
PoiLegacyFilter pf = list.get(which); PoiLegacyFilter pf = list.get(which);
String filterId = pf.getFilterId(); String filterId = pf.getFilterId();
if(filterId.equals(PoiLegacyFilter.CUSTOM_FILTER_ID)){ if(filterId.equals(PoiLegacyFilter.CUSTOM_FILTER_ID)){
getApplication().getSettings().setPoiFilterForMap(filterId); Intent search = new Intent(activity, SearchActivity.class);
Intent newIntent = new Intent(activity, EditPOIFilterActivity.class); search.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, filterId); activity.getMyApplication().getSettings().SEARCH_TAB.set(SearchActivity.POI_TAB_INDEX);
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LAT, mapView.getLatitude()); activity.startActivity(search);
newIntent.putExtra(EditPOIFilterActivity.SEARCH_LON, mapView.getLongitude());
activity.startActivity(newIntent);
} else { } else {
getApplication().getSettings().setPoiFilterForMap(filterId); getApplication().getSettings().setPoiFilterForMap(filterId);
pf = poiFilters.getFilterById(filterId); pf = poiFilters.getFilterById(filterId);

View file

@ -20,6 +20,7 @@ import net.osmand.data.Amenity;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.osm.PoiType; import net.osmand.osm.PoiType;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
@ -27,6 +28,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.R.color; import net.osmand.plus.R.color;
import net.osmand.plus.activities.EditPOIFilterActivity;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandListActivity; import net.osmand.plus.activities.OsmandListActivity;
import net.osmand.plus.dashboard.DashLocationFragment; import net.osmand.plus.dashboard.DashLocationFragment;
@ -43,6 +45,7 @@ import android.app.AlertDialog;
import android.app.AlertDialog.Builder; import android.app.AlertDialog.Builder;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.AsyncTask; import android.os.AsyncTask;
import android.os.AsyncTask.Status; import android.os.AsyncTask.Status;
@ -106,6 +109,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
private MenuItem showFilterItem; private MenuItem showFilterItem;
private MenuItem showOnMapItem; private MenuItem showOnMapItem;
private MenuItem searchPOILevel; private MenuItem searchPOILevel;
private static int RESULT_REQUEST_CODE = 54;
@Override @Override
public boolean onCreateOptionsMenu(Menu omenu) { public boolean onCreateOptionsMenu(Menu omenu) {
@ -234,15 +238,17 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
} }
} }
}); });
findViewById(R.id.options).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showOptionsMenu(v);
}
});
updateIntent(getIntent());
} }
public void updateIntent(Intent intent) {
Bundle bundle = intent.getExtras();
@Override
protected void onResume() {
super.onResume();
Bundle bundle = this.getIntent().getExtras();
if (bundle.containsKey(SEARCH_LAT) && bundle.containsKey(SEARCH_LON)) { if (bundle.containsKey(SEARCH_LAT) && bundle.containsKey(SEARCH_LON)) {
location = new net.osmand.Location("internal"); //$NON-NLS-1$ location = new net.osmand.Location("internal"); //$NON-NLS-1$
location.setLatitude(bundle.getDouble(SEARCH_LAT)); location.setLatitude(bundle.getDouble(SEARCH_LAT));
@ -254,31 +260,45 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
} }
String filterId = bundle.getString(AMENITY_FILTER); String filterId = bundle.getString(AMENITY_FILTER);
PoiLegacyFilter filter = app.getPoiFilters().getFilterById(filterId); this.filter = app.getPoiFilters().getFilterById(filterId);
if (filter != this.filter) {
this.filter = filter;
if (filter != null) { if (filter != null) {
filter.clearPreviousZoom(); if(filter.isEmpty()) {
showEditActivity(filter);
} else { } else {
amenityAdapter.setNewModel(Collections.<Amenity> emptyList()); filter.clearPreviousZoom();
}
// run query again // run query again
runNewSearchQuery(location, NEW_SEARCH_INIT); runNewSearchQuery(location, NEW_SEARCH_INIT);
} }
} else {
amenityAdapter.setNewModel(Collections.<Amenity> emptyList());
finish();
}
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
updateIntent(intent);
}
@Override
protected void onResume() {
super.onResume();
updateButtonState(); updateButtonState();
if (filter != null) { if (filter != null) {
String text = filter.getFilterByName() != null ? filter.getFilterByName() : ""; String text = filter.getFilterByName() != null ? filter.getFilterByName() : "";
searchFilter.setText(text); searchFilter.setText(text);
searchFilterLayout.setVisibility(text.length() > 0 || isNameSearch() ? View.VISIBLE : View.GONE); searchFilterLayout.setVisibility(text.length() > 0 || isNameSearch() ? View.VISIBLE : View.GONE);
} }
if (filter != null) {
if (searchNearBy) { if (searchNearBy) {
app.getLocationProvider().addLocationListener(this); app.getLocationProvider().addLocationListener(this);
location = app.getLocationProvider().getLastKnownLocation(); location = app.getLocationProvider().getLastKnownLocation();
app.getLocationProvider().resumeAllUpdates(); app.getLocationProvider().resumeAllUpdates();
} }
updateLocation(location); updateLocation(location);
}
// Freeze the direction arrows (reference is constant north) when Accessibility mode = ON, so screen can be read // Freeze the direction arrows (reference is constant north) when Accessibility mode = ON, so screen can be read
// aloud without continuous updates // aloud without continuous updates
@ -301,6 +321,53 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
updateButtonState(); updateButtonState();
} }
private void showOptionsMenu(View v) {
// Show menu with search all, name finder, name finder poi
IconsCache iconsCache = getMyApplication().getIconsCache();
final PopupMenu optionsMenu = new PopupMenu(this, v);
final PoiLegacyFilter f = this.filter;
MenuItem item = optionsMenu.getMenu().add(R.string.shared_string_edit)
.setIcon(iconsCache.getContentIcon(R.drawable.ic_action_edit_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if(!f.isStandardFilter()) {
showEditActivity(f);
} else {
PoiLegacyFilter filter = getMyApplication().getPoiFilters().getCustomPOIFilter();
filter.updateTypesToAccept(f);
showEditActivity(filter);
}
return true;
}
});
optionsMenu.show();
}
private void showEditActivity(PoiLegacyFilter poi) {
Intent newIntent = new Intent(this, EditPOIFilterActivity.class);
// folder selected
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
if(location != null && !searchNearBy) {
newIntent.putExtra(SearchActivity.SEARCH_LAT, location.getLatitude());
newIntent.putExtra(SearchActivity.SEARCH_LON, location.getLongitude());
}
startActivityForResult(newIntent, RESULT_REQUEST_CODE);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RESULT_REQUEST_CODE) {
String filterId = getIntent().getExtras().getString(AMENITY_FILTER);
PoiLegacyFilter filter = app.getPoiFilters().getFilterById(filterId);
if (filter == null || filter.isEmpty()) {
finish();
}
}
}
private void updateButtonState() { private void updateButtonState() {
if (showFilterItem != null) { if (showFilterItem != null) {
showFilterItem.setVisible(filter != null && !isNameSearch()); showFilterItem.setVisible(filter != null && !isNameSearch());
@ -821,4 +888,5 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
builder.create().show(); builder.create().show();
} }
} }

View file

@ -163,14 +163,6 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
} }
} }
private void showEditActivity(PoiLegacyFilter poi) {
Intent newIntent = new Intent(getActivity(), EditPOIFilterActivity.class);
// folder selected
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
updateIntentToLaunch(newIntent);
startActivity(newIntent);
}
@Override @Override
public void onListItemClick(ListView listView, View v, int position, long id) { public void onListItemClick(ListView listView, View v, int position, long id) {
final Object item = ((PoiFiltersAdapter) getListAdapter()).getItem(position); final Object item = ((PoiFiltersAdapter) getListAdapter()).getItem(position);
@ -292,7 +284,7 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
public boolean onMenuItemClick(MenuItem item) { public boolean onMenuItemClick(MenuItem item) {
PoiLegacyFilter filter = getApp().getPoiFilters().getCustomPOIFilter(); PoiLegacyFilter filter = getApp().getPoiFilters().getCustomPOIFilter();
filter.clearFilter(); filter.clearFilter();
showEditActivity(filter); showFilterActivity(filter.getFilterId());
return true; return true;
} }
}); });

View file

@ -42,7 +42,7 @@ public class DashOsmEditsFragment extends DashBaseFragment implements OsmEditsUp
TextView header = ((TextView) view.findViewById(R.id.fav_text)); TextView header = ((TextView) view.findViewById(R.id.fav_text));
header.setText(R.string.osm_settings); header.setText(R.string.osm_settings);
Button manage = ((Button) view.findViewById(R.id.show_all)); Button manage = ((Button) view.findViewById(R.id.show_all));
manage.setText(R.string.osm_editing_manage); manage.setText(R.string.shared_string_manage);
(view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() { (view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {

View file

@ -122,7 +122,7 @@ public class PoiFiltersHelper {
} }
if(filterId.startsWith(PoiLegacyFilter.STD_PREFIX)) { if(filterId.startsWith(PoiLegacyFilter.STD_PREFIX)) {
String typeId = filterId.substring(PoiLegacyFilter.STD_PREFIX.length()); String typeId = filterId.substring(PoiLegacyFilter.STD_PREFIX.length());
PoiType tp = application.getPoiTypes().getPoiTypeByKey(typeId); AbstractPoiType tp = application.getPoiTypes().getAnyPoiTypeByKey(typeId);
if(tp != null) { if(tp != null) {
PoiLegacyFilter lf = new PoiLegacyFilter(tp, application); PoiLegacyFilter lf = new PoiLegacyFilter(tp, application);
cacheTopStandardFilters.add(lf); cacheTopStandardFilters.add(lf);

View file

@ -20,6 +20,7 @@ import net.osmand.data.LatLon;
import net.osmand.osm.AbstractPoiType; import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.MapPoiTypes; import net.osmand.osm.MapPoiTypes;
import net.osmand.osm.PoiCategory; import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiFilter;
import net.osmand.osm.PoiType; import net.osmand.osm.PoiType;
import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
@ -356,6 +357,12 @@ public class PoiLegacyFilter implements SearchPoiTypeFilter {
pt.putTypes(acceptedTypes); pt.putTypes(acceptedTypes);
} }
public void updateTypesToAccept(PoiLegacyFilter f) {
acceptedTypes.clear();
acceptedTypes.putAll(f.acceptedTypes);
filterByName = f.filterByName;
}
public Map<PoiCategory, LinkedHashSet<String>> getAcceptedTypes(){ public Map<PoiCategory, LinkedHashSet<String>> getAcceptedTypes(){
return new LinkedHashMap<PoiCategory, LinkedHashSet<String>>(acceptedTypes); return new LinkedHashMap<PoiCategory, LinkedHashSet<String>>(acceptedTypes);