Merge branch 'master' of https://github.com/osmandapp/Osmand
This commit is contained in:
commit
7da2fd1553
24 changed files with 1216 additions and 399 deletions
19
LICENSE
19
LICENSE
|
@ -44,6 +44,25 @@
|
||||||
* Map icons are taken from sjjb and some are drawn and distributed under Public Domain (except icons8)
|
* Map icons are taken from sjjb and some are drawn and distributed under Public Domain (except icons8)
|
||||||
- https://github.com/osmandapp/OsmAnd-resources/tree/master/icons/svg
|
- https://github.com/osmandapp/OsmAnd-resources/tree/master/icons/svg
|
||||||
|
|
||||||
|
* Subway icons
|
||||||
|
- Moscow: Art Lebedev Studio (http://www.artlebedev.ru/everything/metro/logo/) [Public domain], undefined
|
||||||
|
- Samara: «Metro-logo» (Altoing) - Own work. Under Public domain Commons licensefrom the site - https://commons.wikimedia.org/wiki/File:Metro-logo.svg#/media/File:Metro-logo.svg
|
||||||
|
- Budapest: «BKV metro» (Plexipajzs) - hu:Fájl:BKV metro.svg. Under license Public domain Commons licensefrom the site - https://commons.wikimedia.org/wiki/File:BKV_metro.svg#/media/File:BKV_metro.svg
|
||||||
|
- Saint-Petersburg: «Spb metro logo» (Orange-kun) (vector version) - Vectorised version made with Adobe Illustrator. Under license Public domain Commons licensefrom the site - https://commons.wikimedia.org/wiki/File:Spb_metro_logo.svg#/media/File:Spb_metro_logo.svg
|
||||||
|
- Germany: «U-Bahn» (3247) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:U-Bahn.svg#/media/File:U-Bahn.svg
|
||||||
|
- Wien: «U-Bahn Wien» (Siegele Roland) - Logo der U-Bahn Wien. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:U-Bahn_Wien.svg#/media/File:U-Bahn_Wien.svg
|
||||||
|
- Kazan: «Kazan-metro-Logo» (Россиянин) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Kazan-metro-Logo.svg#/media/File:Kazan-metro-Logo.svg
|
||||||
|
- Tbilisi: «Metro Tbilisi logo» (Carnby) - own work. Under CC BY-SA 3.0 license from site - https://commons.wikimedia.org/wiki/File:Metro_Tbilisi_logo.svg#/media/File:Metro_Tbilisi_logo.svg
|
||||||
|
- Minsk: «Minsk metro logo» (Skip405) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Minsk_metro_logo.svg#/media/File:Minsk_metro_logo.svg
|
||||||
|
- Nizhny Novgorod: «NNMetro» (AlexTref871) - own work. This vector image includes elements borrowed from another image: Coat of arms of Nizhny Novgorod Region.svg.. Under Public domain Commons licensefrom the site - https://commons.wikimedia.org/wiki/File:NNMetro.svg#/media/File:NNMetro.svg
|
||||||
|
- Novosibirsk: «Logo-Nsk-Metro» (AlexTref871) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Logo-Nsk-Metro.svg#/media/File:Logo-Nsk-Metro.svg
|
||||||
|
- Yekaterinburg: «Ekt-metro-logo-01» (AlexTref871) - own work. Under CC BY-SA 4.0 license from site - https://commons.wikimedia.org/wiki/File:Ekt-metro-logo-01.svg#/media/File:Ekt-metro-logo-01.svg
|
||||||
|
- New York: «MTA New York City Subway logo» (Metropolitan Transportation Authority) - http://mta.info/. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:MTA_New_York_City_Subway_logo.svg#/media/File:MTA_New_York_City_Subway_logo.svg
|
||||||
|
- Paris: «Metro-M» (Pb 2001) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Metro-M.svg#/media/File:Metro-M.svg
|
||||||
|
- Madrid: «MetroMadridLogo» (Przemysław Sakrajda) - own work based on (na podstawie) www.metromadrid.es. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:MetroMadridLogo.svg#/media/File:MetroMadridLogo.svg
|
||||||
|
- London: «Underground» (Dream out loud) - own work. Under Public domain Commons license from the site - https://commons.wikimedia.org/wiki/File:Underground.svg#/media/File:Underground.svg
|
||||||
|
- Barcelona: «Logometrobcn» (Javitomad) - own work. Under GFDL license - https://commons.wikimedia.org/wiki/File:Logometrobcn.svg#/media/File:Logometrobcn.svg
|
||||||
|
|
||||||
* Integration with Qt library in (https://github.com/osmandapp/Osmand-core/) - dynamic linking
|
* Integration with Qt library in (https://github.com/osmandapp/Osmand-core/) - dynamic linking
|
||||||
- LGPL (http://www.qt.io/qt-licensing-terms/)
|
- LGPL (http://www.qt.io/qt-licensing-terms/)
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,13 @@ public class OsmandRegions {
|
||||||
Map<String, String> fullMapNamesToDownloadNames = new HashMap<String, String>();
|
Map<String, String> fullMapNamesToDownloadNames = new HashMap<String, String>();
|
||||||
Map<String, String> downloadNamesToFullNames = new HashMap<String, String>();
|
Map<String, String> downloadNamesToFullNames = new HashMap<String, String>();
|
||||||
Map<String, String> fullNamesToLowercaseIndex = new HashMap<String, String>();
|
Map<String, String> fullNamesToLowercaseIndex = new HashMap<String, String>();
|
||||||
|
Map<String, String> fullNamesToParentFullNames = new HashMap<String, String>();
|
||||||
|
Map<String, String> fullNamesToDownloadNames = new HashMap<String, String>();
|
||||||
QuadTree<String> quadTree = null ;
|
QuadTree<String> quadTree = null ;
|
||||||
|
|
||||||
|
public Map<String, String> getFullNamesToLowercaseCopy() {
|
||||||
|
return new HashMap<String, String>(fullNamesToLowercaseIndex);
|
||||||
|
}
|
||||||
|
|
||||||
Integer parentFullName = null;
|
Integer parentFullName = null;
|
||||||
Integer fullNameType = null;
|
Integer fullNameType = null;
|
||||||
|
@ -87,6 +92,14 @@ public class OsmandRegions {
|
||||||
return downloadName.replace('_', ' ');
|
return downloadName.replace('_', ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getLocaleNameByFullName(String fullName) {
|
||||||
|
if (fullNamesToLocaleNames.containsKey(fullName)) {
|
||||||
|
return fullNamesToLocaleNames.get(fullName);
|
||||||
|
} else {
|
||||||
|
return fullName.replace('_', ' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String getDownloadNameIndexLowercase(String downloadName) {
|
public String getDownloadNameIndexLowercase(String downloadName) {
|
||||||
if(downloadName == null) {
|
if(downloadName == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -305,6 +318,14 @@ public class OsmandRegions {
|
||||||
return fullMapNamesToDownloadNames.get(fullname);
|
return fullMapNamesToDownloadNames.get(fullname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDownloadName(String fullname) {
|
||||||
|
return fullNamesToDownloadNames.get(fullname);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getParentFullName(String fullname) {
|
||||||
|
return fullNamesToParentFullNames.get(fullname);
|
||||||
|
}
|
||||||
|
|
||||||
public void initLocaleNames() throws IOException {
|
public void initLocaleNames() throws IOException {
|
||||||
// final Collator clt = OsmAndCollator.primaryCollator();
|
// final Collator clt = OsmAndCollator.primaryCollator();
|
||||||
final Map<String, String> parentRelations = new LinkedHashMap<String, String>();
|
final Map<String, String> parentRelations = new LinkedHashMap<String, String>();
|
||||||
|
@ -323,6 +344,7 @@ public class OsmandRegions {
|
||||||
String parentFullName = getParentFullName(object);
|
String parentFullName = getParentFullName(object);
|
||||||
String fullName = getFullName(object);
|
String fullName = getFullName(object);
|
||||||
if(!Algorithms.isEmpty(parentFullName)) {
|
if(!Algorithms.isEmpty(parentFullName)) {
|
||||||
|
fullNamesToParentFullNames.put(fullName, parentFullName);
|
||||||
parentRelations.put(fullName, parentFullName);
|
parentRelations.put(fullName, parentFullName);
|
||||||
}
|
}
|
||||||
String locName = getLocaleName(object);
|
String locName = getLocaleName(object);
|
||||||
|
@ -350,6 +372,7 @@ public class OsmandRegions {
|
||||||
fullNamesToLowercaseIndex.put(fullName, ind.toString());
|
fullNamesToLowercaseIndex.put(fullName, ind.toString());
|
||||||
String downloadName = getDownloadName(object);
|
String downloadName = getDownloadName(object);
|
||||||
if(downloadName != null) {
|
if(downloadName != null) {
|
||||||
|
fullNamesToDownloadNames.put(fullName, downloadName);
|
||||||
downloadNamesToFullNames.put(downloadName, fullName);
|
downloadNamesToFullNames.put(downloadName, fullName);
|
||||||
if(isDownloadOfType(object, MAP_TYPE)) {
|
if(isDownloadOfType(object, MAP_TYPE)) {
|
||||||
fullMapNamesToDownloadNames.put(fullName, downloadName);
|
fullMapNamesToDownloadNames.put(fullName, downloadName);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<EditText
|
<AutoCompleteTextView
|
||||||
android:id="@+id/valueEditText"
|
android:id="@+id/valueEditText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
@ -967,8 +967,8 @@
|
||||||
<string name="poi_animal_shelter_bird">Прытулак для птушак</string>
|
<string name="poi_animal_shelter_bird">Прытулак для птушак</string>
|
||||||
|
|
||||||
<string name="poi_shower">Душ</string>
|
<string name="poi_shower">Душ</string>
|
||||||
<string name="poi_recycling_centre">Пункт прыёму</string>
|
<string name="poi_recycling_centre">Тып: пункт прыёму</string>
|
||||||
<string name="poi_recycling_container">Кантэйнэр</string>
|
<string name="poi_recycling_container">Тып: кантэйнэр</string>
|
||||||
<string name="poi_recycling_glass">Шкло</string>
|
<string name="poi_recycling_glass">Шкло</string>
|
||||||
<string name="poi_recycling_paper">Папера</string>
|
<string name="poi_recycling_paper">Папера</string>
|
||||||
<string name="poi_recycling_clothes">Вопратка</string>
|
<string name="poi_recycling_clothes">Вопратка</string>
|
||||||
|
@ -1227,4 +1227,5 @@
|
||||||
<string name="poi_information_history">Гістарычная інфармацыя</string>
|
<string name="poi_information_history">Гістарычная інфармацыя</string>
|
||||||
<string name="poi_information_sign">Знак</string>
|
<string name="poi_information_sign">Знак</string>
|
||||||
<string name="poi_information_audioguide">Аўдыягід</string>
|
<string name="poi_information_audioguide">Аўдыягід</string>
|
||||||
|
<string name="poi_cooling_tower">Градзірня</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2106,4 +2106,21 @@
|
||||||
<string name="shared_string_trip_recording">Запіс падарожжа</string>
|
<string name="shared_string_trip_recording">Запіс падарожжа</string>
|
||||||
<string name="shared_string_navigation">Навігацыя</string>
|
<string name="shared_string_navigation">Навігацыя</string>
|
||||||
<string name="osmand_running_in_background">Працуе ў фоне</string>
|
<string name="osmand_running_in_background">Працуе ў фоне</string>
|
||||||
|
<string name="favorite_category_add_new">Дадаць новую</string>
|
||||||
|
<string name="favorite_category_select">Абраць катэгорыю</string>
|
||||||
|
<string name="default_speed_system_descr">Вызначыць сыстэму вымярэньня хуткасьці</string>
|
||||||
|
<string name="default_speed_system">Вымярэньне хуткасьці</string>
|
||||||
|
<string name="nm">м.мілі</string>
|
||||||
|
<string name="si_nm">Марскія мілі</string>
|
||||||
|
<string name="si_kmh">Кілямэтраў за гадзіну</string>
|
||||||
|
<string name="si_mph">Міляў за гадзіну</string>
|
||||||
|
<string name="si_m_s">Мэтраў за сэкунду</string>
|
||||||
|
<string name="si_min_km">Хвілін на кілямэтар</string>
|
||||||
|
<string name="si_min_m">Хвілін на мілю</string>
|
||||||
|
<string name="si_nm_h">Марскіх міль за гадзіну (вузлоў)</string>
|
||||||
|
<string name="nm_h">м.міль/г</string>
|
||||||
|
<string name="min_mile">хв/м</string>
|
||||||
|
<string name="min_km">хв/км</string>
|
||||||
|
<string name="m_s">м/с</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
<string name="poi_traffic_calming_rumble_strip">Rumlestriber</string>
|
<string name="poi_traffic_calming_rumble_strip">Rumlestriber</string>
|
||||||
<string name="poi_traffic_calming_table">Plateau bumb</string>
|
<string name="poi_traffic_calming_table">Plateau bumb</string>
|
||||||
<string name="poi_traffic_calming_choker">Indsnævring</string>
|
<string name="poi_traffic_calming_choker">Indsnævring</string>
|
||||||
<string name="poi_traffic_signals">Trafiklys</string>
|
<string name="poi_traffic_signals">Lyskurv</string>
|
||||||
|
|
||||||
<string name="poi_car_repair">Autoværksted</string>
|
<string name="poi_car_repair">Autoværksted</string>
|
||||||
<string name="poi_service_tyres">Dækservice</string>
|
<string name="poi_service_tyres">Dækservice</string>
|
||||||
|
@ -1443,4 +1443,154 @@
|
||||||
|
|
||||||
<string name="poi_love_hotel">Kærlighedshotel</string>
|
<string name="poi_love_hotel">Kærlighedshotel</string>
|
||||||
|
|
||||||
|
<string name="poi_payment_coins_yes">Accepterer mønter</string>
|
||||||
|
<string name="poi_payment_coins_no">Accepterer ikke mønter</string>
|
||||||
|
<string name="poi_payment_coins_0.5">Accepterer $0,5 mønter</string>
|
||||||
|
<string name="poi_payment_coins_50c12">Accepterer 50c, 1€ og 2€ mønter</string>
|
||||||
|
<string name="poi_payment_telephone_cards_yes">Accepterer telefonkort</string>
|
||||||
|
<string name="poi_payment_telephone_cards_no">Accepterer ikke telefonkort</string>
|
||||||
|
<string name="poi_payment_credit_cards_yes">Accepterer kreditkort</string>
|
||||||
|
<string name="poi_payment_credit_cards_no">Accepterer ikke kreditkort</string>
|
||||||
|
<string name="poi_payment_notes_yes">Accepterer pengesedler</string>
|
||||||
|
<string name="poi_payment_notes_no">Accepterer ikke pengesedler</string>
|
||||||
|
<string name="poi_payment_electronic_purses_yes">Accepterer elektroniske pengepunge</string>
|
||||||
|
<string name="poi_payment_electronic_purses_no">Accepterer ikke elektroniske pengepunge</string>
|
||||||
|
<string name="poi_payment_cash_yes">Accepterer kontanter</string>
|
||||||
|
<string name="poi_payment_cash_no">Accepterer ikke kontanter</string>
|
||||||
|
<string name="poi_payment_debit_cards_yes">Accepterer betalingskort</string>
|
||||||
|
<string name="poi_payment_debit_cards_no">Accepterer ikke betalingskort</string>
|
||||||
|
<string name="poi_payment_bitcoin_yes">Accepterer Bitcoins</string>
|
||||||
|
<string name="poi_payment_bitcoin_no">Accepterer ikke Bitcoins</string>
|
||||||
|
<string name="poi_payment_visa_yes">Accepterer Visakort</string>
|
||||||
|
<string name="poi_payment_visa_no">Accepterer ikke Visakort</string>
|
||||||
|
<string name="poi_payment_mastercard_yes">Accepterer MasterCard</string>
|
||||||
|
<string name="poi_payment_mastercard_no">Accepterer ikke MasterCard</string>
|
||||||
|
<string name="poi_payment_none">Vederlagsfrit</string>
|
||||||
|
<string name="poi_payment_account_cards_yes">Accepterer kontokort</string>
|
||||||
|
<string name="poi_payment_account_cards_no">Accepterer ikke kontokort</string>
|
||||||
|
<string name="poi_payment_maestro_yes">Accepterer Maestro kort</string>
|
||||||
|
<string name="poi_payment_maestro_no">Accepterer ikke Maestro kort</string>
|
||||||
|
<string name="poi_payment_american_express_yes">Accepterer American Express (AMEX) kort</string>
|
||||||
|
<string name="poi_payment_american_express_no">Accepterer ikke American Express (AMEX) kort</string>
|
||||||
|
<string name="poi_payment_diners_club_yes">Accepterer Diners Club kort</string>
|
||||||
|
<string name="poi_payment_diners_club_no">Accepterer ikke Diners Club kort</string>
|
||||||
|
<string name="poi_payment_dkv_yes">Accepterer DKV</string>
|
||||||
|
<string name="poi_payment_dkv_no">"Accepterer ikke DKV"</string>
|
||||||
|
<string name="poi_payment_uta_yes">Accepterer UTA kort</string>
|
||||||
|
<string name="poi_payment_uta_no">Accepterer ikke UTA kort</string>
|
||||||
|
<string name="poi_payment_efectivo_yes">Accepterer Efectivo</string>
|
||||||
|
<string name="poi_payment_efectivo_no">Accepterer ikke Efectivo</string>
|
||||||
|
<string name="poi_payment_girocard_yes">Accepterer girokort</string>
|
||||||
|
<string name="poi_payment_girocard_no">Accepterer ikke girokort</string>
|
||||||
|
<string name="poi_payment_discover_card_yes">Accepterer Discover kort</string>
|
||||||
|
<string name="poi_payment_discover_card_no">Accepterer ikke Discover kort</string>
|
||||||
|
<string name="poi_payment_visa_electron_yes">Accepterer Visa Electron kort</string>
|
||||||
|
<string name="poi_payment_visa_electron_no">Accepterer ikke Visa Electron kort</string>
|
||||||
|
<string name="poi_payment_litecoin_yes">Accepterer Litecoins</string>
|
||||||
|
<string name="poi_payment_litecoin_no">Accepterer ikke Litecoins</string>
|
||||||
|
<string name="poi_payment_cheque_yes">Accepterer checks</string>
|
||||||
|
<string name="poi_payment_cheque_no">Accepterer ikke checks</string>
|
||||||
|
<string name="poi_payment_pikepass_yes">Accepterer PIKEPASS</string>
|
||||||
|
<string name="poi_payment_pikepass_no">Accepterer ikke PIKEPASS</string>
|
||||||
|
<string name="poi_payment_pikepass_designated">Accepterer PIKEPASS (udpeget)</string>
|
||||||
|
<string name="poi_payment_visa_debit_yes">Accepterer Visa kreditkort</string>
|
||||||
|
<string name="poi_payment_visa_debit_no">Accepterer ikke Visa kreditkort</string>
|
||||||
|
<string name="poi_payment_cryptocurrencies_no">Accepterer ikke kryptovalutaer</string>
|
||||||
|
<string name="poi_payment_others_yes">Accepterer andre betalingsformer</string>
|
||||||
|
<string name="poi_payment_others_no">Accepterer ikke andre betalingsformer</string>
|
||||||
|
<string name="poi_payment_routex_yes">Accepterer Routex benzinkort</string>
|
||||||
|
<string name="poi_payment_routex_no">Accepterer ikke Routex benzinkort</string>
|
||||||
|
<string name="poi_payment_bancomat_yes">Accepterer Bancomat</string>
|
||||||
|
<string name="poi_payment_bancomat_no">Accepterer ikke Bancomat</string>
|
||||||
|
<string name="poi_payment_icsf_yes">Accepterer IC billetkort</string>
|
||||||
|
<string name="poi_payment_icsf_no">Accepterer ikke IC billetkort</string>
|
||||||
|
<string name="poi_payment_prepaid_ticket_yes">Accepterer forudbetalte billetter</string>
|
||||||
|
<string name="poi_payment_jcb_yes">Accepterer JCB kort</string>
|
||||||
|
<string name="poi_payment_jcb_no">Accepterer ikke JCB kort</string>
|
||||||
|
<string name="poi_payment_laser_yes">Accepterer Laser kort</string>
|
||||||
|
<string name="poi_payment_laser_no">Accepterer ikke Laser kort</string>
|
||||||
|
<string name="poi_payment_ep_quick_yes">Accepterer Quick kort</string>
|
||||||
|
<string name="poi_payment_ep_quick_no">Accepterer ikke Quick kort</string>
|
||||||
|
<string name="poi_payment_eurowag_yes">Accepterer Eurowag kort</string>
|
||||||
|
<string name="poi_payment_eurowag_no">Accepterer ikke Eurowag kort</string>
|
||||||
|
<string name="poi_payment_e_zpass_yes">Accepterer E‑ZPass</string>
|
||||||
|
<string name="poi_payment_e_zpass_no">Accepterer ikke E‑ZPass</string>
|
||||||
|
<string name="poi_payment_euroshell_yes">Accepterer Euroshell benzinkort</string>
|
||||||
|
<string name="poi_payment_euroshell_no">Accepterer ikke Euroshell benzinkort</string>
|
||||||
|
<string name="poi_payment_kitcard_yes">Accepterer Accepter KITCard</string>
|
||||||
|
<string name="poi_payment_kitcard_no">Accepterer ikke KITCard</string>
|
||||||
|
<string name="poi_payment_westfalen_card_yes">Accepterer Westfalen kort</string>
|
||||||
|
<string name="poi_payment_westfalen_card_no">Accepterer ikke Westfalen kort</string>
|
||||||
|
<string name="poi_payment_v_pay_yes">Accepterer V PAY kort</string>
|
||||||
|
<string name="poi_payment_v_pay_no">Accepterer ikke V PAY kort</string>
|
||||||
|
<string name="poi_payment_dogecoin_yes">Accepterer Dogecoin</string>
|
||||||
|
<string name="poi_payment_dogecoin_no">Accepterer ikke Dogecoin</string>
|
||||||
|
<string name="poi_payment_cibus_yes">Accepterer Cibus kort</string>
|
||||||
|
<string name="poi_payment_cibus_no">Accepterer ikke Cibus kort</string>
|
||||||
|
<string name="poi_payment_wire_transfer_yes">Accepterer bankoverførsler</string>
|
||||||
|
<string name="poi_payment_wire_transfer_no">Accepterer ikke bankoverførsler</string>
|
||||||
|
<string name="poi_payment_ep_cash_yes">Accepterer kontanter (Geldkarte)</string>
|
||||||
|
<string name="poi_payment_ep_cash_no">Accepterer ikke kontanter (Geldkarte)</string>
|
||||||
|
<string name="poi_payment_ep_proton_yes">Accepterer Proton kort</string>
|
||||||
|
<string name="poi_payment_ep_proton_no">Accepterer ikke Proton kort</string>
|
||||||
|
<string name="poi_payment_ep_avant_yes">Accepterer AvantCard</string>
|
||||||
|
<string name="poi_payment_ep_avant_no">Accepterer ikke AvantCard</string>
|
||||||
|
<string name="poi_payment_ep_mep_yes">Accepterer MEP</string>
|
||||||
|
<string name="poi_payment_ep_mep_no">Accepterer ikke MEP</string>
|
||||||
|
<string name="poi_payment_ep_minipay_yes">Accepterer Minipay</string>
|
||||||
|
<string name="poi_payment_ep_minipay_no">Accepterer ikke Minipay</string>
|
||||||
|
<string name="poi_payment_ep_minicash_yes">Accepterer miniCash</string>
|
||||||
|
<string name="poi_payment_ep_minicash_no">Accepterer ikke miniCash</string>
|
||||||
|
<string name="poi_payment_ep_moneo_yes">Accepterer Moneo</string>
|
||||||
|
<string name="poi_payment_ep_moneo_no">Accepterer ikke Moneo</string>
|
||||||
|
<string name="poi_payment_ep_monedero4b_yes">Accepterer Monedero 4B</string>
|
||||||
|
<string name="poi_payment_ep_monedero4b_no">Accepterer ikke Monedero 4B</string>
|
||||||
|
<string name="poi_payment_ep_monedero_yes">Accepterer Monedero</string>
|
||||||
|
<string name="poi_payment_ep_monedero_no">Accepterer ikke Monedero</string>
|
||||||
|
<string name="poi_payment_bankaxess_yes">Accepterer BankAxess</string>
|
||||||
|
<string name="poi_payment_bankaxess_no">Accepterer ikke BankAxess</string>
|
||||||
|
<string name="poi_payment_coinkite_yes">Accepterer Coinkite</string>
|
||||||
|
<string name="poi_payment_coinkite_no">Accepterer ikke Coinkite</string>
|
||||||
|
<string name="poi_payment_roadrunner_yes">Accepterer Roadrunner kort</string>
|
||||||
|
<string name="poi_payment_roadrunner_no">Accepterer ikke Roadrunner kort</string>
|
||||||
|
<string name="poi_payment_svg_yes">Accepterer SVG</string>
|
||||||
|
<string name="poi_payment_svg_no">Accepterer ikke SVG</string>
|
||||||
|
<string name="poi_payment_sms_yes">Accepterer SMS betalinger</string>
|
||||||
|
<string name="poi_payment_sms_no">Accepterer ikke SMS betalinger</string>
|
||||||
|
<string name="poi_payment_ov_chipkaart_yes">Accepterer OV-Chipkaart</string>
|
||||||
|
<string name="poi_payment_ov_chipkaart_no">Accepterer ikke OV-Chipkaart</string>
|
||||||
|
<string name="poi_payment_oyster_yes">Accepterer Oyster kort</string>
|
||||||
|
<string name="poi_payment_oyster_no">Accepterer ikke Oyster kort</string>
|
||||||
|
<string name="poi_payment_sube_yes">Accepterer SUBE kort</string>
|
||||||
|
<string name="poi_payment_sube_no">Accepterer ikke SUBE kort</string>
|
||||||
|
<string name="poi_payment_via_verde_yes">Accepterer Via Verde</string>
|
||||||
|
<string name="poi_payment_via_verde_no">Accepterer ikke Via Verde</string>
|
||||||
|
<string name="poi_payment_meal_voucher_yes">Accepterer spisebilletter</string>
|
||||||
|
<string name="poi_payment_meal_voucher_no">Accepterer ikke spisebilletter</string>
|
||||||
|
<string name="poi_payment_paypal_yes">Accepterer PayPal</string>
|
||||||
|
<string name="poi_payment_paypal_no">Accepterer ikke PayPal</string>
|
||||||
|
<string name="poi_payment_u_key_yes">Accepterer U-Key</string>
|
||||||
|
<string name="poi_payment_u_key_no">Accepterer ikke U-Key</string>
|
||||||
|
<string name="poi_payment_token_yes">Accepterer poletter</string>
|
||||||
|
<string name="poi_payment_token_no">Accepterer ikke poletter</string>
|
||||||
|
<string name="poi_payment_gift_card_yes">Accepterer gavekort</string>
|
||||||
|
<string name="poi_payment_gift_card_no">Accepterer ikke gavekort</string>
|
||||||
|
<string name="poi_payment_golden_crown_yes">Accepterer Golden Crown kort</string>
|
||||||
|
<string name="poi_payment_golden_crown_no">Accepterer ikke Golden Crown kort</string>
|
||||||
|
<string name="poi_payment_pro100_yes">Accepterer PRO100 kort</string>
|
||||||
|
<string name="poi_payment_pro100_no">Accepterer ikke PRO100 kort</string>
|
||||||
|
<string name="poi_payment_union_card_yes">Accepterer Union kort</string>
|
||||||
|
<string name="poi_payment_union_card_no">Accepterer ikke Union kort</string>
|
||||||
|
<string name="poi_payment_mtsmoney_yes">Accepterer MTS-Money</string>
|
||||||
|
<string name="poi_payment_mtsmoney_no">Accepterer ikke MTS-Money</string>
|
||||||
|
<string name="poi_payment_yandexmoney_yes">Accepterer Yandex.Money</string>
|
||||||
|
<string name="poi_payment_yandexmoney_no">Accepterer ikke Yandex.Money</string>
|
||||||
|
<string name="poi_description_payment">Beskrivelse af betalingsmetoder</string>
|
||||||
|
|
||||||
|
<string name="poi_internet_access_yes">Internetadgang: Ja</string>
|
||||||
|
<string name="poi_internet_access_no">Internet access: nej</string>
|
||||||
|
|
||||||
|
<string name="poi_internet_access_fee_yes">Opkræver gebyrer for internettetadgang</string>
|
||||||
|
<string name="poi_internet_access_fee_no">Opkræver ikke gebyrer for internettetadgang</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2081,4 +2081,6 @@
|
||||||
<string name="min_km">min/km</string>
|
<string name="min_km">min/km</string>
|
||||||
<string name="m_s">m/s</string>
|
<string name="m_s">m/s</string>
|
||||||
|
|
||||||
|
<string name="favorite_category_add_new">Añadir nuevo</string>
|
||||||
|
<string name="favorite_category_select">Elegir categoría</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2181,4 +2181,6 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
|
||||||
<string name="min_km">min/km</string>
|
<string name="min_km">min/km</string>
|
||||||
<string name="m_s">m/s</string>
|
<string name="m_s">m/s</string>
|
||||||
|
|
||||||
|
<string name="favorite_category_add_new">Ajouter une catégorie</string>
|
||||||
|
<string name="favorite_category_select">Sélectionner une catégorie</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2202,4 +2202,6 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
|
||||||
<string name="min_km">min/km</string>
|
<string name="min_km">min/km</string>
|
||||||
<string name="m_s">m/s</string>
|
<string name="m_s">m/s</string>
|
||||||
|
|
||||||
|
<string name="favorite_category_add_new">Aggiungi nuova</string>
|
||||||
|
<string name="favorite_category_select">Scegli la categoria</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="poi_bakery">Булочная</string>
|
<string name="poi_bakery">Булочная</string>
|
||||||
<string name="poi_alcohol">Винно-водочный магазин</string>
|
<string name="poi_alcohol">Винно-водочный магазин</string>
|
||||||
|
@ -781,6 +781,8 @@
|
||||||
<string name="poi_internet_access_wired">Доступ в Интернет: проводное подключение</string>
|
<string name="poi_internet_access_wired">Доступ в Интернет: проводное подключение</string>
|
||||||
<string name="poi_internet_access_public">Доступ в Интернет: общедоступный</string>
|
<string name="poi_internet_access_public">Доступ в Интернет: общедоступный</string>
|
||||||
<string name="poi_internet_access_service">Доступ в Интернет: сервис</string>
|
<string name="poi_internet_access_service">Доступ в Интернет: сервис</string>
|
||||||
|
<string name="poi_internet_access_yes">Доступ в Интернет</string>
|
||||||
|
<string name="poi_internet_access_no">Нет доступа в Интернет</string>
|
||||||
|
|
||||||
<string name="poi_farm">Фермерский магазин</string>
|
<string name="poi_farm">Фермерский магазин</string>
|
||||||
<string name="poi_personal_transport">Личный транспорт</string>
|
<string name="poi_personal_transport">Личный транспорт</string>
|
||||||
|
@ -1199,7 +1201,7 @@
|
||||||
<string name="poi_piste_grooming_backcountry">Обслуживание трассы: кросс-кантри</string>
|
<string name="poi_piste_grooming_backcountry">Обслуживание трассы: кросс-кантри</string>
|
||||||
<string name="poi_piste_grooming_scooter">Обслуживание трассы: снежный скутер</string>
|
<string name="poi_piste_grooming_scooter">Обслуживание трассы: снежный скутер</string>
|
||||||
<string name="poi_piste_grooming_skating">Обслуживание трассы: конёк</string>
|
<string name="poi_piste_grooming_skating">Обслуживание трассы: конёк</string>
|
||||||
<string name="poi_piste_grooming_no">Обслуживание трассы: не обслуживаемая</string>
|
<string name="poi_piste_grooming_no">Обслуживание трассы: необслуживаемая</string>
|
||||||
<string name="poi_piste_grooming_mogul">Обслуживание трассы: могул</string>
|
<string name="poi_piste_grooming_mogul">Обслуживание трассы: могул</string>
|
||||||
|
|
||||||
<string name="poi_garden_type_community">Тип сада: общественный</string>
|
<string name="poi_garden_type_community">Тип сада: общественный</string>
|
||||||
|
@ -1257,4 +1259,149 @@
|
||||||
|
|
||||||
<string name="poi_love_hotel">Love-отель</string>
|
<string name="poi_love_hotel">Love-отель</string>
|
||||||
|
|
||||||
</resources>
|
<string name="poi_payment_coins_yes">Принимаются монеты</string>
|
||||||
|
<string name="poi_payment_coins_no">Монеты не принимаются</string>
|
||||||
|
<string name="poi_payment_coins_0.5">Принимаются монеты по $0.5</string>
|
||||||
|
<string name="poi_payment_coins_50c12">Принимаются монеты по 50c, 1€ и 2€</string>
|
||||||
|
<string name="poi_payment_telephone_cards_yes">Принимаются телефонные карты</string>
|
||||||
|
<string name="poi_payment_telephone_cards_no">Телефонные карты не принимаются</string>
|
||||||
|
<string name="poi_payment_credit_cards_yes">Принимаются кредитные карты</string>
|
||||||
|
<string name="poi_payment_credit_cards_no">Кредитные карты не принимаются</string>
|
||||||
|
<string name="poi_payment_notes_yes">Принимаются банкноты</string>
|
||||||
|
<string name="poi_payment_notes_no">Банкноты не принимаются</string>
|
||||||
|
<string name="poi_payment_electronic_purses_yes">Принимаются электронные кошельки</string>
|
||||||
|
<string name="poi_payment_electronic_purses_no">Электронные кошельки не принимаются</string>
|
||||||
|
<string name="poi_payment_cash_yes">Принимаются наличные</string>
|
||||||
|
<string name="poi_payment_cash_no">Наличные не принимаются</string>
|
||||||
|
<string name="poi_payment_debit_cards_yes">Принимаются дебетовые карты</string>
|
||||||
|
<string name="poi_payment_debit_cards_no">Дбетовые карты не принимаются</string>
|
||||||
|
<string name="poi_payment_bitcoin_yes">Принимаются биткоины</string>
|
||||||
|
<string name="poi_payment_bitcoin_no">Биткоины не принимаются</string>
|
||||||
|
<string name="poi_payment_visa_yes">Принимаются карты Visa</string>
|
||||||
|
<string name="poi_payment_visa_no">Карты Visa не принимаются</string>
|
||||||
|
<string name="poi_payment_mastercard_yes">Принимаются карты MasterCard</string>
|
||||||
|
<string name="poi_payment_mastercard_no">Карты MasterCard не принимаются</string>
|
||||||
|
<string name="poi_payment_none">Бесплатно</string>
|
||||||
|
<string name="poi_payment_maestro_yes">Принимаются карты Maestro</string>
|
||||||
|
<string name="poi_payment_maestro_no">Карты Maestro не принимаются</string>
|
||||||
|
<string name="poi_payment_american_express_yes">Принимаются карты American Express (AMEX)</string>
|
||||||
|
<string name="poi_payment_american_express_no">Карты American Express (AMEX) не принимаются</string>
|
||||||
|
<string name="poi_payment_diners_club_yes">Принимаются карты Diners Club</string>
|
||||||
|
<string name="poi_payment_diners_club_no">Карты Diners Club не принимаются</string>
|
||||||
|
<string name="poi_payment_dkv_yes">Принимаются DKV</string>
|
||||||
|
<string name="poi_payment_dkv_no">DKV не принимаются</string>
|
||||||
|
<string name="poi_payment_uta_yes">Принимаются карты UTA</string>
|
||||||
|
<string name="poi_payment_uta_no">Карты UTA не принимаются</string>
|
||||||
|
<string name="poi_payment_efectivo_yes">Принимаются Efectivo</string>
|
||||||
|
<string name="poi_payment_efectivo_no">Efectivo не принимаются</string>
|
||||||
|
<string name="poi_payment_girocard_yes">Принимаются Girocard</string>
|
||||||
|
<string name="poi_payment_girocard_no">Girocard не принимаются</string>
|
||||||
|
<string name="poi_payment_discover_card_yes">Принимаются Discover Card</string>
|
||||||
|
<string name="poi_payment_discover_card_no">Discover Card не принимаются</string>
|
||||||
|
<string name="poi_payment_visa_electron_yes">Принимаются карты Visa Electron</string>
|
||||||
|
<string name="poi_payment_visa_electron_no">Карты Visa Electron не принимаются</string>
|
||||||
|
<string name="poi_payment_litecoin_yes">Принимаются Litecoins</string>
|
||||||
|
<string name="poi_payment_litecoin_no">Litecoins не принимаются</string>
|
||||||
|
<string name="poi_payment_cheque_yes">Принимаются чеки</string>
|
||||||
|
<string name="poi_payment_cheque_no">Чеки не принимаются</string>
|
||||||
|
<string name="poi_payment_pikepass_yes">Принимается PIKEPASS</string>
|
||||||
|
<string name="poi_payment_pikepass_no">PIKEPASS не принимается</string>
|
||||||
|
<string name="poi_payment_pikepass_designated">Только для оплаты через PIKEPASS</string>
|
||||||
|
<string name="poi_payment_visa_debit_yes">Принимаются дебетовые карты Visa</string>
|
||||||
|
<string name="poi_payment_visa_debit_no">Дебетовые карты Visa не принимаются</string>
|
||||||
|
<string name="poi_payment_cryptocurrencies_no">Криптовалюты не принимаются</string>
|
||||||
|
<string name="poi_payment_others_yes">Принимаются другие методы оплаты</string>
|
||||||
|
<string name="poi_payment_others_no">Другие методы оплаты не принимаются</string>
|
||||||
|
<string name="poi_payment_routex_yes">Принимаются топливные карты Routex</string>
|
||||||
|
<string name="poi_payment_routex_no">Топливные карты Routex не принимаются</string>
|
||||||
|
<string name="poi_payment_bancomat_yes">Принимается Bancomat</string>
|
||||||
|
<string name="poi_payment_bancomat_no">Bancomat не принимается</string>
|
||||||
|
<string name="poi_payment_icsf_yes">Принимаются карты IC Stored Fare</string>
|
||||||
|
<string name="poi_payment_icsf_no">Карты IC Stored Fare не принимаются</string>
|
||||||
|
<string name="poi_payment_prepaid_ticket_yes">Принимаются prepaid tickets</string>
|
||||||
|
<string name="poi_payment_jcb_yes">Принимаются карты JCB</string>
|
||||||
|
<string name="poi_payment_jcb_no">Карты JCB не принимаются</string>
|
||||||
|
<string name="poi_payment_laser_yes">Принимаются карты Laser</string>
|
||||||
|
<string name="poi_payment_laser_no">Карты Laser не принимаются</string>
|
||||||
|
<string name="poi_payment_ep_quick_yes">Принимаются карты Quick</string>
|
||||||
|
<string name="poi_payment_ep_quick_no">Карты Quick не принимаются</string>
|
||||||
|
<string name="poi_payment_eurowag_yes">Принимаются карты Eurowag</string>
|
||||||
|
<string name="poi_payment_eurowag_no">Карты Eurowag не принимаются</string>
|
||||||
|
<string name="poi_payment_e_zpass_yes">Принимается E‑ZPass</string>
|
||||||
|
<string name="poi_payment_e_zpass_no">E‑ZPass не принимается</string>
|
||||||
|
<string name="poi_payment_euroshell_yes">Принимаются топливные карты Euroshell</string>
|
||||||
|
<string name="poi_payment_euroshell_no">Топливные карты Euroshell не принимаются</string>
|
||||||
|
<string name="poi_payment_kitcard_yes">Принимается KITCard</string>
|
||||||
|
<string name="poi_payment_kitcard_no">KITCard не принимается</string>
|
||||||
|
<string name="poi_payment_westfalen_card_yes">Принимаются карты Westfalen</string>
|
||||||
|
<string name="poi_payment_westfalen_card_no">Карты Westfalen не принимаются</string>
|
||||||
|
<string name="poi_payment_v_pay_yes">Принимаются карты V PAY</string>
|
||||||
|
<string name="poi_payment_v_pay_no">Карты V PAY не принимаются</string>
|
||||||
|
<string name="poi_payment_dogecoin_yes">Принимаются Dogecoin</string>
|
||||||
|
<string name="poi_payment_dogecoin_no">Dogecoin не принимаются</string>
|
||||||
|
<string name="poi_payment_cibus_yes">Принимаются карты Cibus</string>
|
||||||
|
<string name="poi_payment_cibus_no">Карты Cibus не принимаются</string>
|
||||||
|
<string name="poi_payment_wire_transfer_yes">Принимаются денежные переводы</string>
|
||||||
|
<string name="poi_payment_wire_transfer_no">Денежные переводы не принимаются</string>
|
||||||
|
<string name="poi_payment_ep_cash_yes">Принимаются Cash (Geldkarte)</string>
|
||||||
|
<string name="poi_payment_ep_cash_no">Cash (Geldkarte) не принимаются</string>
|
||||||
|
<string name="poi_payment_ep_proton_yes">Принимаются карты Proton</string>
|
||||||
|
<string name="poi_payment_ep_proton_no">Карты Proton не принимаются</string>
|
||||||
|
<string name="poi_payment_ep_avant_yes">Принимаются AvantCard</string>
|
||||||
|
<string name="poi_payment_ep_avant_no">AvantCard не принимаются</string>
|
||||||
|
<string name="poi_payment_ep_mep_yes">Принимается MEP</string>
|
||||||
|
<string name="poi_payment_ep_mep_no">MEP не принимется</string>
|
||||||
|
<string name="poi_payment_ep_minipay_yes">Принимается Minipay</string>
|
||||||
|
<string name="poi_payment_ep_minipay_no">Minipay не принимается</string>
|
||||||
|
<string name="poi_payment_ep_minicash_yes">Принимается miniCash</string>
|
||||||
|
<string name="poi_payment_ep_minicash_no">miniCash не принимается</string>
|
||||||
|
<string name="poi_payment_ep_moneo_yes">Принимается Moneo</string>
|
||||||
|
<string name="poi_payment_ep_moneo_no">Moneo не принимается</string>
|
||||||
|
<string name="poi_payment_ep_monedero4b_yes">Принимается Monedero 4B</string>
|
||||||
|
<string name="poi_payment_ep_monedero4b_no">Monedero 4B не принимается</string>
|
||||||
|
<string name="poi_payment_ep_monedero_yes">Принимается Monedero</string>
|
||||||
|
<string name="poi_payment_ep_monedero_no">Monedero не принимается</string>
|
||||||
|
<string name="poi_payment_bankaxess_yes">Принимается BankAxess</string>
|
||||||
|
<string name="poi_payment_bankaxess_no">BankAxess не принимается</string>
|
||||||
|
<string name="poi_payment_coinkite_yes">Принимается оплата через Coinkite</string>
|
||||||
|
<string name="poi_payment_coinkite_no">Оплата через Coinkite не принимается</string>
|
||||||
|
<string name="poi_payment_roadrunner_yes">Принимаются карты Roadrunner</string>
|
||||||
|
<string name="poi_payment_roadrunner_no">Roadrunner карты не принимаются</string>
|
||||||
|
<string name="poi_payment_svg_yes">Принимаются SVG</string>
|
||||||
|
<string name="poi_payment_svg_no">SVG не принимаются</string>
|
||||||
|
<string name="poi_payment_sms_yes">Принимаются СМС-платежи</string>
|
||||||
|
<string name="poi_payment_sms_no">СМС-платежи не принимаются</string>
|
||||||
|
<string name="poi_payment_ov_chipkaart_yes">Принимаются OV-Chipkaart</string>
|
||||||
|
<string name="poi_payment_ov_chipkaart_no">OV-Chipkaart не принимаются</string>
|
||||||
|
<string name="poi_payment_oyster_yes">Принимаются карты Oyster</string>
|
||||||
|
<string name="poi_payment_oyster_no">Карты Oyster не принимаются</string>
|
||||||
|
<string name="poi_payment_sube_yes">Принимаются карты SUBE</string>
|
||||||
|
<string name="poi_payment_sube_no">Карты SUBE не принимаются</string>
|
||||||
|
<string name="poi_payment_via_verde_yes">Принимается Via Verde</string>
|
||||||
|
<string name="poi_payment_via_verde_no">Via Verde не принимается</string>
|
||||||
|
<string name="poi_payment_meal_voucher_yes">Принимаются талоны на питание</string>
|
||||||
|
<string name="poi_payment_meal_voucher_no">Талоны на питание не принимаются</string>
|
||||||
|
<string name="poi_payment_paypal_yes">Принимается оплата через PayPal</string>
|
||||||
|
<string name="poi_payment_paypal_no">Оплата через PayPal не принимается</string>
|
||||||
|
<string name="poi_payment_u_key_yes">Принимаются U-Key</string>
|
||||||
|
<string name="poi_payment_u_key_no">U-Key не принимаются</string>
|
||||||
|
<string name="poi_payment_token_yes">Принимаются жетоны</string>
|
||||||
|
<string name="poi_payment_token_no">Жетоны не принимаются</string>
|
||||||
|
<string name="poi_payment_gift_card_yes">Принимаются подарочные карты</string>
|
||||||
|
<string name="poi_payment_gift_card_no">Подарочные карты не принимаются</string>
|
||||||
|
<string name="poi_payment_golden_crown_yes">Принимаются карты Золотая Корона</string>
|
||||||
|
<string name="poi_payment_golden_crown_no">Карты Золотая Корона не принимаются</string>
|
||||||
|
<string name="poi_payment_pro100_yes">Принимаются карты ПРО100</string>
|
||||||
|
<string name="poi_payment_pro100_no">Карты ПРО100 не принимаются</string>
|
||||||
|
<string name="poi_payment_union_card_yes">Принимаются карты Union Card</string>
|
||||||
|
<string name="poi_payment_union_card_no">Карты Union Card не принимаются</string>
|
||||||
|
<string name="poi_payment_mtsmoney_yes">Принимается оплата через MТС-Деньги</string>
|
||||||
|
<string name="poi_payment_mtsmoney_no">Оплата через MТС-Деньги не принимается</string>
|
||||||
|
<string name="poi_payment_yandexmoney_yes">Принимается оплата через Яндекс.Деньги</string>
|
||||||
|
<string name="poi_payment_yandexmoney_no">Оплата через Яндекс.Деньги не принимается</string>
|
||||||
|
<string name="poi_description_payment">Описание способа оплаты</string>
|
||||||
|
|
||||||
|
<string name="poi_internet_access_fee_yes">Взимается плата за интернет</string>
|
||||||
|
<string name="poi_internet_access_fee_no">Плата за интернет не взимается</string>
|
||||||
|
|
||||||
|
</resources>
|
|
@ -2295,4 +2295,24 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda,
|
||||||
<string name="favourites_edit_dialog_title">Informácie o obľúbenom bode</string>
|
<string name="favourites_edit_dialog_title">Informácie o obľúbenom bode</string>
|
||||||
<string name="favourites_context_menu_add">Pridať obľúbený bod</string>
|
<string name="favourites_context_menu_add">Pridať obľúbený bod</string>
|
||||||
<string name="roads">Cesty</string>
|
<string name="roads">Cesty</string>
|
||||||
</resources>
|
<string name="favorite_category_add_new">Pridať nový</string>
|
||||||
|
<string name="favorite_category_select">Zvoľte kategóriu</string>
|
||||||
|
<string name="default_speed_system_descr">Zvoľte spôsob merania rýchlosti</string>
|
||||||
|
<string name="default_speed_system">Meranie rýchlosti</string>
|
||||||
|
<string name="nm">nm</string>
|
||||||
|
<string name="si_nm">Námorné míle</string>
|
||||||
|
<string name="si_kmh">Kilometre za hodinu</string>
|
||||||
|
<string name="si_mph">Míle za hodinu</string>
|
||||||
|
<string name="si_m_s">Metre za sekundu</string>
|
||||||
|
<string name="si_min_km">Minúty za kilometer</string>
|
||||||
|
<string name="si_min_m">Minúty za míľu</string>
|
||||||
|
<string name="si_nm_h">Námorné míle za hodinu (uzly)</string>
|
||||||
|
<string name="nm_h">nm/h</string>
|
||||||
|
<string name="min_mile">min/m</string>
|
||||||
|
<string name="min_km">min/km</string>
|
||||||
|
<string name="m_s">m/s</string>
|
||||||
|
|
||||||
|
<string name="shared_string_trip_recording">Nahrávanie výletu</string>
|
||||||
|
<string name="shared_string_navigation">Navigácia</string>
|
||||||
|
<string name="osmand_running_in_background">Beh v pozadí</string>
|
||||||
|
</resources>
|
||||||
|
|
|
@ -2017,4 +2017,6 @@
|
||||||
<string name="shared_string_trip_recording">Trippinspelning</string>
|
<string name="shared_string_trip_recording">Trippinspelning</string>
|
||||||
<string name="shared_string_navigation">Navigering</string>
|
<string name="shared_string_navigation">Navigering</string>
|
||||||
<string name="osmand_running_in_background">Körs i bakgrunden</string>
|
<string name="osmand_running_in_background">Körs i bakgrunden</string>
|
||||||
|
<string name="favorite_category_add_new">Lägg till ny</string>
|
||||||
|
<string name="favorite_category_select">Välj kategori</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -1422,4 +1422,33 @@
|
||||||
|
|
||||||
<string name="poi_love_hotel">情侶賓館</string>
|
<string name="poi_love_hotel">情侶賓館</string>
|
||||||
|
|
||||||
</resources>
|
<string name="poi_payment_coins_yes">接受硬幣</string>
|
||||||
|
<string name="poi_payment_coins_no">不接受硬幣</string>
|
||||||
|
<string name="poi_payment_coins_0.5">接受 0.5 美元硬幣</string>
|
||||||
|
<string name="poi_payment_coins_50c12">接受 50 分、1 歐元和 2 歐元硬幣</string>
|
||||||
|
<string name="poi_payment_telephone_cards_yes">接受電話卡</string>
|
||||||
|
<string name="poi_payment_telephone_cards_no">不接受電話卡</string>
|
||||||
|
<string name="poi_payment_credit_cards_yes">接受信用卡</string>
|
||||||
|
<string name="poi_payment_credit_cards_no">不接受信用卡</string>
|
||||||
|
<string name="poi_payment_notes_yes">接受紙幣</string>
|
||||||
|
<string name="poi_payment_notes_no">不接受紙幣</string>
|
||||||
|
<string name="poi_payment_electronic_purses_yes">接受電子錢包</string>
|
||||||
|
<string name="poi_payment_electronic_purses_no">不接受電子錢包</string>
|
||||||
|
<string name="poi_payment_cash_yes">接受現金</string>
|
||||||
|
<string name="poi_payment_cash_no">不接受現金</string>
|
||||||
|
<string name="poi_payment_debit_cards_yes">接受簽帳卡</string>
|
||||||
|
<string name="poi_payment_debit_cards_no">不接受簽帳卡</string>
|
||||||
|
<string name="poi_payment_bitcoin_yes">接受比特幣</string>
|
||||||
|
<string name="poi_payment_bitcoin_no">不接受比特幣</string>
|
||||||
|
<string name="poi_payment_visa_yes">接受 Visa 卡</string>
|
||||||
|
<string name="poi_payment_visa_no">不接受 Visa 卡</string>
|
||||||
|
<string name="poi_payment_mastercard_yes">接受萬事達卡</string>
|
||||||
|
<string name="poi_payment_mastercard_no">不接受萬事達卡</string>
|
||||||
|
<string name="poi_payment_none">免費</string>
|
||||||
|
<string name="poi_payment_account_cards_yes">接受帳戶卡</string>
|
||||||
|
<string name="poi_payment_account_cards_no">不接受帳戶卡</string>
|
||||||
|
<string name="poi_payment_maestro_yes">接受 Maestro 卡</string>
|
||||||
|
<string name="poi_payment_maestro_no">不接受 Maestro 卡</string>
|
||||||
|
<string name="poi_payment_american_express_yes">接受美國運通卡 (AMEX)</string>
|
||||||
|
<string name="poi_payment_american_express_no">不接受美國運通卡 (AMEX)</string>
|
||||||
|
</resources>
|
||||||
|
|
|
@ -719,6 +719,8 @@
|
||||||
<string name="poi_internet_access_wired">Internet access: wired</string>
|
<string name="poi_internet_access_wired">Internet access: wired</string>
|
||||||
<string name="poi_internet_access_public">Internet access: public</string>
|
<string name="poi_internet_access_public">Internet access: public</string>
|
||||||
<string name="poi_internet_access_service">Internet access: service</string>
|
<string name="poi_internet_access_service">Internet access: service</string>
|
||||||
|
<string name="poi_internet_access_yes">Internet access: yes</string>
|
||||||
|
<string name="poi_internet_access_no">Internet access: no</string>
|
||||||
|
|
||||||
<string name="poi_monastery">Monastery</string>
|
<string name="poi_monastery">Monastery</string>
|
||||||
<string name="poi_historic_monastery">Historic monastery</string>
|
<string name="poi_historic_monastery">Historic monastery</string>
|
||||||
|
@ -1404,4 +1406,151 @@
|
||||||
|
|
||||||
<string name="poi_love_hotel">Love hotel</string>
|
<string name="poi_love_hotel">Love hotel</string>
|
||||||
|
|
||||||
|
<string name="poi_payment_coins_yes">Accept coins</string>
|
||||||
|
<string name="poi_payment_coins_no">Don\'t accept coins</string>
|
||||||
|
<string name="poi_payment_coins_0.5">Accept $0.5 coins</string>
|
||||||
|
<string name="poi_payment_coins_50c12">Accept 50c, 1€ and 2€ coins</string>
|
||||||
|
<string name="poi_payment_telephone_cards_yes">Accept telephone cards</string>
|
||||||
|
<string name="poi_payment_telephone_cards_no">Don\'t accept telephone cards</string>
|
||||||
|
<string name="poi_payment_credit_cards_yes">Accept credit cards</string>
|
||||||
|
<string name="poi_payment_credit_cards_no">Don\'t accept credit cards</string>
|
||||||
|
<string name="poi_payment_notes_yes">Accept paper money</string>
|
||||||
|
<string name="poi_payment_notes_no">Don\'t accept paper money</string>
|
||||||
|
<string name="poi_payment_electronic_purses_yes">Accept electronic purses</string>
|
||||||
|
<string name="poi_payment_electronic_purses_no">Don\'t accept electronic purses</string>
|
||||||
|
<string name="poi_payment_cash_yes">Accept cash</string>
|
||||||
|
<string name="poi_payment_cash_no">Don\'t accept cash</string>
|
||||||
|
<string name="poi_payment_debit_cards_yes">Accept debit cards</string>
|
||||||
|
<string name="poi_payment_debit_cards_no">Don\'t accept debit cards</string>
|
||||||
|
<string name="poi_payment_bitcoin_yes">Accept Bitcoins</string>
|
||||||
|
<string name="poi_payment_bitcoin_no">Don\'t accept Bitcoins</string>
|
||||||
|
<string name="poi_payment_visa_yes">Accept Visa cards</string>
|
||||||
|
<string name="poi_payment_visa_no">Don\'t accept Visa cards</string>
|
||||||
|
<string name="poi_payment_mastercard_yes">Accept MasterCard</string>
|
||||||
|
<string name="poi_payment_mastercard_no">Don\'t accept MasterCard</string>
|
||||||
|
<string name="poi_payment_none">Free of charge</string>
|
||||||
|
<string name="poi_payment_account_cards_yes">Accept account cards</string>
|
||||||
|
<string name="poi_payment_account_cards_no">Don\'t accept account cards</string>
|
||||||
|
<string name="poi_payment_maestro_yes">Accept Maestro cards</string>
|
||||||
|
<string name="poi_payment_maestro_no">Don\'t accept Maestro cards</string>
|
||||||
|
<string name="poi_payment_american_express_yes">Accept American Express (AMEX) cards</string>
|
||||||
|
<string name="poi_payment_american_express_no">Don\'t accept American Express (AMEX) cards</string>
|
||||||
|
<string name="poi_payment_diners_club_yes">Accept Diners Club cards</string>
|
||||||
|
<string name="poi_payment_diners_club_no">Don\'t accept Diners Club cards</string>
|
||||||
|
<string name="poi_payment_dkv_yes">Accept DKV</string>
|
||||||
|
<string name="poi_payment_dkv_no">Don\'t accept DKV</string>
|
||||||
|
<string name="poi_payment_uta_yes">Accept UTA cards</string>
|
||||||
|
<string name="poi_payment_uta_no">Don\'t accept UTA cards</string>
|
||||||
|
<string name="poi_payment_efectivo_yes">Accept Efectivo</string>
|
||||||
|
<string name="poi_payment_efectivo_no">Don\'t accept Efectivo</string>
|
||||||
|
<string name="poi_payment_girocard_yes">Accept Girocard</string>
|
||||||
|
<string name="poi_payment_girocard_no">Don\'t accept Girocard</string>
|
||||||
|
<string name="poi_payment_discover_card_yes">Accept Discover Card</string>
|
||||||
|
<string name="poi_payment_discover_card_no">Don\'t accept Discover Card</string>
|
||||||
|
<string name="poi_payment_visa_electron_yes">Accept Visa Electron cards</string>
|
||||||
|
<string name="poi_payment_visa_electron_no">Don\'t accept Visa Electron cards</string>
|
||||||
|
<string name="poi_payment_litecoin_yes">Accept Litecoins</string>
|
||||||
|
<string name="poi_payment_litecoin_no">Don\'t accept Litecoins</string>
|
||||||
|
<string name="poi_payment_cheque_yes">Accept cheques</string>
|
||||||
|
<string name="poi_payment_cheque_no">Don\'t accept cheques</string>
|
||||||
|
<string name="poi_payment_pikepass_yes">Accept PIKEPASS</string>
|
||||||
|
<string name="poi_payment_pikepass_no">Don\'t accept PIKEPASS</string>
|
||||||
|
<string name="poi_payment_pikepass_designated">Accept PIKEPASS (designated)</string>
|
||||||
|
<string name="poi_payment_visa_debit_yes">Accept Visa Debit cards</string>
|
||||||
|
<string name="poi_payment_visa_debit_no">Don\'t accept Visa Debit cards</string>
|
||||||
|
<string name="poi_payment_cryptocurrencies_no">Don\'t accept cryptocurrencies</string>
|
||||||
|
<string name="poi_payment_others_yes">Accept other payment methods</string>
|
||||||
|
<string name="poi_payment_others_no">Don\'t accept other payment methods</string>
|
||||||
|
<string name="poi_payment_routex_yes">Accept Routex fuel cards</string>
|
||||||
|
<string name="poi_payment_routex_no">Don\'t accept Routex fuel cards</string>
|
||||||
|
<string name="poi_payment_bancomat_yes">Accept Bancomat</string>
|
||||||
|
<string name="poi_payment_bancomat_no">Don\'t accept Bancomat</string>
|
||||||
|
<string name="poi_payment_icsf_yes">Accept IC Stored Fare cards</string>
|
||||||
|
<string name="poi_payment_icsf_no">Don\'t accept IC Stored Fare cards</string>
|
||||||
|
<string name="poi_payment_prepaid_ticket_yes">Accept prepaid tickets</string>
|
||||||
|
<string name="poi_payment_jcb_yes">Accept JCB cards</string>
|
||||||
|
<string name="poi_payment_jcb_no">Don\'t accept JCB cards</string>
|
||||||
|
<string name="poi_payment_laser_yes">Accept Laser cards</string>
|
||||||
|
<string name="poi_payment_laser_no">Don\'t accept Laser cards</string>
|
||||||
|
<string name="poi_payment_ep_quick_yes">Accept Quick cards</string>
|
||||||
|
<string name="poi_payment_ep_quick_no">Don\'t accept Quick cards</string>
|
||||||
|
<string name="poi_payment_eurowag_yes">Accept Eurowag cards</string>
|
||||||
|
<string name="poi_payment_eurowag_no">Don\'t accept Eurowag cards</string>
|
||||||
|
<string name="poi_payment_e_zpass_yes">Accept E‑ZPass</string>
|
||||||
|
<string name="poi_payment_e_zpass_no">Don\'t accept E‑ZPass</string>
|
||||||
|
<string name="poi_payment_euroshell_yes">Accept Euroshell fuel cards</string>
|
||||||
|
<string name="poi_payment_euroshell_no">Don\'t accept Euroshell fuel cards</string>
|
||||||
|
<string name="poi_payment_kitcard_yes">Accept KITCard</string>
|
||||||
|
<string name="poi_payment_kitcard_no">Don\'t accept KITCard</string>
|
||||||
|
<string name="poi_payment_westfalen_card_yes">Accept Westfalen cards</string>
|
||||||
|
<string name="poi_payment_westfalen_card_no">Don\'t accept Westfalen cards</string>
|
||||||
|
<string name="poi_payment_v_pay_yes">Accept V PAY cards</string>
|
||||||
|
<string name="poi_payment_v_pay_no">Don\'t accept V PAY cards</string>
|
||||||
|
<string name="poi_payment_dogecoin_yes">Accept Dogecoin</string>
|
||||||
|
<string name="poi_payment_dogecoin_no">Don\'t accept Dogecoin</string>
|
||||||
|
<string name="poi_payment_cibus_yes">Accept Cibus cards</string>
|
||||||
|
<string name="poi_payment_cibus_no">Don\'t accept Cibus cards</string>
|
||||||
|
<string name="poi_payment_wire_transfer_yes">Accept wire transfers</string>
|
||||||
|
<string name="poi_payment_wire_transfer_no">Don\'t accept wire transfers</string>
|
||||||
|
<string name="poi_payment_ep_cash_yes">Accept Cash (Geldkarte)</string>
|
||||||
|
<string name="poi_payment_ep_cash_no">Don\'t accept Cash (Geldkarte)</string>
|
||||||
|
<string name="poi_payment_ep_proton_yes">Accept Proton cards</string>
|
||||||
|
<string name="poi_payment_ep_proton_no">Don\'t accept Proton cards</string>
|
||||||
|
<string name="poi_payment_ep_avant_yes">Accept AvantCard</string>
|
||||||
|
<string name="poi_payment_ep_avant_no">Don\'t accept AvantCard</string>
|
||||||
|
<string name="poi_payment_ep_mep_yes">Accept MEP</string>
|
||||||
|
<string name="poi_payment_ep_mep_no">Don\'t accept MEP</string>
|
||||||
|
<string name="poi_payment_ep_minipay_yes">Accept Minipay</string>
|
||||||
|
<string name="poi_payment_ep_minipay_no">Don\'t accept Minipay</string>
|
||||||
|
<string name="poi_payment_ep_minicash_yes">Accept miniCash</string>
|
||||||
|
<string name="poi_payment_ep_minicash_no">Don\'t accept miniCash</string>
|
||||||
|
<string name="poi_payment_ep_moneo_yes">Accept Moneo</string>
|
||||||
|
<string name="poi_payment_ep_moneo_no">Don\'t accept Moneo</string>
|
||||||
|
<string name="poi_payment_ep_monedero4b_yes">Accept Monedero 4B</string>
|
||||||
|
<string name="poi_payment_ep_monedero4b_no">Don\'t accept Monedero 4B</string>
|
||||||
|
<string name="poi_payment_ep_monedero_yes">Accept Monedero</string>
|
||||||
|
<string name="poi_payment_ep_monedero_no">Don\'t accept Monedero</string>
|
||||||
|
<string name="poi_payment_bankaxess_yes">Accept BankAxess</string>
|
||||||
|
<string name="poi_payment_bankaxess_no">Don\'t accept BankAxess</string>
|
||||||
|
<string name="poi_payment_coinkite_yes">Accept Coinkite</string>
|
||||||
|
<string name="poi_payment_coinkite_no">Don\'t accept Coinkite</string>
|
||||||
|
<string name="poi_payment_roadrunner_yes">Accept Roadrunner cards</string>
|
||||||
|
<string name="poi_payment_roadrunner_no">Don\'t accept Roadrunner cards</string>
|
||||||
|
<string name="poi_payment_svg_yes">Accept SVG</string>
|
||||||
|
<string name="poi_payment_svg_no">Don\'t accept SVG</string>
|
||||||
|
<string name="poi_payment_sms_yes">Accept SMS payments</string>
|
||||||
|
<string name="poi_payment_sms_no">Don\'t accept SMS payments</string>
|
||||||
|
<string name="poi_payment_ov_chipkaart_yes">Accept OV-Chipkaart</string>
|
||||||
|
<string name="poi_payment_ov_chipkaart_no">Don\'t accept OV-Chipkaart</string>
|
||||||
|
<string name="poi_payment_oyster_yes">Accept Oyster cards</string>
|
||||||
|
<string name="poi_payment_oyster_no">Don\'t accept Oyster cards</string>
|
||||||
|
<string name="poi_payment_sube_yes">Accept SUBE cards</string>
|
||||||
|
<string name="poi_payment_sube_no">Don\'t accept SUBE cards</string>
|
||||||
|
<string name="poi_payment_via_verde_yes">Accept Via Verde</string>
|
||||||
|
<string name="poi_payment_via_verde_no">Don\'t accept Via Verde</string>
|
||||||
|
<string name="poi_payment_meal_voucher_yes">Accept meal vouchers</string>
|
||||||
|
<string name="poi_payment_meal_voucher_no">Don\'t accept meal vouchers</string>
|
||||||
|
<string name="poi_payment_paypal_yes">Accept PayPal</string>
|
||||||
|
<string name="poi_payment_paypal_no">Don\'t accept PayPal</string>
|
||||||
|
<string name="poi_payment_u_key_yes">Accept U-Key</string>
|
||||||
|
<string name="poi_payment_u_key_no">Don\'t accept U-Key</string>
|
||||||
|
<string name="poi_payment_token_yes">Accept tokens</string>
|
||||||
|
<string name="poi_payment_token_no">Don\'t accept tokens</string>
|
||||||
|
<string name="poi_payment_gift_card_yes">Accept gift cards</string>
|
||||||
|
<string name="poi_payment_gift_card_no">Don\'t accept gift cards</string>
|
||||||
|
<string name="poi_payment_golden_crown_yes">Accept Golden Crown cards</string>
|
||||||
|
<string name="poi_payment_golden_crown_no">Don\'t accept Golden Crown cards</string>
|
||||||
|
<string name="poi_payment_pro100_yes">Accept PRO100 cards</string>
|
||||||
|
<string name="poi_payment_pro100_no">Don\'t accept PRO100 cards</string>
|
||||||
|
<string name="poi_payment_union_card_yes">Accept Union Card</string>
|
||||||
|
<string name="poi_payment_union_card_no">Don\'t accept Union Card</string>
|
||||||
|
<string name="poi_payment_mtsmoney_yes">Accept MTS-Money</string>
|
||||||
|
<string name="poi_payment_mtsmoney_no">Don\'t accept MTS-Money</string>
|
||||||
|
<string name="poi_payment_yandexmoney_yes">Accept Yandex.Money</string>
|
||||||
|
<string name="poi_payment_yandexmoney_no">Don\'t accept Yandex.Money</string>
|
||||||
|
<string name="poi_description_payment">Payment description</string>
|
||||||
|
|
||||||
|
<string name="poi_internet_access_fee_yes">Charge fees for internet access</string>
|
||||||
|
<string name="poi_internet_access_fee_no">Don\'t charge fees for internet access</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -211,6 +211,7 @@ public class AppInitializer implements IProgress {
|
||||||
new FileOutputStream(file));
|
new FileOutputStream(file));
|
||||||
}
|
}
|
||||||
app.regions.prepareFile(file.getAbsolutePath());
|
app.regions.prepareFile(file.getAbsolutePath());
|
||||||
|
loadWorldRegions();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
warnings.add(e.getMessage());
|
warnings.add(e.getMessage());
|
||||||
|
@ -218,6 +219,9 @@ public class AppInitializer implements IProgress {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void loadWorldRegions() {
|
||||||
|
app.worldRegion = WorldRegion.loadWorldRegions(app);
|
||||||
|
}
|
||||||
|
|
||||||
private void initPoiTypes() {
|
private void initPoiTypes() {
|
||||||
if(app.getAppPath("poi_types.xml").exists()) {
|
if(app.getAppPath("poi_types.xml").exists()) {
|
||||||
|
|
|
@ -96,6 +96,7 @@ public class OsmandApplication extends Application {
|
||||||
AvoidSpecificRoads avoidSpecificRoads;
|
AvoidSpecificRoads avoidSpecificRoads;
|
||||||
BRouterServiceConnection bRouterServiceConnection;
|
BRouterServiceConnection bRouterServiceConnection;
|
||||||
OsmandRegions regions;
|
OsmandRegions regions;
|
||||||
|
WorldRegion worldRegion;
|
||||||
|
|
||||||
|
|
||||||
RoutingConfiguration.Builder defaultRoutingConfig;
|
RoutingConfiguration.Builder defaultRoutingConfig;
|
||||||
|
@ -653,6 +654,9 @@ public class OsmandApplication extends Application {
|
||||||
public OsmandRegions getRegions() {
|
public OsmandRegions getRegions() {
|
||||||
return regions;
|
return regions;
|
||||||
}
|
}
|
||||||
|
public WorldRegion getWorldRegion() {
|
||||||
|
return worldRegion;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean accessibilityExtensions() {
|
public boolean accessibilityExtensions() {
|
||||||
return (Build.VERSION.SDK_INT < 14) ? getSettings().ACCESSIBILITY_EXTENSIONS.get() : false;
|
return (Build.VERSION.SDK_INT < 14) ? getSettings().ACCESSIBILITY_EXTENSIONS.get() : false;
|
||||||
|
|
278
OsmAnd/src/net/osmand/plus/WorldRegion.java
Normal file
278
OsmAnd/src/net/osmand/plus/WorldRegion.java
Normal file
|
@ -0,0 +1,278 @@
|
||||||
|
package net.osmand.plus;
|
||||||
|
|
||||||
|
import android.content.res.Resources;
|
||||||
|
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.data.LatLon;
|
||||||
|
import net.osmand.map.OsmandRegions;
|
||||||
|
import net.osmand.plus.download.DownloadActivityType;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
public class WorldRegion {
|
||||||
|
|
||||||
|
public static final String AFRICA_REGION_ID = "africa";
|
||||||
|
public static final String ASIA_REGION_ID = "asia";
|
||||||
|
public static final String AUSTRALIA_AND_OCEANIA_REGION_ID = "australia-oceania";
|
||||||
|
public static final String CENTRAL_AMERICA_REGION_ID = "centralamerica";
|
||||||
|
public static final String EUROPE_REGION_ID = "europe";
|
||||||
|
public static final String NORTH_AMERICA_REGION_ID = "northamerica";
|
||||||
|
public static final String RUSSIA_REGION_ID = "russia";
|
||||||
|
public static final String SOUTH_AMERICA_REGION_ID = "southamerica";
|
||||||
|
|
||||||
|
private static final org.apache.commons.logging.Log LOG = PlatformUtil.getLog(WorldRegion.class);
|
||||||
|
|
||||||
|
// Region data
|
||||||
|
private String regionId;
|
||||||
|
private String downloadsIdPrefix;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private LatLon bboxTopLeft;
|
||||||
|
private LatLon bboxBottomRight;
|
||||||
|
|
||||||
|
private LinkedList<DownloadActivityType> resourceTypes;
|
||||||
|
|
||||||
|
// Hierarchy
|
||||||
|
private WorldRegion superregion;
|
||||||
|
private LinkedList<WorldRegion> subregions;
|
||||||
|
private LinkedList<WorldRegion> flattenedSubregions;
|
||||||
|
|
||||||
|
private boolean purchased;
|
||||||
|
private boolean isInPurchasedArea;
|
||||||
|
|
||||||
|
public String getRegionId() {
|
||||||
|
return regionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDownloadsIdPrefix() {
|
||||||
|
return downloadsIdPrefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LatLon getBboxTopLeft() {
|
||||||
|
return bboxTopLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LatLon getBboxBottomRight() {
|
||||||
|
return bboxBottomRight;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedList<DownloadActivityType> getResourceTypes() {
|
||||||
|
return resourceTypes;
|
||||||
|
}
|
||||||
|
|
||||||
|
public WorldRegion getSuperregion() {
|
||||||
|
return superregion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedList<WorldRegion> getSubregions() {
|
||||||
|
return subregions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LinkedList<WorldRegion> getFlattenedSubregions() {
|
||||||
|
return flattenedSubregions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPurchased() {
|
||||||
|
return purchased;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInPurchasedArea() {
|
||||||
|
return isInPurchasedArea;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
WorldRegion that = (WorldRegion) o;
|
||||||
|
|
||||||
|
return !(name != null ? !name.toLowerCase().equals(that.name.toLowerCase()) : that.name != null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return name != null ? name.hashCode() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private WorldRegion() {
|
||||||
|
superregion = null;
|
||||||
|
subregions = new LinkedList<>();
|
||||||
|
flattenedSubregions = new LinkedList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
private WorldRegion initWorld() {
|
||||||
|
regionId = null;
|
||||||
|
downloadsIdPrefix = "world_";
|
||||||
|
name = null;
|
||||||
|
superregion = null;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private WorldRegion init(String regionId, OsmandRegions osmandRegions, String name) {
|
||||||
|
this.regionId = regionId;
|
||||||
|
String downloadName = osmandRegions.getDownloadName(regionId);
|
||||||
|
if (downloadName != null) {
|
||||||
|
downloadsIdPrefix = downloadName + ".";
|
||||||
|
if (name != null) {
|
||||||
|
this.name = name;
|
||||||
|
} else {
|
||||||
|
this.name = osmandRegions.getLocaleName(downloadName);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.downloadsIdPrefix = regionId + ".";
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private WorldRegion init(String regionId, OsmandRegions osmandRegions) {
|
||||||
|
this.regionId = regionId;
|
||||||
|
String downloadName = osmandRegions.getDownloadName(regionId);
|
||||||
|
if (downloadName != null) {
|
||||||
|
downloadsIdPrefix = downloadName + ".";
|
||||||
|
this.name = osmandRegions.getLocaleName(regionId);
|
||||||
|
} else {
|
||||||
|
this.downloadsIdPrefix = regionId + ".";
|
||||||
|
this.name = regionId;
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private WorldRegion init(String regionId, String name) {
|
||||||
|
this.regionId = regionId;
|
||||||
|
this.downloadsIdPrefix = regionId + ".";
|
||||||
|
this.name = name;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addSubregion(WorldRegion subregion) {
|
||||||
|
subregion.superregion = this;
|
||||||
|
subregions.add(subregion);
|
||||||
|
propagateSubregionToFlattenedHierarchy(subregion);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void propagateSubregionToFlattenedHierarchy(WorldRegion subregion) {
|
||||||
|
flattenedSubregions.add(subregion);
|
||||||
|
if (superregion != null) {
|
||||||
|
superregion.propagateSubregionToFlattenedHierarchy(subregion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WorldRegion loadWorldRegions(OsmandApplication app) {
|
||||||
|
OsmandRegions osmandRegions = app.getRegions();
|
||||||
|
|
||||||
|
Map<String, String> loadedItems = osmandRegions.getFullNamesToLowercaseCopy();
|
||||||
|
if (loadedItems.size() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, WorldRegion> regionsLookupTable = new HashMap<>(loadedItems.size());
|
||||||
|
|
||||||
|
// Create root region
|
||||||
|
WorldRegion entireWorld = new WorldRegion().initWorld();
|
||||||
|
|
||||||
|
// Create main regions
|
||||||
|
Resources res = app.getResources();
|
||||||
|
|
||||||
|
WorldRegion africaRegion = createRegionAs(AFRICA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_africa));
|
||||||
|
entireWorld.addSubregion(africaRegion);
|
||||||
|
regionsLookupTable.put(africaRegion.regionId, africaRegion);
|
||||||
|
|
||||||
|
WorldRegion asiaRegion = createRegionAs(ASIA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_asia));
|
||||||
|
entireWorld.addSubregion(asiaRegion);
|
||||||
|
regionsLookupTable.put(asiaRegion.regionId, asiaRegion);
|
||||||
|
|
||||||
|
WorldRegion australiaAndOceaniaRegion = createRegionAs(AUSTRALIA_AND_OCEANIA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_oceania));
|
||||||
|
entireWorld.addSubregion(australiaAndOceaniaRegion);
|
||||||
|
regionsLookupTable.put(australiaAndOceaniaRegion.regionId, australiaAndOceaniaRegion);
|
||||||
|
|
||||||
|
WorldRegion centralAmericaRegion = createRegionAs(CENTRAL_AMERICA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_central_america));
|
||||||
|
entireWorld.addSubregion(centralAmericaRegion);
|
||||||
|
regionsLookupTable.put(centralAmericaRegion.regionId, centralAmericaRegion);
|
||||||
|
|
||||||
|
WorldRegion europeRegion = createRegionAs(EUROPE_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_europe));
|
||||||
|
entireWorld.addSubregion(europeRegion);
|
||||||
|
regionsLookupTable.put(europeRegion.regionId, europeRegion);
|
||||||
|
|
||||||
|
WorldRegion northAmericaRegion = createRegionAs(NORTH_AMERICA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_north_america));
|
||||||
|
entireWorld.addSubregion(northAmericaRegion);
|
||||||
|
regionsLookupTable.put(northAmericaRegion.regionId, northAmericaRegion);
|
||||||
|
|
||||||
|
WorldRegion russiaRegion = createRegionAs(RUSSIA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_russia));
|
||||||
|
entireWorld.addSubregion(russiaRegion);
|
||||||
|
regionsLookupTable.put(russiaRegion.regionId, russiaRegion);
|
||||||
|
|
||||||
|
WorldRegion southAmericaRegion = createRegionAs(SOUTH_AMERICA_REGION_ID,
|
||||||
|
loadedItems, osmandRegions, res.getString(R.string.index_name_south_america));
|
||||||
|
entireWorld.addSubregion(southAmericaRegion);
|
||||||
|
regionsLookupTable.put(southAmericaRegion.regionId, southAmericaRegion);
|
||||||
|
|
||||||
|
// Process remaining regions
|
||||||
|
for (;;) {
|
||||||
|
int processedRegions = 0;
|
||||||
|
|
||||||
|
Iterator<Entry<String, String>> iterator = loadedItems.entrySet().iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
String regionId = iterator.next().getKey();
|
||||||
|
String parentRegionId = osmandRegions.getParentFullName(regionId);
|
||||||
|
if (parentRegionId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Try to find parent of this region
|
||||||
|
WorldRegion parentRegion = regionsLookupTable.get(parentRegionId);
|
||||||
|
if (parentRegion == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldRegion newRegion = new WorldRegion().init(regionId, osmandRegions);
|
||||||
|
parentRegion.addSubregion(newRegion);
|
||||||
|
regionsLookupTable.put(newRegion.regionId, newRegion);
|
||||||
|
|
||||||
|
// Remove
|
||||||
|
processedRegions++;
|
||||||
|
iterator.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
// If all remaining are orphans, that's all
|
||||||
|
if (processedRegions == 0)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.warn("Found orphaned regions: " + loadedItems.size());
|
||||||
|
for (String regionId : loadedItems.keySet()) {
|
||||||
|
LOG.warn("FullName = " + regionId + " parent=" + osmandRegions.getParentFullName(regionId));
|
||||||
|
}
|
||||||
|
|
||||||
|
return entireWorld;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static WorldRegion createRegionAs(String regionId, Map<String, String> loadedItems, OsmandRegions osmandRegions, String localizedName) {
|
||||||
|
WorldRegion worldRegion;
|
||||||
|
boolean hasRegion = loadedItems.containsKey(regionId);
|
||||||
|
if (hasRegion) {
|
||||||
|
worldRegion = new WorldRegion().init(regionId, osmandRegions, localizedName);
|
||||||
|
loadedItems.remove(regionId);
|
||||||
|
} else {
|
||||||
|
worldRegion = new WorldRegion().init(regionId, localizedName);
|
||||||
|
}
|
||||||
|
return worldRegion;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,24 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.StringMatcher;
|
||||||
|
import net.osmand.osm.AbstractPoiType;
|
||||||
|
import net.osmand.osm.MapPoiTypes;
|
||||||
|
import net.osmand.osm.PoiCategory;
|
||||||
|
import net.osmand.osm.PoiFilter;
|
||||||
|
import net.osmand.osm.PoiType;
|
||||||
|
import net.osmand.osm.edit.OSMSettings;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.osmedit.data.EditPoiData;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
|
@ -17,37 +36,16 @@ import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
import net.osmand.StringMatcher;
|
|
||||||
import net.osmand.osm.AbstractPoiType;
|
|
||||||
import net.osmand.osm.MapPoiTypes;
|
|
||||||
import net.osmand.osm.PoiCategory;
|
|
||||||
import net.osmand.osm.PoiFilter;
|
|
||||||
import net.osmand.osm.PoiType;
|
|
||||||
import net.osmand.osm.edit.OSMSettings;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.osmedit.data.EditPoiData;
|
|
||||||
import net.osmand.plus.osmedit.data.Tag;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class AdvancedDataFragment extends Fragment {
|
public class AdvancedDataFragment extends Fragment {
|
||||||
private static final String TAG = "AdvancedDataFragment";
|
private static final String TAG = "AdvancedDataFragment";
|
||||||
private static final Log LOG = PlatformUtil.getLog(AdvancedDataFragment.class);
|
private static final Log LOG = PlatformUtil.getLog(AdvancedDataFragment.class);
|
||||||
|
|
||||||
private TagAdapterLinearLayoutHack mAdapter;
|
private TagAdapterLinearLayoutHack mAdapter;
|
||||||
private EditPoiData.TagsChangedListener mTagsChangedListener;
|
private EditPoiData.TagsChangedListener mTagsChangedListener;
|
||||||
private boolean mIsUserInput = true;
|
|
||||||
private Drawable deleteDrawable;
|
private Drawable deleteDrawable;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,7 +81,7 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
addTagButton.setOnClickListener(new View.OnClickListener() {
|
addTagButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
mAdapter.addTag(new Tag("", ""));
|
mAdapter.addTagView("", "");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return view;
|
return view;
|
||||||
|
@ -95,10 +93,8 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
mAdapter.updateViews();
|
mAdapter.updateViews();
|
||||||
mTagsChangedListener = new EditPoiData.TagsChangedListener() {
|
mTagsChangedListener = new EditPoiData.TagsChangedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onTagsChanged() {
|
public void onTagsChanged(String anyTag) {
|
||||||
mIsUserInput = false;
|
|
||||||
mAdapter.updateViews();
|
mAdapter.updateViews();
|
||||||
mIsUserInput = true;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
getData().addListener(mTagsChangedListener);
|
getData().addListener(mTagsChangedListener);
|
||||||
|
@ -155,20 +151,13 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
this.mapPoiTypes = mapPoiTypes;
|
this.mapPoiTypes = mapPoiTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addTag(Tag tag) {
|
|
||||||
editPoiData.tags.add(tag);
|
|
||||||
if (mIsUserInput)
|
|
||||||
editPoiData.notifyDatasetChanged(mTagsChangedListener);
|
|
||||||
updateViews();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateViews() {
|
public void updateViews() {
|
||||||
linearLayout.removeAllViews();
|
linearLayout.removeAllViews();
|
||||||
for (Tag tag : editPoiData.tags) {
|
for (Entry<String, String> tag : editPoiData.getTagValues().entrySet()) {
|
||||||
if (tag.tag.equals(OSMSettings.OSMTagKey.NAME.getValue())) {
|
if (tag.getKey().equals(OSMSettings.OSMTagKey.NAME.getValue())) {
|
||||||
nameTextView.setText(tag.value);
|
nameTextView.setText(tag.getValue());
|
||||||
} else if (tag.tag.equals(EditPoiFragment.POI_TYPE_TAG)) {
|
} else if (tag.getKey().equals(EditPoiData.POI_TYPE_TAG)) {
|
||||||
String subType = tag.value.trim().toLowerCase();
|
String subType = tag.getValue().trim().toLowerCase();
|
||||||
if (allTranslatedSubTypes.get(subType) != null) {
|
if (allTranslatedSubTypes.get(subType) != null) {
|
||||||
PoiType pt = allTranslatedSubTypes.get(subType);
|
PoiType pt = allTranslatedSubTypes.get(subType);
|
||||||
amenityTagTextView.setText(pt.getOsmTag());
|
amenityTagTextView.setText(pt.getOsmTag());
|
||||||
|
@ -178,35 +167,42 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
amenityTextView.setText(subType);
|
amenityTextView.setText(subType);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
View view = getView(tag);
|
addTagView(tag.getKey(), tag.getValue());
|
||||||
linearLayout.addView(view);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private View getView(final Tag tag) {
|
public void addTagView(String tg, String vl) {
|
||||||
|
View view = getView(tg, vl);
|
||||||
|
linearLayout.addView(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
private View getView(String tg, String vl) {
|
||||||
final View convertView = LayoutInflater.from(linearLayout.getContext())
|
final View convertView = LayoutInflater.from(linearLayout.getContext())
|
||||||
.inflate(R.layout.poi_tag_list_item, null, false);
|
.inflate(R.layout.poi_tag_list_item, null, false);
|
||||||
final AutoCompleteTextView tagEditText =
|
final AutoCompleteTextView tagEditText =
|
||||||
(AutoCompleteTextView) convertView.findViewById(R.id.tagEditText);
|
(AutoCompleteTextView) convertView.findViewById(R.id.tagEditText);
|
||||||
tagEditText.setText(tag.tag);
|
tagEditText.setText(tg);
|
||||||
final EditText valueEditText = (EditText) convertView.findViewById(R.id.valueEditText);
|
final AutoCompleteTextView valueEditText =
|
||||||
|
(AutoCompleteTextView) convertView.findViewById(R.id.valueEditText);
|
||||||
ImageButton deleteItemImageButton =
|
ImageButton deleteItemImageButton =
|
||||||
(ImageButton) convertView.findViewById(R.id.deleteItemImageButton);
|
(ImageButton) convertView.findViewById(R.id.deleteItemImageButton);
|
||||||
valueEditText.setText(tag.value);
|
valueEditText.setText(vl);
|
||||||
deleteItemImageButton.setImageDrawable(deleteDrawable);
|
deleteItemImageButton.setImageDrawable(deleteDrawable);
|
||||||
|
final String[] previousTag = new String[] {tg};
|
||||||
deleteItemImageButton.setOnClickListener(new View.OnClickListener() {
|
deleteItemImageButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
linearLayout.removeView((View) v.getParent());
|
linearLayout.removeView((View) v.getParent());
|
||||||
editPoiData.tags.remove(tag);
|
editPoiData.removeTag(tagEditText.toString());
|
||||||
if (mIsUserInput)
|
|
||||||
editPoiData.notifyDatasetChanged(null);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tagEditText.addTextChangedListener(new TextWatcher() {
|
tagEditText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
if (!editPoiData.isInEdit()) {
|
||||||
|
editPoiData.removeTag(s.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -215,29 +211,28 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
editPoiData.tags.remove(tag);
|
if (!editPoiData.isInEdit()) {
|
||||||
tag.tag = tagEditText.getText().toString();
|
editPoiData.removeTag(previousTag[0]);
|
||||||
editPoiData.tags.add(tag);
|
editPoiData.putTag(s.toString(), valueEditText.getText().toString());
|
||||||
if (mIsUserInput)
|
previousTag[0] = s.toString();
|
||||||
editPoiData.notifyDatasetChanged(mTagsChangedListener);
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
final Set<String> tagKeys = new HashSet<>();
|
final Set<String> tagKeys = new HashSet<>();
|
||||||
|
final Set<String> valueKeys = new HashSet<>();
|
||||||
for (String s : allTypes.keySet()) {
|
for (String s : allTypes.keySet()) {
|
||||||
AbstractPoiType abstractPoiType = allTypes.get(s);
|
AbstractPoiType abstractPoiType = allTypes.get(s);
|
||||||
addPoiToStringSet(abstractPoiType, tagKeys);
|
addPoiToStringSet(abstractPoiType, tagKeys, valueKeys);
|
||||||
}
|
}
|
||||||
// addPoiToStringSet(mapPoiTypes.getOtherPoiCategory(), tagKeys);
|
addPoiToStringSet(mapPoiTypes.getOtherMapCategory(), tagKeys, valueKeys);
|
||||||
addPoiToStringSet(mapPoiTypes.getOtherMapCategory(), tagKeys);
|
|
||||||
|
|
||||||
ArrayAdapter<Object> adapter = new ArrayAdapter<>(linearLayout.getContext(),
|
ArrayAdapter<Object> tagAdapter = new ArrayAdapter<>(linearLayout.getContext(),
|
||||||
R.layout.list_textview, tagKeys.toArray());
|
R.layout.list_textview, tagKeys.toArray());
|
||||||
tagEditText.setAdapter(adapter);
|
tagEditText.setAdapter(tagAdapter);
|
||||||
tagEditText.setThreshold(1);
|
tagEditText.setThreshold(1);
|
||||||
tagEditText.setOnClickListener(new View.OnClickListener() {
|
tagEditText.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
// TODO: 8/29/15 Rewrite as dialog fragment
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
final String[] tags = tagKeys.toArray(new String[tagKeys.size()]);
|
final String[] tags = tagKeys.toArray(new String[tagKeys.size()]);
|
||||||
builder.setItems(tags, new Dialog.OnClickListener() {
|
builder.setItems(tags, new Dialog.OnClickListener() {
|
||||||
|
@ -251,6 +246,7 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
valueEditText.addTextChangedListener(new TextWatcher() {
|
valueEditText.addTextChangedListener(new TextWatcher() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
@ -262,18 +258,38 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
editPoiData.tags.remove(tag);
|
if (!editPoiData.isInEdit()) {
|
||||||
tag.value = valueEditText.getText().toString();
|
editPoiData.putTag(tagEditText.getText().toString(), s.toString());
|
||||||
editPoiData.tags.add(tag);
|
}
|
||||||
if (mIsUserInput)
|
|
||||||
editPoiData.notifyDatasetChanged(mTagsChangedListener);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
ArrayAdapter<Object> valueAdapter = new ArrayAdapter<>(linearLayout.getContext(),
|
||||||
|
R.layout.list_textview, valueKeys.toArray());
|
||||||
|
valueEditText.setAdapter(valueAdapter);
|
||||||
|
valueEditText.setThreshold(1);
|
||||||
|
valueEditText.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
|
final String[] values = valueKeys.toArray(new String[tagKeys.size()]);
|
||||||
|
builder.setItems(values, new Dialog.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
valueEditText.setText(values[which]);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
builder.create();
|
||||||
|
builder.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addPoiToStringSet(AbstractPoiType abstractPoiType, Set<String> stringSet) {
|
private static void addPoiToStringSet(AbstractPoiType abstractPoiType, Set<String> stringSet,
|
||||||
|
Set<String> values) {
|
||||||
if (abstractPoiType instanceof PoiType) {
|
if (abstractPoiType instanceof PoiType) {
|
||||||
PoiType poiType = (PoiType) abstractPoiType;
|
PoiType poiType = (PoiType) abstractPoiType;
|
||||||
if (poiType.getOsmTag() != null &&
|
if (poiType.getOsmTag() != null &&
|
||||||
|
@ -282,22 +298,29 @@ public class AdvancedDataFragment extends Fragment {
|
||||||
if (poiType.getOsmTag2() != null) {
|
if (poiType.getOsmTag2() != null) {
|
||||||
stringSet.add(poiType.getOsmTag2());
|
stringSet.add(poiType.getOsmTag2());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (poiType.getOsmValue() != null) {
|
||||||
|
values.add(poiType.getOsmValue());
|
||||||
|
}
|
||||||
|
if (poiType.getOsmValue2() != null) {
|
||||||
|
values.add(poiType.getOsmValue2());
|
||||||
}
|
}
|
||||||
} else if (abstractPoiType instanceof PoiCategory) {
|
} else if (abstractPoiType instanceof PoiCategory) {
|
||||||
PoiCategory poiCategory = (PoiCategory) abstractPoiType;
|
PoiCategory poiCategory = (PoiCategory) abstractPoiType;
|
||||||
for (PoiFilter filter : poiCategory.getPoiFilters()) {
|
for (PoiFilter filter : poiCategory.getPoiFilters()) {
|
||||||
addPoiToStringSet(filter, stringSet);
|
addPoiToStringSet(filter, stringSet, values);
|
||||||
}
|
}
|
||||||
for (PoiType poiType : poiCategory.getPoiTypes()) {
|
for (PoiType poiType : poiCategory.getPoiTypes()) {
|
||||||
addPoiToStringSet(poiType, stringSet);
|
addPoiToStringSet(poiType, stringSet, values);
|
||||||
}
|
}
|
||||||
for (PoiType poiType : poiCategory.getPoiAdditionals()) {
|
for (PoiType poiType : poiCategory.getPoiAdditionals()) {
|
||||||
addPoiToStringSet(poiType, stringSet);
|
addPoiToStringSet(poiType, stringSet, values);
|
||||||
}
|
}
|
||||||
} else if (abstractPoiType instanceof PoiFilter) {
|
} else if (abstractPoiType instanceof PoiFilter) {
|
||||||
PoiFilter poiFilter = (PoiFilter) abstractPoiType;
|
PoiFilter poiFilter = (PoiFilter) abstractPoiType;
|
||||||
for (PoiType poiType : poiFilter.getPoiTypes()) {
|
for (PoiType poiType : poiFilter.getPoiTypes()) {
|
||||||
addPoiToStringSet(poiType, stringSet);
|
addPoiToStringSet(poiType, stringSet, values);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("abstractPoiType can't be instance of class "
|
throw new IllegalArgumentException("abstractPoiType can't be instance of class "
|
||||||
|
|
|
@ -1,5 +1,24 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.osm.edit.OSMSettings;
|
||||||
|
import net.osmand.plus.IconsCache;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.osmedit.data.EditPoiData;
|
||||||
|
import net.osmand.plus.osmedit.data.EditPoiData.TagsChangedListener;
|
||||||
|
import net.osmand.plus.osmedit.dialogs.OpeningHoursDaysDialogFragment;
|
||||||
|
import net.osmand.plus.osmedit.dialogs.OpeningHoursHoursDialogFragment;
|
||||||
|
import net.osmand.util.OpeningHoursParser;
|
||||||
|
import net.osmand.util.OpeningHoursParser.BasicOpeningHourRule;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.Point;
|
import android.graphics.Point;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
|
@ -7,7 +26,6 @@ import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.Display;
|
import android.view.Display;
|
||||||
|
@ -21,25 +39,6 @@ import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
import net.osmand.osm.edit.OSMSettings;
|
|
||||||
import net.osmand.plus.IconsCache;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.osmedit.data.EditPoiData;
|
|
||||||
import net.osmand.plus.osmedit.data.Tag;
|
|
||||||
import net.osmand.plus.osmedit.dialogs.OpeningHoursDaysDialogFragment;
|
|
||||||
import net.osmand.plus.osmedit.dialogs.OpeningHoursHoursDialogFragment;
|
|
||||||
import net.osmand.util.OpeningHoursParser;
|
|
||||||
import net.osmand.util.OpeningHoursParser.BasicOpeningHourRule;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class BasicDataFragment extends Fragment {
|
public class BasicDataFragment extends Fragment {
|
||||||
private static final String TAG = "BasicDataFragment";
|
private static final String TAG = "BasicDataFragment";
|
||||||
private static final Log LOG = PlatformUtil.getLog(BasicDataFragment.class);
|
private static final Log LOG = PlatformUtil.getLog(BasicDataFragment.class);
|
||||||
|
@ -49,8 +48,7 @@ public class BasicDataFragment extends Fragment {
|
||||||
private EditText phoneEditText;
|
private EditText phoneEditText;
|
||||||
private EditText webSiteEditText;
|
private EditText webSiteEditText;
|
||||||
private EditText descriptionEditText;
|
private EditText descriptionEditText;
|
||||||
private EditPoiData.TagsChangedListener mTagsChangedListener;
|
private List<EditPoiData.TagsChangedListener> listeners = new LinkedList<EditPoiData.TagsChangedListener>();
|
||||||
private boolean mIsUserInput = true;
|
|
||||||
OpeningHoursAdapter mOpeningHoursAdapter;
|
OpeningHoursAdapter mOpeningHoursAdapter;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@ -91,26 +89,21 @@ public class BasicDataFragment extends Fragment {
|
||||||
iconsCache.getPaintedContentIcon(R.drawable.ic_action_time, iconColor));
|
iconsCache.getPaintedContentIcon(R.drawable.ic_action_time, iconColor));
|
||||||
|
|
||||||
streetEditText = (EditText) view.findViewById(R.id.streetEditText);
|
streetEditText = (EditText) view.findViewById(R.id.streetEditText);
|
||||||
streetEditText.addTextChangedListener(new MyOnFocusChangeListener(getData(),
|
|
||||||
OSMSettings.OSMTagKey.ADDR_STREET.getValue()));
|
|
||||||
houseNumberEditText = (EditText) view.findViewById(R.id.houseNumberEditText);
|
houseNumberEditText = (EditText) view.findViewById(R.id.houseNumberEditText);
|
||||||
houseNumberEditText.addTextChangedListener(new MyOnFocusChangeListener(getData(),
|
|
||||||
OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER.getValue()));
|
|
||||||
phoneEditText = (EditText) view.findViewById(R.id.phoneEditText);
|
phoneEditText = (EditText) view.findViewById(R.id.phoneEditText);
|
||||||
phoneEditText.addTextChangedListener(new MyOnFocusChangeListener(getData(),
|
|
||||||
OSMSettings.OSMTagKey.PHONE.getValue()));
|
|
||||||
webSiteEditText = (EditText) view.findViewById(R.id.webSiteEditText);
|
webSiteEditText = (EditText) view.findViewById(R.id.webSiteEditText);
|
||||||
webSiteEditText.addTextChangedListener(new MyOnFocusChangeListener(getData(),
|
|
||||||
OSMSettings.OSMTagKey.WEBSITE.getValue()));
|
|
||||||
descriptionEditText = (EditText) view.findViewById(R.id.descriptionEditText);
|
descriptionEditText = (EditText) view.findViewById(R.id.descriptionEditText);
|
||||||
descriptionEditText.addTextChangedListener(new MyOnFocusChangeListener(getData(),
|
listeners.clear();
|
||||||
OSMSettings.OSMTagKey.DESCRIPTION.getValue()));
|
addTextWatcher(OSMSettings.OSMTagKey.ADDR_STREET.getValue(), streetEditText);
|
||||||
|
addTextWatcher(OSMSettings.OSMTagKey.WEBSITE.getValue(), webSiteEditText);
|
||||||
|
addTextWatcher(OSMSettings.OSMTagKey.PHONE.getValue(), phoneEditText);
|
||||||
|
addTextWatcher(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER.getValue(), houseNumberEditText);
|
||||||
|
addTextWatcher(OSMSettings.OSMTagKey.DESCRIPTION.getValue(), descriptionEditText);
|
||||||
Button addOpeningHoursButton = (Button) view.findViewById(R.id.addOpeningHoursButton);
|
Button addOpeningHoursButton = (Button) view.findViewById(R.id.addOpeningHoursButton);
|
||||||
addOpeningHoursButton.setOnClickListener(new View.OnClickListener() {
|
addOpeningHoursButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
BasicOpeningHourRule rule = new BasicOpeningHourRule();
|
BasicOpeningHourRule rule = new BasicOpeningHourRule();
|
||||||
// TODO: 8/27/15 Figure out some better defauls or leave it as it is
|
|
||||||
rule.setStartTime(9 * 60);
|
rule.setStartTime(9 * 60);
|
||||||
rule.setEndTime(18 * 60);
|
rule.setEndTime(18 * 60);
|
||||||
OpeningHoursDaysDialogFragment fragment = OpeningHoursDaysDialogFragment.createInstance(rule, -1);
|
OpeningHoursDaysDialogFragment fragment = OpeningHoursDaysDialogFragment.createInstance(rule, -1);
|
||||||
|
@ -141,39 +134,70 @@ public class BasicDataFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
mTagsChangedListener = new EditPoiData.TagsChangedListener() {
|
for(EditPoiData.TagsChangedListener tl : listeners) {
|
||||||
@Override
|
getData().addListener(tl);
|
||||||
public void onTagsChanged() {
|
}
|
||||||
TagMapProcessor tagMapProcessor = new TagMapProcessor();
|
getData().notifyToUpdateUI();
|
||||||
tagMapProcessor.addFilter(OSMSettings.OSMTagKey.ADDR_STREET.getValue(),
|
|
||||||
new EditTextTagFilter(streetEditText));
|
|
||||||
tagMapProcessor.addFilter(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER.getValue(),
|
|
||||||
new EditTextTagFilter(houseNumberEditText));
|
|
||||||
tagMapProcessor.addFilter(OSMSettings.OSMTagKey.PHONE.getValue(),
|
|
||||||
new EditTextTagFilter(phoneEditText));
|
|
||||||
tagMapProcessor.addFilter(OSMSettings.OSMTagKey.WEBSITE.getValue(),
|
|
||||||
new EditTextTagFilter(webSiteEditText));
|
|
||||||
tagMapProcessor.addFilter(OSMSettings.OSMTagKey.DESCRIPTION.getValue(),
|
|
||||||
new EditTextTagFilter(descriptionEditText));
|
|
||||||
tagMapProcessor.addFilter(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(),
|
|
||||||
new OpenHoursTagFilter(mOpeningHoursAdapter));
|
|
||||||
|
|
||||||
mIsUserInput = false;
|
// FIXME opening hours
|
||||||
for (Tag tag : getData().tags) {
|
// @Override
|
||||||
tagMapProcessor.process(tag);
|
// public void process( String openingHoursString ) {
|
||||||
|
// parseOpenedHoursHandleErrors(openingHoursString);
|
||||||
|
// if (openingHours == null) {
|
||||||
|
// openingHours = new OpeningHoursParser.OpeningHours();
|
||||||
|
// }
|
||||||
|
// LOG.debug("openingHours=" + openingHours);
|
||||||
|
// adapter.replaceOpeningHours(openingHours);
|
||||||
|
// adapter.updateViews();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onUntriggered() {
|
||||||
|
// adapter.replaceOpeningHours(new OpeningHoursParser.OpeningHours());
|
||||||
|
// adapter.updateViews();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
tagMapProcessor.clearEmptyFields();
|
|
||||||
mIsUserInput = true;
|
protected void addTextWatcher(final String tag, final EditText e) {
|
||||||
|
e.addTextChangedListener(new TextWatcher() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
}
|
}
|
||||||
};
|
|
||||||
mTagsChangedListener.onTagsChanged();
|
@Override
|
||||||
getData().addListener(mTagsChangedListener);
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
if (!getData().isInEdit()) {
|
||||||
|
getData().putTag(tag, s.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
listeners.add(new TagsChangedListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTagsChanged(String t) {
|
||||||
|
if (tag.equals(t)) {
|
||||||
|
String vl = getData().getTagValues().get(tag);
|
||||||
|
if (vl == null) {
|
||||||
|
vl = "";
|
||||||
|
}
|
||||||
|
e.setText(vl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
getData().deleteListener(mTagsChangedListener);
|
for(EditPoiData.TagsChangedListener tl : listeners) {
|
||||||
|
getData().deleteListener(tl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -187,80 +211,10 @@ public class BasicDataFragment extends Fragment {
|
||||||
mOpeningHoursAdapter.setOpeningHoursRule(item, position);
|
mOpeningHoursAdapter.setOpeningHoursRule(item, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TagMapProcessor {
|
|
||||||
private final Map<String, TagFilter> mFilters = new HashMap<>();
|
|
||||||
|
|
||||||
public void addFilter(String tag, TagFilter filter) {
|
|
||||||
mFilters.put(tag, filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void process(Tag tag) {
|
|
||||||
if (mFilters.containsKey(tag.tag)) {
|
|
||||||
final TagFilter filter = mFilters.get(tag.tag);
|
|
||||||
filter.process(tag);
|
|
||||||
mFilters.remove(tag.tag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearEmptyFields() {
|
|
||||||
for (String tag : mFilters.keySet()) {
|
|
||||||
mFilters.get(tag).onUntriggered();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private interface TagFilter {
|
|
||||||
void process(Tag tag);
|
|
||||||
|
|
||||||
void onUntriggered();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class EditTextTagFilter implements TagFilter {
|
|
||||||
private final EditText editText;
|
|
||||||
|
|
||||||
private EditTextTagFilter(EditText editText) {
|
|
||||||
this.editText = editText;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void process(Tag tag) {
|
|
||||||
editText.setText(tag.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUntriggered() {
|
|
||||||
editText.setText(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class OpenHoursTagFilter implements TagFilter {
|
|
||||||
private final OpeningHoursAdapter adapter;
|
|
||||||
|
|
||||||
private OpenHoursTagFilter(OpeningHoursAdapter adapter) {
|
|
||||||
this.adapter = adapter;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void process(Tag tag) {
|
|
||||||
String openingHoursString = tag.value;
|
|
||||||
LOG.debug("openingHoursString=" + openingHoursString);
|
|
||||||
OpeningHoursParser.OpeningHours openingHours =
|
|
||||||
parseOpenedHoursHandleErrors(openingHoursString);
|
|
||||||
if (openingHours == null) {
|
|
||||||
openingHours = new OpeningHoursParser.OpeningHours();
|
|
||||||
// TODO show error message
|
|
||||||
}
|
|
||||||
LOG.debug("openingHours=" + openingHours);
|
|
||||||
adapter.replaceOpeningHours(openingHours);
|
|
||||||
adapter.updateViews();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onUntriggered() {
|
|
||||||
adapter.replaceOpeningHours(new OpeningHoursParser.OpeningHours());
|
|
||||||
adapter.updateViews();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private EditPoiFragment getEditPoiFragment() {
|
private EditPoiFragment getEditPoiFragment() {
|
||||||
return (EditPoiFragment) getParentFragment();
|
return (EditPoiFragment) getParentFragment();
|
||||||
|
@ -480,37 +434,7 @@ public class BasicDataFragment extends Fragment {
|
||||||
return basic;
|
return basic;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MyOnFocusChangeListener implements TextWatcher {
|
|
||||||
private final EditPoiData data;
|
|
||||||
private final String tagName;
|
|
||||||
|
|
||||||
public MyOnFocusChangeListener(EditPoiData data,
|
|
||||||
String tagName) {
|
|
||||||
this.data = data;
|
|
||||||
this.tagName = tagName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void afterTextChanged(Editable s) {
|
|
||||||
if (mIsUserInput) {
|
|
||||||
String string = s.toString();
|
|
||||||
if (!TextUtils.isEmpty(string)) {
|
|
||||||
Tag tag = new Tag(tagName, string);
|
|
||||||
data.tags.remove(tag);
|
|
||||||
data.tags.add(tag);
|
|
||||||
data.notifyDatasetChanged(mTagsChangedListener);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class OpeningHoursAdapter {
|
private class OpeningHoursAdapter {
|
||||||
private OpeningHoursParser.OpeningHours openingHours;
|
private OpeningHoursParser.OpeningHours openingHours;
|
||||||
|
@ -547,12 +471,9 @@ public class BasicDataFragment extends Fragment {
|
||||||
for (int i = 0; i < openingHours.getRules().size(); i++) {
|
for (int i = 0; i < openingHours.getRules().size(); i++) {
|
||||||
linearLayout.addView(getView(i));
|
linearLayout.addView(getView(i));
|
||||||
}
|
}
|
||||||
if (mIsUserInput) {
|
if (!data.isInEdit()) {
|
||||||
Tag openHours = new Tag(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(),
|
data.putTag(OSMSettings.OSMTagKey.OPENING_HOURS.getValue(),
|
||||||
openingHours.toStringNoMonths());
|
openingHours.toStringNoMonths());
|
||||||
data.tags.remove(openHours);
|
|
||||||
data.tags.add(openHours);
|
|
||||||
data.notifyDatasetChanged(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,30 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.access.AccessibleToast;
|
||||||
|
import net.osmand.data.Amenity;
|
||||||
|
import net.osmand.osm.PoiType;
|
||||||
|
import net.osmand.osm.edit.EntityInfo;
|
||||||
|
import net.osmand.osm.edit.Node;
|
||||||
|
import net.osmand.osm.edit.OSMSettings;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.OsmandPlugin;
|
||||||
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.activities.MapActivity;
|
||||||
|
import net.osmand.plus.osmedit.data.EditPoiData;
|
||||||
|
import net.osmand.plus.osmedit.dialogs.DeletePoiDialogFragment;
|
||||||
|
import net.osmand.plus.osmedit.dialogs.PoiSubTypeDialogFragment;
|
||||||
|
import net.osmand.plus.osmedit.dialogs.PoiTypeDialogFragment;
|
||||||
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
|
@ -41,32 +66,6 @@ import android.widget.ImageButton;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
import net.osmand.access.AccessibleToast;
|
|
||||||
import net.osmand.data.Amenity;
|
|
||||||
import net.osmand.osm.PoiType;
|
|
||||||
import net.osmand.osm.edit.EntityInfo;
|
|
||||||
import net.osmand.osm.edit.Node;
|
|
||||||
import net.osmand.osm.edit.OSMSettings;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.OsmandPlugin;
|
|
||||||
import net.osmand.plus.OsmandSettings;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.activities.MapActivity;
|
|
||||||
import net.osmand.plus.osmedit.data.EditPoiData;
|
|
||||||
import net.osmand.plus.osmedit.data.Tag;
|
|
||||||
import net.osmand.plus.osmedit.dialogs.DeletePoiDialogFragment;
|
|
||||||
import net.osmand.plus.osmedit.dialogs.PoiSubTypeDialogFragment;
|
|
||||||
import net.osmand.plus.osmedit.dialogs.PoiTypeDialogFragment;
|
|
||||||
import net.osmand.util.Algorithms;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class EditPoiFragment extends DialogFragment {
|
public class EditPoiFragment extends DialogFragment {
|
||||||
public static final String TAG = "EditPoiFragment";
|
public static final String TAG = "EditPoiFragment";
|
||||||
private static final Log LOG = PlatformUtil.getLog(EditPoiFragment.class);
|
private static final Log LOG = PlatformUtil.getLog(EditPoiFragment.class);
|
||||||
|
@ -75,15 +74,13 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
private static final String KEY_AMENITY = "key_amenity";
|
private static final String KEY_AMENITY = "key_amenity";
|
||||||
private static final String TAGS_LIST = "tags_list";
|
private static final String TAGS_LIST = "tags_list";
|
||||||
|
|
||||||
private final EditPoiData editPoiData = new EditPoiData();
|
private EditPoiData editPoiData;
|
||||||
private ViewPager viewPager;
|
private ViewPager viewPager;
|
||||||
private boolean isLocalEdit;
|
private boolean isLocalEdit;
|
||||||
private boolean mIsUserInput = true;
|
|
||||||
private EditPoiData.TagsChangedListener mTagsChangedListener;
|
|
||||||
private AutoCompleteTextView poiTypeEditText;
|
private AutoCompleteTextView poiTypeEditText;
|
||||||
private Node node;
|
private Node node;
|
||||||
private Map<String, PoiType> allTranslatedSubTypes;
|
private Map<String, PoiType> allTranslatedSubTypes;
|
||||||
public static final String POI_TYPE_TAG = "poi_type_tag";
|
|
||||||
private OpenstreetmapUtil mOpenstreetmapUtil;
|
private OpenstreetmapUtil mOpenstreetmapUtil;
|
||||||
private TextInputLayout poiTypeTextInputLayout;
|
private TextInputLayout poiTypeTextInputLayout;
|
||||||
|
|
||||||
|
@ -102,9 +99,10 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
node = (Node) getArguments().getSerializable(KEY_AMENITY_NODE);
|
node = (Node) getArguments().getSerializable(KEY_AMENITY_NODE);
|
||||||
allTranslatedSubTypes = getMyApplication().getPoiTypes()
|
allTranslatedSubTypes = getMyApplication().getPoiTypes().getAllTranslatedNames();
|
||||||
.getAllTranslatedNames();
|
|
||||||
editPoiData.amenity = (Amenity) getArguments().getSerializable(KEY_AMENITY);
|
Amenity amenity = (Amenity) getArguments().getSerializable(KEY_AMENITY);
|
||||||
|
editPoiData = new EditPoiData(amenity, node, allTranslatedSubTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -127,36 +125,8 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||||
|
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
editPoiData.tags = (LinkedHashSet<Tag>) savedInstanceState.getSerializable(TAGS_LIST);
|
Map<String, String> mp =(Map<String, String>) savedInstanceState.getSerializable(TAGS_LIST);
|
||||||
} else {
|
editPoiData.updateTags(mp);
|
||||||
editPoiData.tags = new LinkedHashSet<>();
|
|
||||||
|
|
||||||
tryAddTag(OSMSettings.OSMTagKey.ADDR_STREET.getValue(),
|
|
||||||
node.getTag(OSMSettings.OSMTagKey.ADDR_STREET));
|
|
||||||
tryAddTag(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER.getValue(),
|
|
||||||
node.getTag(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER));
|
|
||||||
tryAddTag(OSMSettings.OSMTagKey.PHONE.getValue(),
|
|
||||||
editPoiData.amenity.getPhone());
|
|
||||||
tryAddTag(OSMSettings.OSMTagKey.WEBSITE.getValue(),
|
|
||||||
editPoiData.amenity.getSite());
|
|
||||||
for (String tag : node.getTagKeySet()) {
|
|
||||||
tryAddTag(tag, node.getTag(tag));
|
|
||||||
}
|
|
||||||
String subType = editPoiData.amenity.getSubType();
|
|
||||||
String key;
|
|
||||||
String value;
|
|
||||||
if (allTranslatedSubTypes.get(subType) != null) {
|
|
||||||
PoiType pt = allTranslatedSubTypes.get(subType);
|
|
||||||
key = pt.getOsmTag();
|
|
||||||
value = pt.getOsmValue();
|
|
||||||
} else {
|
|
||||||
key = editPoiData.amenity.getType().getDefaultTag();
|
|
||||||
value = subType;
|
|
||||||
}
|
|
||||||
final Tag tag = new Tag(key, value);
|
|
||||||
editPoiData.tags.remove(tag);
|
|
||||||
tag.tag = POI_TYPE_TAG;
|
|
||||||
editPoiData.tags.add(tag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
|
||||||
|
@ -230,11 +200,8 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
final Tag tag = new Tag(OSMSettings.OSMTagKey.NAME.getValue(), s.toString());
|
if (!getEditPoiData().isInEdit()) {
|
||||||
if (mIsUserInput) {
|
getEditPoiData().putTag(OSMSettings.OSMTagKey.NAME.getValue(), s.toString());
|
||||||
getEditPoiData().tags.remove(tag);
|
|
||||||
getEditPoiData().tags.add(tag);
|
|
||||||
getEditPoiData().notifyDatasetChanged(mTagsChangedListener);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -252,11 +219,8 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
final Tag tag = new Tag(POI_TYPE_TAG, s.toString());
|
if (!getEditPoiData().isInEdit()) {
|
||||||
if (mIsUserInput) {
|
getEditPoiData().putTag(EditPoiData.POI_TYPE_TAG, s.toString());
|
||||||
getEditPoiData().tags.remove(tag);
|
|
||||||
getEditPoiData().tags.add(tag);
|
|
||||||
getEditPoiData().notifyDatasetChanged(mTagsChangedListener);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -294,24 +258,24 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OsmPoint.Action action = node.getId() == -1 ? OsmPoint.Action.CREATE : OsmPoint.Action.MODIFY;
|
OsmPoint.Action action = node.getId() == -1 ? OsmPoint.Action.CREATE : OsmPoint.Action.MODIFY;
|
||||||
for (Tag tag : editPoiData.tags) {
|
for (Map.Entry<String, String> tag : editPoiData.getTagValues().entrySet()) {
|
||||||
if (tag.tag.equals(POI_TYPE_TAG)) {
|
if (tag.getKey().equals(EditPoiData.POI_TYPE_TAG)) {
|
||||||
final PoiType poiType = allTranslatedSubTypes.get(tag.value.trim().toLowerCase());
|
final PoiType poiType = allTranslatedSubTypes.get(tag.getValue().trim().toLowerCase());
|
||||||
if (poiType != null) {
|
if (poiType != null) {
|
||||||
node.putTag(poiType.getOsmTag(), poiType.getOsmValue());
|
node.putTag(poiType.getOsmTag(), poiType.getOsmValue());
|
||||||
if (poiType.getOsmTag2() != null) {
|
if (poiType.getOsmTag2() != null) {
|
||||||
node.putTag(poiType.getOsmTag2(), poiType.getOsmValue2());
|
node.putTag(poiType.getOsmTag2(), poiType.getOsmValue2());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
node.putTag(editPoiData.amenity.getType().getDefaultTag(), tag.value);
|
node.putTag(editPoiData.amenity.getType().getDefaultTag(), tag.getValue());
|
||||||
}
|
}
|
||||||
// } else if (tag.tag.equals(OSMSettings.OSMTagKey.DESCRIPTION.getValue())) {
|
// } else if (tag.tag.equals(OSMSettings.OSMTagKey.DESCRIPTION.getValue())) {
|
||||||
// description = tag.value;
|
// description = tag.value;
|
||||||
} else {
|
} else {
|
||||||
if (tag.value.length() > 0) {
|
if (tag.getKey().length() > 0) {
|
||||||
node.putTag(tag.tag, tag.value);
|
node.putTag(tag.getKey(), tag.getValue());
|
||||||
} else {
|
} else {
|
||||||
node.removeTag(tag.tag);
|
node.removeTag(tag.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,15 +333,10 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle outState) {
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
outState.putSerializable(TAGS_LIST, editPoiData.tags);
|
outState.putSerializable(TAGS_LIST, (Serializable) editPoiData.getTagValues());
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryAddTag(String key, String value) {
|
|
||||||
if (!Algorithms.isEmpty(value)) {
|
|
||||||
editPoiData.tags.add(new Tag(key, value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static EditPoiFragment createAddPoiInstance(double latitude, double longitude,
|
public static EditPoiFragment createAddPoiInstance(double latitude, double longitude,
|
||||||
OsmandApplication application) {
|
OsmandApplication application) {
|
||||||
|
@ -407,7 +366,6 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
poiTypeEditText.setText(subCategory);
|
poiTypeEditText.setText(subCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: 8/28/15 Move to some king of helper class
|
|
||||||
public static void commitNode(final OsmPoint.Action action,
|
public static void commitNode(final OsmPoint.Action action,
|
||||||
final Node n,
|
final Node n,
|
||||||
final EntityInfo info,
|
final EntityInfo info,
|
||||||
|
@ -446,13 +404,9 @@ public class EditPoiFragment extends DialogFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateType(Amenity amenity) {
|
public void updateType(Amenity amenity) {
|
||||||
mIsUserInput = false;
|
|
||||||
poiTypeEditText.setText(amenity.getSubType());
|
poiTypeEditText.setText(amenity.getSubType());
|
||||||
mIsUserInput = true;
|
|
||||||
poiTypeTextInputLayout.setHint(amenity.getType().getTranslation());
|
poiTypeTextInputLayout.setHint(amenity.getType().getTranslation());
|
||||||
|
|
||||||
setAdapterForPoiTypeEditText();
|
setAdapterForPoiTypeEditText();
|
||||||
|
|
||||||
poiTypeEditText.setOnTouchListener(new View.OnTouchListener() {
|
poiTypeEditText.setOnTouchListener(new View.OnTouchListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(final View v, MotionEvent event) {
|
public boolean onTouch(final View v, MotionEvent event) {
|
||||||
|
|
|
@ -1,19 +1,121 @@
|
||||||
package net.osmand.plus.osmedit.data;
|
package net.osmand.plus.osmedit.data;
|
||||||
|
|
||||||
import net.osmand.data.Amenity;
|
import java.util.Collections;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import net.osmand.data.Amenity;
|
||||||
|
import net.osmand.osm.PoiType;
|
||||||
|
import net.osmand.osm.edit.Node;
|
||||||
|
import net.osmand.osm.edit.OSMSettings;
|
||||||
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
public class EditPoiData {
|
public class EditPoiData {
|
||||||
private Set<TagsChangedListener> mListeners = new HashSet<>();
|
private Set<TagsChangedListener> mListeners = new HashSet<>();
|
||||||
public LinkedHashSet<Tag> tags;
|
private LinkedHashMap<String, String > tagValues = new LinkedHashMap<String, String>();
|
||||||
public Amenity amenity;
|
private boolean isInEdit = false;
|
||||||
|
public final Amenity amenity;
|
||||||
|
public static final String POI_TYPE_TAG = "poi_type_tag";
|
||||||
|
|
||||||
public void notifyDatasetChanged(TagsChangedListener listenerToSkip) {
|
public EditPoiData(Amenity amenity, Node node, Map<String, PoiType> allTranslatedSubTypes) {
|
||||||
|
this.amenity = amenity;
|
||||||
|
initTags(node, allTranslatedSubTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void updateTags(Map<String, String> mp) {
|
||||||
|
this.tagValues.clear();
|
||||||
|
this.tagValues.putAll(mp);
|
||||||
|
}
|
||||||
|
private void tryAddTag(String key, String value) {
|
||||||
|
if (!Algorithms.isEmpty(value)) {
|
||||||
|
tagValues.put(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTags(Node node, Map<String, PoiType> allTranslatedSubTypes) {
|
||||||
|
checkNotInEdit();
|
||||||
|
tryAddTag(OSMSettings.OSMTagKey.ADDR_STREET.getValue(),
|
||||||
|
node.getTag(OSMSettings.OSMTagKey.ADDR_STREET));
|
||||||
|
tryAddTag(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER.getValue(),
|
||||||
|
node.getTag(OSMSettings.OSMTagKey.ADDR_HOUSE_NUMBER));
|
||||||
|
tryAddTag(OSMSettings.OSMTagKey.PHONE.getValue(),
|
||||||
|
amenity.getPhone());
|
||||||
|
tryAddTag(OSMSettings.OSMTagKey.WEBSITE.getValue(),
|
||||||
|
amenity.getSite());
|
||||||
|
for (String tag : node.getTagKeySet()) {
|
||||||
|
tryAddTag(tag, node.getTag(tag));
|
||||||
|
}
|
||||||
|
String subType = amenity.getSubType();
|
||||||
|
String key;
|
||||||
|
String value;
|
||||||
|
if (allTranslatedSubTypes.get(subType) != null) {
|
||||||
|
PoiType pt = allTranslatedSubTypes.get(subType);
|
||||||
|
key = pt.getOsmTag();
|
||||||
|
value = pt.getOsmValue();
|
||||||
|
} else {
|
||||||
|
key = amenity.getType().getDefaultTag();
|
||||||
|
value = subType;
|
||||||
|
}
|
||||||
|
tagValues.remove(key);
|
||||||
|
tagValues.put(POI_TYPE_TAG, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Map<String, String> getTagValues() {
|
||||||
|
return Collections.unmodifiableMap(tagValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void putTag(String tag, String value) {
|
||||||
|
checkNotInEdit();
|
||||||
|
try {
|
||||||
|
isInEdit = true;
|
||||||
|
tagValues.put(tag, value);
|
||||||
|
notifyDatasetChanged(tag);
|
||||||
|
} finally {
|
||||||
|
isInEdit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkNotInEdit() {
|
||||||
|
if(isInEdit) {
|
||||||
|
throw new IllegalStateException("Can't modify in edit mode");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void notifyToUpdateUI() {
|
||||||
|
checkNotInEdit();
|
||||||
|
try {
|
||||||
|
isInEdit = true;
|
||||||
|
notifyDatasetChanged(null);
|
||||||
|
} finally {
|
||||||
|
isInEdit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeTag(String tag) {
|
||||||
|
checkNotInEdit();
|
||||||
|
try {
|
||||||
|
isInEdit = true;
|
||||||
|
tagValues.remove(tag);
|
||||||
|
notifyDatasetChanged(tag);
|
||||||
|
} finally {
|
||||||
|
isInEdit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isInEdit() {
|
||||||
|
return isInEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void notifyDatasetChanged(String tag) {
|
||||||
for (TagsChangedListener listener : mListeners) {
|
for (TagsChangedListener listener : mListeners) {
|
||||||
if (listener != listenerToSkip) listener.onTagsChanged();
|
listener.onTagsChanged(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +128,8 @@ public class EditPoiData {
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface TagsChangedListener {
|
public interface TagsChangedListener {
|
||||||
void onTagsChanged();
|
|
||||||
|
void onTagsChanged(String tag);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,39 +0,0 @@
|
||||||
package net.osmand.plus.osmedit.data;
|
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
public class Tag implements Serializable {
|
|
||||||
private static final Log LOG = PlatformUtil.getLog(Tag.class);
|
|
||||||
public String tag;
|
|
||||||
public String value;
|
|
||||||
|
|
||||||
public Tag(String tag, String value) {
|
|
||||||
this.tag = tag;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) return true;
|
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
|
||||||
Tag tag1 = (Tag) o;
|
|
||||||
return tag.equals(tag1.tag);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return tag.hashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "Tag{" +
|
|
||||||
"tag='" + tag + '\'' +
|
|
||||||
", value='" + value + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,6 +5,8 @@ import net.osmand.core.android.TileSourceProxyProvider;
|
||||||
import net.osmand.core.jni.MapLayerConfiguration;
|
import net.osmand.core.jni.MapLayerConfiguration;
|
||||||
import net.osmand.core.jni.PointI;
|
import net.osmand.core.jni.PointI;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
import net.osmand.data.QuadPointDouble;
|
||||||
|
import net.osmand.data.QuadRect;
|
||||||
import net.osmand.data.RotatedTileBox;
|
import net.osmand.data.RotatedTileBox;
|
||||||
import net.osmand.map.ITileSource;
|
import net.osmand.map.ITileSource;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
@ -174,19 +176,19 @@ public class MapVectorLayer extends BaseMapLayer {
|
||||||
canvas.rotate(rot, currentViewport.getCenterPixelX(), currentViewport.getCenterPixelY());
|
canvas.rotate(rot, currentViewport.getCenterPixelX(), currentViewport.getCenterPixelY());
|
||||||
final RotatedTileBox calc = currentViewport.copy();
|
final RotatedTileBox calc = currentViewport.copy();
|
||||||
calc.setRotate(bmpLoc.getRotate());
|
calc.setRotate(bmpLoc.getRotate());
|
||||||
// int cz = currentViewport.getZoom();
|
QuadPointDouble lt = bmpLoc.getLeftTopTile(bmpLoc.getZoom());
|
||||||
// QuadPointDouble lt = bmpLoc.getLeftTopTile(cz);
|
QuadPointDouble rb = bmpLoc.getRightBottomTile(bmpLoc.getZoom());
|
||||||
// QuadPointDouble rb = bmpLoc.getRightBottomTile(cz);
|
final float x1 = calc.getPixXFromTile(lt.x, lt.y, bmpLoc.getZoom());
|
||||||
// final float x1 = calc.getPixXFromTile(lt.x, lt.y, cz);
|
final float x2 = calc.getPixXFromTile(rb.x, rb.y, bmpLoc.getZoom());
|
||||||
// final float x2 = calc.getPixXFromTile(rb.x, rb.y, cz);
|
final float y1 = calc.getPixYFromTile(lt.x, lt.y, bmpLoc.getZoom());
|
||||||
// final float y1 = calc.getPixYFromTile(lt.x, lt.y, cz);
|
final float y2 = calc.getPixYFromTile(rb.x, rb.y, bmpLoc.getZoom());
|
||||||
// final float y2 = calc.getPixYFromTile(rb.x, rb.y, cz);
|
|
||||||
LatLon lt = bmpLoc.getLeftTopLatLon();
|
// LatLon lt = bmpLoc.getLeftTopLatLon();
|
||||||
LatLon rb = bmpLoc.getRightBottomLatLon();
|
// LatLon rb = bmpLoc.getRightBottomLatLon();
|
||||||
final float x1 = calc.getPixXFromLatLon(lt.getLatitude(), lt.getLongitude());
|
// final float x1 = calc.getPixXFromLatLon(lt.getLatitude(), lt.getLongitude());
|
||||||
final float x2 = calc.getPixXFromLatLon(rb.getLatitude(), rb.getLongitude());
|
// final float x2 = calc.getPixXFromLatLon(rb.getLatitude(), rb.getLongitude());
|
||||||
final float y1 = calc.getPixYFromLatLon(lt.getLatitude(), lt.getLongitude());
|
// final float y1 = calc.getPixYFromLatLon(lt.getLatitude(), lt.getLongitude());
|
||||||
final float y2 = calc.getPixYFromLatLon(rb.getLatitude(), rb.getLongitude());
|
// final float y2 = calc.getPixYFromLatLon(rb.getLatitude(), rb.getLongitude());
|
||||||
destImage.set(x1, y1, x2, y2);
|
destImage.set(x1, y1, x2, y2);
|
||||||
if (!bmp.isRecycled()) {
|
if (!bmp.isRecycled()) {
|
||||||
canvas.drawBitmap(bmp, null, destImage, paintImg);
|
canvas.drawBitmap(bmp, null, destImage, paintImg);
|
||||||
|
|
|
@ -831,6 +831,9 @@ public class VoiceRouter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void makeSound(){
|
private void makeSound(){
|
||||||
|
if(isMute()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
SoundPool sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
|
SoundPool sp = new SoundPool(5, AudioManager.STREAM_MUSIC, 0);
|
||||||
int soundClick = -1;
|
int soundClick = -1;
|
||||||
boolean success = true;
|
boolean success = true;
|
||||||
|
|
Loading…
Reference in a new issue