Merge branch 'master' of github.com:osmandapp/Osmand

This commit is contained in:
Victor Shcherb 2015-09-30 01:06:05 +02:00
commit e6d8f75583
38 changed files with 1370 additions and 204 deletions

19
LICENSE
View file

@ -44,6 +44,25 @@
* 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
* 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
- LGPL (http://www.qt.io/qt-licensing-terms/)

View file

@ -44,8 +44,13 @@ public class OsmandRegions {
Map<String, String> fullMapNamesToDownloadNames = new HashMap<String, String>();
Map<String, String> downloadNamesToFullNames = 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 ;
public Map<String, String> getFullNamesToLowercaseCopy() {
return new HashMap<String, String>(fullNamesToLowercaseIndex);
}
Integer parentFullName = null;
Integer fullNameType = null;
@ -86,7 +91,15 @@ public class OsmandRegions {
}
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) {
if(downloadName == null) {
return null;
@ -304,7 +317,15 @@ public class OsmandRegions {
public String getMapDownloadType(String 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 {
// final Collator clt = OsmAndCollator.primaryCollator();
final Map<String, String> parentRelations = new LinkedHashMap<String, String>();
@ -323,6 +344,7 @@ public class OsmandRegions {
String parentFullName = getParentFullName(object);
String fullName = getFullName(object);
if(!Algorithms.isEmpty(parentFullName)) {
fullNamesToParentFullNames.put(fullName, parentFullName);
parentRelations.put(fullName, parentFullName);
}
String locName = getLocaleName(object);
@ -350,6 +372,7 @@ public class OsmandRegions {
fullNamesToLowercaseIndex.put(fullName, ind.toString());
String downloadName = getDownloadName(object);
if(downloadName != null) {
fullNamesToDownloadNames.put(fullName, downloadName);
downloadNamesToFullNames.put(downloadName, fullName);
if(isDownloadOfType(object, MAP_TYPE)) {
fullMapNamesToDownloadNames.put(fullName, downloadName);

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dialog_content_bottom_margin"
android:paddingLeft="@dimen/dialog_content_margin"
android:paddingRight="@dimen/dialog_content_margin"
android:paddingTop="@dimen/dialog_content_bottom_margin">
<LinearLayout
android:id="@+id/list_container"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="44dp"
android:layout_height="50dp">
<ImageView
android:id="@+id/image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:scaleType="center"
android:src="@drawable/ic_action_folder"/>
</LinearLayout>
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_transparent"
android:text="Restaurant"
android:gravity="left|center_vertical"
android:textSize="@dimen/default_list_text_size"
android:textAllCaps="false"/>
</LinearLayout>

View file

@ -47,6 +47,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/poi_dialog_name"
android:imeOptions="actionSend"
android:inputType="text"
tools:text="@string/lorem_ipsum"/>
</android.support.design.widget.TextInputLayout>
@ -80,6 +82,8 @@
android:completionThreshold="1"
android:drawableRight="@drawable/ic_action_arrow_drop_down"
android:hint="@string/poi_dialog_poi_type"
android:imeOptions="actionSend"
android:inputType="text"
tools:text="@string/lorem_ipsum"/>
</android.support.design.widget.TextInputLayout>

View file

@ -114,6 +114,7 @@
android:layout_marginLeft="8dp"
android:textColor="?android:textColorPrimary"
android:textColorHint="?android:textColorSecondary"
android:text="Name"
android:inputType="text"/>
@ -167,7 +168,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginRight="16dp"
android:layout_marginLeft="8dp"/>
android:layout_marginLeft="8dp"
android:completionThreshold="1"
android:drawableRight="@drawable/ic_action_arrow_drop_down"/>
</LinearLayout>

View file

@ -117,7 +117,7 @@
<string name="poi_traffic_calming_rumble_strip">Rumlestriber</string>
<string name="poi_traffic_calming_table">Plateau bumb</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_service_tyres">Dækservice</string>
@ -1443,4 +1443,148 @@
<string name="poi_love_hotel">Kærlighedshotel</string>
<string name="poi_payment_coins_yes">Acceptere mønter</string>
<string name="poi_payment_coins_no">Acceptere ikke mønter</string>
<string name="poi_payment_coins_0.5">Acceptere $0,5 mønter</string>
<string name="poi_payment_coins_50c12">Acceptere 50c, 1€ og 2€ mønter</string>
<string name="poi_payment_telephone_cards_yes">Acceptere telefonkort</string>
<string name="poi_payment_telephone_cards_no">Acceptere ikke telefonkort</string>
<string name="poi_payment_credit_cards_yes">Acceptere kreditkort</string>
<string name="poi_payment_credit_cards_no">Acceptere ikke kreditkort</string>
<string name="poi_payment_notes_yes">Acceptere papirpenge</string>
<string name="poi_payment_notes_no">Acceptere ikke papirpenge</string>
<string name="poi_payment_electronic_purses_yes">Accepter elektroniske punge</string>
<string name="poi_payment_electronic_purses_no">Accepter ikke elektroniske punge</string>
<string name="poi_payment_cash_yes">Acceptere kontanter</string>
<string name="poi_payment_cash_no">Accepter ikke kontanter</string>
<string name="poi_payment_debit_cards_yes">Accepter betalingskort</string>
<string name="poi_payment_debit_cards_no">Accepter ikke betalingskort</string>
<string name="poi_payment_bitcoin_yes">Acceptere Bitcoins</string>
<string name="poi_payment_bitcoin_no">Acceptere ikke Bitcoins</string>
<string name="poi_payment_visa_yes">Acceptere Visakort</string>
<string name="poi_payment_visa_no">Acceptere ikke Visakort</string>
<string name="poi_payment_mastercard_yes">Accepter MasterCard</string>
<string name="poi_payment_mastercard_no">Acceptere ikke MasterCard</string>
<string name="poi_payment_none">Gratis</string>
<string name="poi_payment_account_cards_yes">Acceptere kontokort</string>
<string name="poi_payment_account_cards_no">Acceptere ikke kontokort</string>
<string name="poi_payment_maestro_yes">Accepter Maestro-kort</string>
<string name="poi_payment_maestro_no">Accepter ikke Maestro-kort</string>
<string name="poi_payment_american_express_yes">Accepter American Express (AMEX) kort</string>
<string name="poi_payment_american_express_no">Accepter ikke American Express (AMEX) kort</string>
<string name="poi_payment_diners_club_yes">Accepter Diners Club-kort</string>
<string name="poi_payment_diners_club_no">Accepter ikke Diners Club-kort</string>
<string name="poi_payment_dkv_yes">Accepter DKV</string>
<string name="poi_payment_dkv_no">"Accepter ikke DKV"</string>
<string name="poi_payment_uta_yes">Accepter UTA kort</string>
<string name="poi_payment_uta_no">Accepter ikke UTA kort</string>
<string name="poi_payment_efectivo_yes">Accepter Efectivo</string>
<string name="poi_payment_efectivo_no">Accepter ikke Efectivo</string>
<string name="poi_payment_girocard_yes">Accepter girokort</string>
<string name="poi_payment_girocard_no">Accepter ikke girokort</string>
<string name="poi_payment_discover_card_yes">Acceptere Discover kort</string>
<string name="poi_payment_discover_card_no">Acceptere ikke Discover Card</string>
<string name="poi_payment_visa_electron_yes">Accepter Visa Electron-kort</string>
<string name="poi_payment_visa_electron_no">Accepter ikke Visa Electron-kort</string>
<string name="poi_payment_litecoin_yes">Accepter Litecoins</string>
<string name="poi_payment_litecoin_no">Accepter ikke Litecoins</string>
<string name="poi_payment_cheque_yes">Accepter checks</string>
<string name="poi_payment_cheque_no">Accepter ikke checks</string>
<string name="poi_payment_pikepass_yes">Accepter PIKEPASS</string>
<string name="poi_payment_pikepass_no">Accepter ikke PIKEPASS</string>
<string name="poi_payment_pikepass_designated">Acceptere PIKEPASS (udpeget)</string>
<string name="poi_payment_visa_debit_yes">Accepter Visa betalingskort</string>
<string name="poi_payment_visa_debit_no">Accepter ikke Visa betalingskort</string>
<string name="poi_payment_cryptocurrencies_no">Accepter ikke kryptovalutaer</string>
<string name="poi_payment_others_yes">Accepter andre betalingsformer</string>
<string name="poi_payment_others_no">Accepter ikke andre betalingsformer</string>
<string name="poi_payment_routex_yes">Accepter Routex brændstof kort</string>
<string name="poi_payment_routex_no">Accepter ikke Routex brændstof kort</string>
<string name="poi_payment_bancomat_yes">Accepter Bancomat</string>
<string name="poi_payment_bancomat_no">Accepter ikke Bancomat</string>
<string name="poi_payment_icsf_yes">Acceptere IC lagret billetpris kort</string>
<string name="poi_payment_icsf_no">Acceptere ikke IC lagret billetpris kort</string>
<string name="poi_payment_prepaid_ticket_yes">Accepter forudbetalte billetter</string>
<string name="poi_payment_jcb_yes">Accepter JCB kort</string>
<string name="poi_payment_jcb_no">Accepter ikke JCB kort</string>
<string name="poi_payment_laser_yes">Accepter Laser-kort</string>
<string name="poi_payment_laser_no">Accepter ikke Laser-kort</string>
<string name="poi_payment_ep_quick_yes">Accepter Quick kort</string>
<string name="poi_payment_ep_quick_no">Accepter ikke Quick kort</string>
<string name="poi_payment_eurowag_yes">Accepter Eurowag kort</string>
<string name="poi_payment_eurowag_no">Accepter ikke Eurowag kort</string>
<string name="poi_payment_e_zpass_yes">Accepter EZPass</string>
<string name="poi_payment_e_zpass_no">Accepter ikke EZPass</string>
<string name="poi_payment_euroshell_yes">Acceptere Euroshell brændstof kort</string>
<string name="poi_payment_euroshell_no">Accepter ikke Euroshell brændstof kort</string>
<string name="poi_payment_kitcard_yes">Accepter KITCard</string>
<string name="poi_payment_kitcard_no">Accepter ikke KITCard</string>
<string name="poi_payment_westfalen_card_yes">Acceptere Westfalen kort</string>
<string name="poi_payment_westfalen_card_no">Accepter ikke Westfalen kort</string>
<string name="poi_payment_v_pay_yes">Accepter V PAY kort</string>
<string name="poi_payment_v_pay_no">Accepter ikke V PAY kort</string>
<string name="poi_payment_dogecoin_yes">Accepter Dogecoin</string>
<string name="poi_payment_dogecoin_no">Accepter ikke Dogecoin</string>
<string name="poi_payment_cibus_yes">Accepter Cibus kort</string>
<string name="poi_payment_cibus_no">Acceptere ikke Cibus kort</string>
<string name="poi_payment_wire_transfer_yes">Acceptere bankoverførsler</string>
<string name="poi_payment_wire_transfer_no">Accepter ikke bankoverførsler</string>
<string name="poi_payment_ep_cash_yes">Acceptere kontanter (Geldkarte)</string>
<string name="poi_payment_ep_cash_no">Accepter ikke kontanter (Geldkarte)</string>
<string name="poi_payment_ep_proton_yes">Acceptere Proton kort</string>
<string name="poi_payment_ep_proton_no">Accepter ikke Proton kort</string>
<string name="poi_payment_ep_avant_yes">Accepter AvantCard</string>
<string name="poi_payment_ep_avant_no">Accepter ikke AvantCard</string>
<string name="poi_payment_ep_mep_yes">Acceptere MEP</string>
<string name="poi_payment_ep_mep_no">Accepter ikke MEP</string>
<string name="poi_payment_ep_minipay_yes">Accepter Minipay</string>
<string name="poi_payment_ep_minipay_no">Accepter ikke Minipay</string>
<string name="poi_payment_ep_minicash_yes">Accepter miniCash</string>
<string name="poi_payment_ep_minicash_no">Accepter ikke miniCash</string>
<string name="poi_payment_ep_moneo_yes">Acceptere Moneo</string>
<string name="poi_payment_ep_moneo_no">Accepter ikke Moneo</string>
<string name="poi_payment_ep_monedero4b_yes">Acceptere Monedero 4B</string>
<string name="poi_payment_ep_monedero4b_no">Áccepter ikke Monedero 4B</string>
<string name="poi_payment_ep_monedero_yes">Accepter Monedero</string>
<string name="poi_payment_ep_monedero_no">Accepter ikke Monedero</string>
<string name="poi_payment_bankaxess_yes">Accepter BankAxess</string>
<string name="poi_payment_bankaxess_no">Acceptere ikke BankAxess</string>
<string name="poi_payment_coinkite_yes">Accepter Coinkite</string>
<string name="poi_payment_coinkite_no">Accepter ikke Coinkite</string>
<string name="poi_payment_roadrunner_yes">Acceptere Roadrunner kort</string>
<string name="poi_payment_roadrunner_no">Accepter ikke Roadrunner kort</string>
<string name="poi_payment_svg_yes">Acceptere SVG</string>
<string name="poi_payment_svg_no">Accepter ikke SVG</string>
<string name="poi_payment_sms_yes">Accepter SMS betalinger</string>
<string name="poi_payment_sms_no">Accepter ikke SMS betalinger</string>
<string name="poi_payment_ov_chipkaart_yes">Acceptere OV-Chipkaart</string>
<string name="poi_payment_ov_chipkaart_no">Accepter ikke OV-Chipkaart</string>
<string name="poi_payment_oyster_yes">Accepter Oyster kort</string>
<string name="poi_payment_oyster_no">Accepter ikke Oyster kort</string>
<string name="poi_payment_sube_yes">Accepter SUBE kort</string>
<string name="poi_payment_sube_no">Accepter ikke SUBE kort</string>
<string name="poi_payment_via_verde_yes">Acceptere Via Verde</string>
<string name="poi_payment_via_verde_no">Accepter ikke Via Verde</string>
<string name="poi_payment_meal_voucher_yes">Acceptere spisebilletter</string>
<string name="poi_payment_meal_voucher_no">Accepter ikke spisebilletter</string>
<string name="poi_payment_paypal_yes">Acceptere PayPal</string>
<string name="poi_payment_paypal_no">Accepter ikke PayPal</string>
<string name="poi_payment_u_key_yes">Accepter U-Key</string>
<string name="poi_payment_u_key_no">Accepter ikke U-Key</string>
<string name="poi_payment_token_yes">Acceptere poletter</string>
<string name="poi_payment_token_no">Accepter ikke poletter</string>
<string name="poi_payment_gift_card_yes">Accepter gavekort</string>
<string name="poi_payment_gift_card_no">Accepter ikke gavekort</string>
<string name="poi_payment_golden_crown_yes">Accepter Golden Crown kort</string>
<string name="poi_payment_golden_crown_no">Accepter Golden Crown kort</string>
<string name="poi_payment_pro100_yes">Acceptere PRO100 kort</string>
<string name="poi_payment_pro100_no">Accepter ikke PRO100 kort</string>
<string name="poi_payment_union_card_yes">Accepter Union kort</string>
<string name="poi_payment_union_card_no">Accepter ikke Union kort</string>
<string name="poi_payment_mtsmoney_yes">Acceptere MTS-penge</string>
<string name="poi_payment_mtsmoney_no">Accepter ike MTS-penge</string>
<string name="poi_payment_yandexmoney_yes">Acceptere Yandex.Money</string>
<string name="poi_payment_yandexmoney_no">Accepter ikke Yandex.Money</string>
<string name="poi_description_payment">Betalingsbeskrivelse</string>
</resources>

View file

@ -758,7 +758,7 @@
<string name="si_km_m">Kilometer/meter</string>
<string name="yard">yd</string>
<string name="foot">fod</string>
<string name="mile_per_hour">mi/t</string>
<string name="mile_per_hour">mph</string>
<string name="mile">mil</string>
<string name="send_location_way_choose_title">Del placering ved hjælp af</string>
<string name="send_location_sms_pattern">Placering: %1$s
@ -2143,4 +2143,21 @@
<string name="shared_string_trip_recording">Optag ture</string>
<string name="shared_string_navigation">Navigation</string>
<string name="osmand_running_in_background">Kører i baggrunden</string>
<string name="default_speed_system">Hastighedsmåling</string>
<string name="nm">nmi</string>
<string name="si_nm">Sømil</string>
<string name="si_kmh">Kilometer i timen</string>
<string name="si_mph">Mil i timen</string>
<string name="si_m_s">Meter i sekundet</string>
<string name="si_min_km">Minutter pr. kilometer</string>
<string name="si_min_m">Minutter pr. mil</string>
<string name="si_nm_h">Sømil i timen (knob)</string>
<string name="nm_h">nmi/t</string>
<string name="min_mile">min/mil</string>
<string name="min_km">min/km</string>
<string name="m_s">m/s</string>
<string name="default_speed_system_descr">Vælg enheder</string>
<string name="favorite_category_add_new">Tilføj ny</string>
<string name="favorite_category_select">Vælg kategori</string>
</resources>

View file

@ -2060,10 +2060,27 @@
<string name="simulate_your_location_stop_descr">Parar simulación de ubicación</string>
<string name="simulate_your_location_descr">Simular usando grabación GPX o ruta calculada</string>
<string name="downloads_left_template">Quedan %1$s descargas</string>
<string name="shared_string_trip_recording">Grabando viaje</string>
<string name="shared_string_trip_recording">Grabación de viaje</string>
<string name="shared_string_navigation">Navegación</string>
<string name="osmand_running_in_background">Ejecutando en segundo plano</string>
<string name="favourites_edit_dialog_title">Información del favorito</string>
<string name="favourites_context_menu_add">Añadir favorito</string>
<string name="roads">Caminos</string>
</resources>
<string name="default_speed_system_descr">Define el sistema de medición de velocidad</string>
<string name="default_speed_system">Medición de la velocidad</string>
<string name="nm">nm</string>
<string name="si_nm">Millas náuticas</string>
<string name="si_kmh">Kilómetros por hora</string>
<string name="si_mph">Millas por hora</string>
<string name="si_m_s">Metros por segundo</string>
<string name="si_min_km">Minutos por kilómetro</string>
<string name="si_min_m">Minutos por milla</string>
<string name="si_nm_h">Millas náuticas por hora (nudos)</string>
<string name="nm_h">nmh</string>
<string name="min_mile">min/m</string>
<string name="min_km">min/km</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>

View file

@ -2197,4 +2197,25 @@
<string name="simulate_your_location_stop_descr">Parar simulación de posición</string>
<string name="simulate_your_location_descr">Simular utilizando grabación GPX o ruta calculada</string>
<string name="downloads_left_template">Quedan %$1s descargas</string>
<string name="default_speed_system_descr">Define el sistema de medición de velocidad</string>
<string name="default_speed_system">Medición de la velocidad</string>
<string name="nm">nm</string>
<string name="si_nm">Millas náuticas</string>
<string name="si_kmh">Kilómetros por hora</string>
<string name="si_mph">Millas por hora</string>
<string name="si_m_s">Metros por segundo</string>
<string name="si_min_km">Minutos por kilómetro</string>
<string name="si_min_m">Minutos por milla</string>
<string name="si_nm_h">Millas náuticas por hora (nudos)</string>
<string name="nm_h">nmh</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">Grabación de viaje</string>
<string name="shared_string_navigation">Navegación</string>
<string name="osmand_running_in_background">Ejecutando en segundo plano</string>
<string name="favourites_edit_dialog_title">Información del favorito</string>
<string name="favourites_context_menu_add">Añadir favorito</string>
<string name="roads">Carreteras</string>
</resources>

View file

@ -2181,4 +2181,6 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="min_km">min/km</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>

View file

@ -2187,4 +2187,19 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="shared_string_trip_recording">Registrazione viaggio</string>
<string name="shared_string_navigation">Navigazione</string>
<string name="osmand_running_in_background">Avviato in backgroung</string>
<string name="default_speed_system_descr">Definsci l\'unità di misura della velocità</string>
<string name="default_speed_system">Misurazione della velocità</string>
<string name="nm">nm</string>
<string name="si_nm">Miglia nautiche</string>
<string name="si_kmh">Chilometri all\'ora</string>
<string name="si_mph">Miglia per ora</string>
<string name="si_m_s">Metri al secondo</string>
<string name="si_min_km">Minuti al chilometro</string>
<string name="si_min_m">Minuti per miglia</string>
<string name="si_nm_h">Miglia nautiche per ora (knot)</string>
<string name="nm_h">nmh</string>
<string name="min_mile">min/m</string>
<string name="min_km">min/km</string>
<string name="m_s">m/s</string>
</resources>

View file

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<string name="poi_bakery">Булочная</string>
<string name="poi_alcohol">Винно-водочный магазин</string>
@ -1199,7 +1199,7 @@
<string name="poi_piste_grooming_backcountry">Обслуживание трассы: кросс-кантри</string>
<string name="poi_piste_grooming_scooter">Обслуживание трассы: снежный скутер</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_garden_type_community">Тип сада: общественный</string>
@ -1257,4 +1257,146 @@
<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">Принимается EZPass</string>
<string name="poi_payment_e_zpass_no">EZPass не принимается</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>
</resources>

View file

@ -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_context_menu_add">Pridať obľúbený bod</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>

View file

@ -364,14 +364,14 @@
<string name="poi_hunting_lodge">Lovska koča</string>
<string name="poi_place_of_worship">Svetišče</string>
<string name="poi_religion_christian">Svetišče: krščansko</string>
<string name="poi_religion_jewish">Svetišče: židovsko</string>
<string name="poi_religion_muslim">Svetišče: muslimansko</string>
<string name="poi_religion_sikh">Svetišče: sikhovsko</string>
<string name="poi_religion_buddhist">Svetišče: budistično</string>
<string name="poi_religion_hindu">Svetišče: hindujsko</string>
<string name="poi_religion_shinto">Svetišče: sintsko</string>
<string name="poi_religion_taoist">Svetišče: taoistično</string>
<string name="poi_religion_christian">Krščansko svetišče</string>
<string name="poi_religion_jewish">Židovsko svetišče</string>
<string name="poi_religion_muslim">Muslimansko svetišče</string>
<string name="poi_religion_sikh">Sikhovsko svetišče</string>
<string name="poi_religion_buddhist">Budistično svetišče</string>
<string name="poi_religion_hindu">Hindujsko svetišče</string>
<string name="poi_religion_shinto">Sintsko svetišče</string>
<string name="poi_religion_taoist">Taoistično svetišče</string>
<string name="poi_internet_access_wlan">Internetni dostop: wlan</string>
<string name="poi_internet_access_terminal">Internetni dostop: terminalski</string>
@ -413,4 +413,5 @@
<string name="poi_barrier_entrance">Vhod</string>
<string name="poi_entrance_main">Glavni vhod</string>
<string name="poi_entrance">Vhod</string>
</resources>
<string name="poi_hiking_routes">Pohodniške poti</string>
</resources>

View file

@ -1995,4 +1995,21 @@
<string name="osmand_running_in_background">Delovanje v ozadju</string>
<string name="favourites_edit_dialog_title">Podrobnosti o točki</string>
<string name="favourites_context_menu_add">Dodaj priljubljeno</string>
</resources>
<string name="favorite_category_add_new">Dodaj novo</string>
<string name="favorite_category_select">Izberi kategorijo</string>
<string name="default_speed_system_descr">Določi sistem merjenja hitrosti</string>
<string name="default_speed_system">Merjenje hitrosti</string>
<string name="nm">nmi</string>
<string name="si_nm">Morske milje</string>
<string name="si_kmh">Kilometri na uro</string>
<string name="si_mph">Milje na uro</string>
<string name="si_m_s">Metri na sekundo</string>
<string name="si_min_km">Minute na kilometer</string>
<string name="si_min_m">Minute na miljo</string>
<string name="si_nm_h">Morske milje na uro (vozli)</string>
<string name="nm_h">nmi/h</string>
<string name="min_mile">min/m</string>
<string name="min_km">min/km</string>
<string name="m_s">m/s</string>
</resources>

View file

@ -2005,4 +2005,18 @@
<string name="favourites_edit_dialog_title">Information om favoriter</string>
<string name="roads">Vägar</string>
<string name="favourites_context_menu_add">Lägg till favorit</string>
</resources>
<string name="default_speed_system_descr">Ange system för hastighetsmätning</string>
<string name="default_speed_system">Hastighetsmätning</string>
<string name="si_nm">Sjömil</string>
<string name="si_kmh">Kilometer i timmen</string>
<string name="si_mph">Engelska mil i timmen</string>
<string name="si_m_s">Meter i sekunden</string>
<string name="si_min_km">Minuter per kilometer</string>
<string name="si_min_m">Minuter per engelsk mil</string>
<string name="si_nm_h">Sjömil i timmen (knop)</string>
<string name="shared_string_trip_recording">Trippinspelning</string>
<string name="shared_string_navigation">Navigering</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>

View file

@ -2122,4 +2122,21 @@
<string name="shared_string_trip_recording">旅程錄製</string>
<string name="shared_string_navigation">導航</string>
<string name="osmand_running_in_background">在背景執行</string>
<string name="default_speed_system_descr">定義速度測定系統</string>
<string name="default_speed_system">測定速度</string>
<string name="si_nm">海浬</string>
<string name="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="min_mile">分/公尺</string>
<string name="min_km">分/公里</string>
<string name="m_s">秒/公尺</string>
<string name="nm_h">浬時</string>
<string name="favorite_category_add_new">增加新的</string>
<string name="favorite_category_select">選擇類別</string>
</resources>

View file

@ -1404,4 +1404,148 @@
<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 EZPass</string>
<string name="poi_payment_e_zpass_no">Don\'t accept EZPass</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>
</resources>

View file

@ -1,4 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<resources>
<!--
Disclaimer:
@ -9,6 +9,8 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
<string name="favorite_category_add_new">Add new</string>
<string name="favorite_category_select">Select category</string>
<string name="default_speed_system_descr">Define speed measurement system</string>
<string name="default_speed_system">Speed measurement</string>
<string name="nm">nm</string>

View file

@ -211,6 +211,7 @@ public class AppInitializer implements IProgress {
new FileOutputStream(file));
}
app.regions.prepareFile(file.getAbsolutePath());
loadWorldRegions();
}
} catch (Exception e) {
warnings.add(e.getMessage());
@ -218,6 +219,9 @@ public class AppInitializer implements IProgress {
}
}
private void loadWorldRegions() {
app.worldRegion = WorldRegion.loadWorldRegions(app);
}
private void initPoiTypes() {
if(app.getAppPath("poi_types.xml").exists()) {

View file

@ -435,6 +435,14 @@ public class FavouritesDbHelper {
}
}
public FavoriteGroup getGroup(String name) {
if (flatGroups.containsKey(name)) {
return flatGroups.get(name);
} else {
return null;
}
}
private FavouritePoint findFavoriteByAllProperties(String category, String name, double lat, double lon){
if (flatGroups.containsKey(category)) {
FavoriteGroup fg = flatGroups.get(category);

View file

@ -96,7 +96,8 @@ public class OsmandApplication extends Application {
AvoidSpecificRoads avoidSpecificRoads;
BRouterServiceConnection bRouterServiceConnection;
OsmandRegions regions;
WorldRegion worldRegion;
RoutingConfiguration.Builder defaultRoutingConfig;
private Locale preferredLocale = null;
@ -653,7 +654,10 @@ public class OsmandApplication extends Application {
public OsmandRegions getRegions() {
return regions;
}
public WorldRegion getWorldRegion() {
return worldRegion;
}
public boolean accessibilityExtensions() {
return (Build.VERSION.SDK_INT < 14) ? getSettings().ACCESSIBILITY_EXTENSIONS.get() : false;
}

View 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;
}
}

View file

@ -1,12 +1,12 @@
package net.osmand.plus.activities;
import java.util.List;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import java.util.List;
/**
* Created by Denis
* on 26.01.2015.
@ -34,7 +34,7 @@ public class TabActivity extends ActionBarProgressActivity {
pager.setAdapter(new OsmandFragmentPagerAdapter(getSupportFragmentManager(), items));
}
public static class OsmandFragmentPagerAdapter extends FragmentPagerAdapter {
public static class OsmandFragmentPagerAdapter extends FragmentStatePagerAdapter {
private List<TabItem> mTabs;

View file

@ -21,9 +21,11 @@ import net.osmand.plus.download.newimplementation.IndexItemCategoryWithSubcat;
import java.lang.ref.WeakReference;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Created by Denis
@ -33,7 +35,7 @@ public class BaseDownloadActivity extends ActionBarProgressActivity {
protected DownloadActivityType type = DownloadActivityType.NORMAL_FILE;
protected OsmandSettings settings;
public static DownloadIndexesThread downloadListIndexThread;
protected List<WeakReference<Fragment>> fragList = new ArrayList<>();
protected Set<WeakReference<Fragment>> fragSet = new HashSet<>();
protected List<IndexItem> downloadQueue = new ArrayList<>();
public static final int MAXIMUM_AVAILABLE_FREE_DOWNLOADS = 10;
@ -217,7 +219,7 @@ public class BaseDownloadActivity extends ActionBarProgressActivity {
@Override
public void onAttachFragment(Fragment fragment) {
fragList.add(new WeakReference<Fragment>(fragment));
fragSet.add(new WeakReference<Fragment>(fragment));
}
public void makeSureUserCancelDownload() {

View file

@ -75,6 +75,7 @@ public class DownloadActivity extends BaseDownloadActivity {
public static final String UPDATES_TAB = "updates";
public static final String SINGLE_TAB = "SINGLE_TAB";
private List<DownloadActivityType> downloadTypes = new ArrayList<DownloadActivityType>();
private List<IndexItemCategoryWithSubcat> cats;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -164,13 +165,13 @@ public class DownloadActivity extends BaseDownloadActivity {
public void onClick(View v) {
getEntriesToDownload().clear();
updateDownloadButton();
for (WeakReference<Fragment> ref : fragList) {
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (f instanceof OsmAndListFragment) {
if (!f.isDetached() && ((OsmAndListFragment) f).getListAdapter() instanceof ArrayAdapter) {
if (f.isAdded() && ((OsmAndListFragment) f).getListAdapter() instanceof ArrayAdapter) {
((ArrayAdapter) ((OsmAndListFragment) f).getListAdapter()).notifyDataSetChanged();
}
} else if (!f.isDetached() && f instanceof OsmandExpandableListFragment &&
} else if (f.isAdded() && f instanceof OsmandExpandableListFragment &&
((OsmandExpandableListFragment) f).getAdapter() instanceof BaseExpandableListAdapter) {
((BaseExpandableListAdapter) ((OsmandExpandableListFragment) f).getAdapter()).notifyDataSetChanged();
}
@ -283,10 +284,10 @@ public class DownloadActivity extends BaseDownloadActivity {
@Override
public void updateDownloadList(List<IndexItem> list) {
for (WeakReference<Fragment> ref : fragList) {
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (f instanceof UpdatesIndexFragment) {
if (!f.isDetached()) {
if (f.isAdded()) {
((UpdatesIndexFragment) f).updateItemsList(list);
}
}
@ -295,10 +296,10 @@ public class DownloadActivity extends BaseDownloadActivity {
@Override
public void categorizationFinished(List<IndexItem> filtered, List<IndexItemCategory> cats) {
for (WeakReference<Fragment> ref : fragList) {
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (f instanceof DownloadIndexFragment) {
if (!f.isDetached()) {
if (f.isAdded()) {
((DownloadIndexFragment) f).categorizationFinished(filtered, cats);
}
}
@ -308,22 +309,28 @@ public class DownloadActivity extends BaseDownloadActivity {
@Override
public void onCategorizationFinished(List<IndexItem> filtered,
List<IndexItemCategoryWithSubcat> cats) {
for (WeakReference<Fragment> ref : fragList) {
boolean isPushed = false;
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (f instanceof NewLocalIndexesFragment) {
if (!f.isDetached()) {
if (f.isAdded()) {
isPushed = true;
((NewLocalIndexesFragment) f).onCategorizationFinished(filtered, cats);
}
}
}
if (!isPushed) {
this.cats = cats;
}
}
public void downloadListUpdated() {
for (WeakReference<Fragment> ref : fragList) {
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (f instanceof DownloadIndexFragment) {
if (!f.isDetached()) {
((DownloadIndexAdapter) ((DownloadIndexFragment) f).getExpandableListAdapter()).notifyDataSetInvalidated();
if (f.isAdded()) {
((DownloadIndexAdapter) ((DownloadIndexFragment) f).getExpandableListAdapter())
.notifyDataSetInvalidated();
}
}
}
@ -331,15 +338,16 @@ public class DownloadActivity extends BaseDownloadActivity {
@Override
public void downloadedIndexes() {
for (WeakReference<Fragment> ref : fragList) {
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (f instanceof LocalIndexesFragment) {
if (!f.isDetached()) {
if (f.isAdded()) {
((LocalIndexesFragment) f).reloadData();
}
} else if (f instanceof DownloadIndexFragment) {
if (!f.isDetached()) {
DownloadIndexAdapter adapter = ((DownloadIndexAdapter) ((DownloadIndexFragment) f).getExpandableListAdapter());
if (f.isAdded()) {
DownloadIndexAdapter adapter = ((DownloadIndexAdapter)
((DownloadIndexFragment) f).getExpandableListAdapter());
if (adapter != null) {
adapter.setLoadedFiles(getIndexActivatedFileNames(), getIndexFileNames());
@ -446,22 +454,23 @@ public class DownloadActivity extends BaseDownloadActivity {
findViewById(R.id.wikiButton).setVisibility(wikipediaItems.size() == 0 ? View.GONE : View.VISIBLE);
}
for (WeakReference<Fragment> ref : fragList) {
for (WeakReference<Fragment> ref : fragSet) {
Fragment f = ref.get();
if (!f.isDetached()) {
if (f instanceof OsmandExpandableListFragment) {
ExpandableListAdapter ad = ((OsmandExpandableListFragment) f).getExpandableListView()
.getExpandableListAdapter();
if (ad instanceof OsmandBaseExpandableListAdapter) {
((OsmandBaseExpandableListAdapter) ad).notifyDataSetChanged();
}
} else if (f instanceof ListFragment) {
ListAdapter la = ((ListFragment) f).getListAdapter();
if (la instanceof BaseAdapter) {
((BaseAdapter) la).notifyDataSetChanged();
if (f != null)
if (f.isAdded()) {
if (f instanceof OsmandExpandableListFragment) {
ExpandableListAdapter ad = ((OsmandExpandableListFragment) f).getExpandableListView()
.getExpandableListAdapter();
if (ad instanceof OsmandBaseExpandableListAdapter) {
((OsmandBaseExpandableListAdapter) ad).notifyDataSetChanged();
}
} else if (f instanceof ListFragment) {
ListAdapter la = ((ListFragment) f).getListAdapter();
if (la instanceof BaseAdapter) {
((BaseAdapter) la).notifyDataSetChanged();
}
}
}
}
}
// if (scroll) {
// getExpandableListView().scrollTo(x, y);
@ -533,6 +542,12 @@ public class DownloadActivity extends BaseDownloadActivity {
return downloadListIndexThread != null ? downloadListIndexThread.getIndexFileNames() : null;
}
public List<IndexItemCategoryWithSubcat> getCats() {
List<IndexItemCategoryWithSubcat> toReturn = cats;
cats = null;
return toReturn;
}
public void showDialogToDownloadMaps(Collection<String> maps) {
int count = 0;
int sz = 0;

View file

@ -1,17 +1,6 @@
package net.osmand.plus.download;
import java.io.File;
import java.io.FilenameFilter;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.R;
import net.osmand.plus.activities.OsmandExpandableListFragment;
import net.osmand.plus.base.BasicProgressAsyncTask;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
@ -31,9 +20,21 @@ import android.widget.ExpandableListAdapter;
import android.widget.ExpandableListView;
import android.widget.Toast;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.R;
import net.osmand.plus.activities.OsmandExpandableListFragment;
import net.osmand.plus.base.BasicProgressAsyncTask;
import java.io.File;
import java.io.FilenameFilter;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class DownloadIndexFragment extends OsmandExpandableListFragment {
/** menus **/
private static boolean SHOW_ONLY_RELOAD = true;
public static final int MORE_ID = 10;

View file

@ -430,7 +430,7 @@ public class DownloadIndexesThread {
AccessibleToast.makeText(uiActivity, R.string.basemap_was_selected_to_download,
Toast.LENGTH_LONG).show();
if (uiActivity instanceof DownloadActivity) {
((DownloadActivity) uiActivity).updateDownloadButton();
uiActivity.updateDownloadButton();
}
}
}

View file

@ -30,12 +30,14 @@ import org.apache.commons.logging.Log;
import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class NewLocalIndexesFragment extends OsmAndListFragment {
private static final Log LOG = PlatformUtil.getLog(NewLocalIndexesFragment.class);
public static final String CATEGORIES = "categories";
private static final MessageFormat formatGb = new MessageFormat("{0, number,<b>#.##</b>} GB", Locale.US);
public static final int RELOAD_ID = 0;
@ -55,6 +57,16 @@ public class NewLocalIndexesFragment extends OsmAndListFragment {
mAdapter = new CategoriesAdapter(getActivity(), getMyApplication());
listView.setAdapter(mAdapter);
List<IndexItemCategoryWithSubcat> cats = ((DownloadActivity) getActivity()).getCats();
if (cats != null) {
onCategorizationFinished(null, cats);
}
if (savedInstanceState != null) {
List<IndexItemCategoryWithSubcat> savedCats =
savedInstanceState.getParcelableArrayList(CATEGORIES);
onCategorizationFinished(null, savedCats);
}
View header = inflater.inflate(R.layout.local_index_fragment_header, listView, false);
initMemoryConsumedCard(header);
DownloadsUiInitHelper.initFreeVersionBanner(header, getMyApplication().getSettings(),
@ -102,11 +114,22 @@ public class NewLocalIndexesFragment extends OsmAndListFragment {
return super.onOptionsItemSelected(item);
}
@Override
public void onSaveInstanceState(Bundle outState) {
LOG.debug("onSaveInstanceState()");
ArrayList<IndexItemCategoryWithSubcat> items = new ArrayList<>(mAdapter.getCount());
for (int i = 0; i < mAdapter.getCount(); i++) {
items.add(mAdapter.getItem(i));
}
outState.putParcelableArrayList(CATEGORIES, items);
super.onSaveInstanceState(outState);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
FragmentTransaction fragmentTransaction = getChildFragmentManager().beginTransaction();
fragmentTransaction.addToBackStack(null);
MapsInCategoryFragment.createInstance(mAdapter.getItem(position-1))
MapsInCategoryFragment.createInstance(mAdapter.getItem(position - 1))
.show(fragmentTransaction, MapsInCategoryFragment.TAG);
}
@ -115,8 +138,10 @@ public class NewLocalIndexesFragment extends OsmAndListFragment {
}
public void onCategorizationFinished(List<IndexItem> filtered, List<IndexItemCategoryWithSubcat> cats) {
mAdapter.clear();
mAdapter.addAll(cats);
if (mAdapter != null) {
mAdapter.clear();
mAdapter.addAll(cats);
}
}
private static class CategoriesAdapter extends ArrayAdapter<IndexItemCategoryWithSubcat> {

View file

@ -15,7 +15,6 @@ import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
@ -24,10 +23,7 @@ import net.osmand.plus.download.DownloadActivityType;
import net.osmand.plus.download.IndexItem;
import net.osmand.plus.helpers.HasName;
import org.apache.commons.logging.Log;
public class SubcategoriesFragment extends Fragment {
private static final Log LOG = PlatformUtil.getLog(SubcategoriesFragment.class);
private static final String CATEGORY = "category";
@Nullable

View file

@ -3,6 +3,7 @@ package net.osmand.plus.mapcontextmenu.details;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.text.TextUtils;
import android.text.util.Linkify;
import android.util.TypedValue;
import android.view.Gravity;
@ -79,9 +80,10 @@ public class AmenityMenuBuilder extends MenuBuilder {
textView.setAutoLinkMask(Linkify.ALL);
textView.setLinksClickable(true);
textView.setEllipsize(TextUtils.TruncateAt.END);
if (isWiki) {
textView.setMinLines(1);
textView.setMaxLines(5);
textView.setMaxLines(15);
}
textView.setText(text);
if (textColor > 0) {

View file

@ -3,7 +3,6 @@ package net.osmand.plus.mapcontextmenu.editors;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@ -11,6 +10,7 @@ import android.os.Bundle;
import net.osmand.data.FavouritePoint;
import net.osmand.data.PointDescription;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.FavouritesDbHelper.FavoriteGroup;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
@ -21,9 +21,11 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
private FavoritePointEditor editor;
private FavouritePoint favorite;
private FavoriteGroup group;
FavouritesDbHelper helper;
private boolean saved;
private int defaultColor;
@Override
public void onAttach(Activity activity) {
@ -35,7 +37,12 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean light = getMyApplication().getSettings().isLightContent();
defaultColor = light ? R.color.icon_color : R.color.icon_color_light;
favorite = editor.getFavorite();
group = helper.getGroup(favorite);
}
@Override
@ -52,6 +59,12 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
}
}
@Override
public void setCategory(String name) {
group = helper.getGroup(name);
super.setCategory(name);
}
public static void showInstance(final MapActivity mapActivity) {
FavoritePointEditor editor = mapActivity.getFavoritePointEditor();
//int slideInAnim = editor.getSlideInAnimation();
@ -71,8 +84,8 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
@Override
protected void save(final boolean needDismiss) {
final FavouritePoint point = new FavouritePoint(favorite.getLatitude(), favorite.getLongitude(), getName(), getCategory());
point.setDescription(getDescription());
final FavouritePoint point = new FavouritePoint(favorite.getLatitude(), favorite.getLongitude(), getNameTextValue(), getCategoryTextValue());
point.setDescription(getDescriptionTextValue());
AlertDialog.Builder builder = FavouritesDbHelper.checkDuplicates(point, helper, getMapActivity());
if (favorite.getName().equals(point.getName()) &&
@ -125,7 +138,6 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
@Override
protected void delete(final boolean needDismiss) {
final Resources resources = this.getResources();
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setMessage(getString(R.string.favourites_remove_dialog_msg, favorite.getName()));
builder.setNegativeButton(R.string.shared_string_no, null);
@ -143,39 +155,41 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
}
@Override
public String getHeaderText() {
public String getHeaderCaption() {
return getMapActivity().getResources().getString(R.string.favourites_edit_dialog_title);
}
@Override
public String getNameValue() {
public String getNameInitValue() {
return favorite.getName();
}
@Override
public String getCategoryValue() {
public String getCategoryInitValue() {
return favorite.getCategory();
}
@Override
public String getDescriptionValue() {
public String getDescriptionInitValue() {
return favorite.getDescription();
}
@Override
public Drawable getNameIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity(), favorite.getColor(), getMapActivity().getMapView().getCurrentRotatedTileBox().getDensity());
int color = defaultColor;
if (group != null) {
color = group.color;
}
return FavoriteImageDrawable.getOrCreate(getMapActivity(), color, getMapActivity().getMapView().getCurrentRotatedTileBox().getDensity());
}
@Override
public Drawable getCategoryIcon() {
FavouritesDbHelper helper = getMyApplication().getFavorites();
FavouritesDbHelper.FavoriteGroup group = helper.getGroup(favorite);
int color = defaultColor;
if (group != null) {
return getIcon(R.drawable.ic_action_folder_stroke, group.color);
} else {
return null;
color = group.color;
}
return getIcon(R.drawable.ic_action_folder_stroke, color);
}
public Drawable getIcon(int resId, int color) {

View file

@ -1,27 +1,25 @@
package net.osmand.plus.mapcontextmenu.editors;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import net.osmand.plus.FavouritesDbHelper;
@ -29,7 +27,7 @@ import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.mapcontextmenu.editors.dialogs.SelectCategoryDialogFragment;
import net.osmand.plus.widgets.AutoCompleteTextViewEx;
import net.osmand.util.Algorithms;
@ -99,16 +97,16 @@ public abstract class PointEditorFragment extends Fragment {
}
TextView headerCaption = (TextView) view.findViewById(R.id.header_caption);
headerCaption.setText(getHeaderText());
headerCaption.setText(getHeaderCaption());
TextView nameCaption = (TextView) view.findViewById(R.id.name_caption);
nameCaption.setText(getNameText());
nameCaption.setText(getNameCaption());
TextView categoryCaption = (TextView) view.findViewById(R.id.category_caption);
categoryCaption.setText(getCategoryText());
categoryCaption.setText(getCategoryCaption());
EditText nameEdit = (EditText) view.findViewById(R.id.name_edit);
nameEdit.setText(getNameValue());
nameEdit.setText(getNameInitValue());
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) view.findViewById(R.id.category_edit);
categoryEdit.setText(getCategoryValue());
categoryEdit.setText(getCategoryInitValue());
categoryEdit.setThreshold(1);
final FavouritesDbHelper helper = getMyApplication().getFavorites();
List<FavouritesDbHelper.FavoriteGroup> gs = helper.getFavoriteGroups();
@ -117,10 +115,29 @@ public abstract class PointEditorFragment extends Fragment {
list[i] =gs.get(i).name;
}
categoryEdit.setAdapter(new ArrayAdapter<>(getMapActivity(), R.layout.list_textview, list));
categoryEdit.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(final View v, MotionEvent event) {
final EditText editText = (EditText) v;
final int DRAWABLE_RIGHT = 2;
if (event.getAction() == MotionEvent.ACTION_UP) {
if (event.getX() >= (editText.getRight()
- editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width()
- editText.getPaddingRight())) {
DialogFragment dialogFragment =
SelectCategoryDialogFragment.createInstance();
dialogFragment.show(getChildFragmentManager(), "SelectCategoryDialogFragment");
return true;
}
}
return false;
}
});
EditText descriptionEdit = (EditText) view.findViewById(R.id.description_edit);
if (getDescriptionValue() != null) {
descriptionEdit.setText(getDescriptionValue());
if (getDescriptionInitValue() != null) {
descriptionEdit.setText(getDescriptionInitValue());
}
ImageView nameImage = (ImageView) view.findViewById(R.id.name_image);
@ -172,9 +189,15 @@ public abstract class PointEditorFragment extends Fragment {
}
public abstract PointEditor getEditor();
public abstract String getToolbarTitle();
public void setCategory(String name) {
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) getView().findViewById(R.id.category_edit);
categoryEdit.setText(name);
ImageView categoryImage = (ImageView) getView().findViewById(R.id.category_image);
categoryImage.setImageDrawable(getCategoryIcon());
}
protected MapActivity getMapActivity() {
return (MapActivity)getActivity();
}
@ -201,33 +224,33 @@ public abstract class PointEditorFragment extends Fragment {
}
}
public abstract String getHeaderText();
public abstract String getHeaderCaption();
public String getNameText() {
public String getNameCaption() {
return getMapActivity().getResources().getString(R.string.favourites_edit_dialog_name);
}
public String getCategoryText() {
public String getCategoryCaption() {
return getMapActivity().getResources().getString(R.string.favourites_edit_dialog_category);
}
public abstract String getNameValue();
public abstract String getCategoryValue();
public abstract String getDescriptionValue();
public abstract String getNameInitValue();
public abstract String getCategoryInitValue();
public abstract String getDescriptionInitValue();
public abstract Drawable getNameIcon();
public abstract Drawable getCategoryIcon();
public String getName() {
public String getNameTextValue() {
EditText nameEdit = (EditText) getView().findViewById(R.id.name_edit);
return nameEdit.getText().toString().trim();
}
public String getCategory() {
public String getCategoryTextValue() {
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) getView().findViewById(R.id.category_edit);
return categoryEdit.getText().toString().trim();
}
public String getDescription() {
public String getDescriptionTextValue() {
EditText descriptionEdit = (EditText) getView().findViewById(R.id.description_edit);
String res = descriptionEdit.getText().toString().trim();
return Algorithms.isEmpty(res) ? null : res;

View file

@ -1,5 +0,0 @@
package net.osmand.plus.mapcontextmenu.editors.dialogs;
public class CategoryDialogs {
}

View file

@ -0,0 +1,95 @@
package net.osmand.plus.mapcontextmenu.editors.dialogs;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.mapcontextmenu.editors.PointEditorFragment;
import java.util.List;
public class SelectCategoryDialogFragment extends DialogFragment {
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(R.string.favorite_category_select);
final View v = getActivity().getLayoutInflater().inflate(R.layout.favorite_categories_dialog, null, false);
LinearLayout ll = (LinearLayout) v.findViewById(R.id.list_container);
final FavouritesDbHelper helper = ((OsmandApplication) getActivity().getApplication()).getFavorites();
List<FavouritesDbHelper.FavoriteGroup> gs = helper.getFavoriteGroups();
for (final FavouritesDbHelper.FavoriteGroup category : gs) {
View itemView = getActivity().getLayoutInflater().inflate(R.layout.favorite_category_dialog_item, null);
ImageView icon = (ImageView)itemView.findViewById(R.id.image_view);
if (category.color != 0) {
icon.setImageDrawable(getIcon(getActivity(), R.drawable.ic_action_folder, category.color));
} else {
icon.setImageDrawable(getIcon(getActivity(), R.drawable.ic_action_folder));
}
Button button = (Button)itemView.findViewById(R.id.button);
button.setText(category.name);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((PointEditorFragment) getParentFragment()).setCategory(category.name);
dismiss();
}
});
ll.addView(itemView);
}
View itemView = getActivity().getLayoutInflater().inflate(R.layout.favorite_category_dialog_item, null);
ImageView icon = (ImageView)itemView.findViewById(R.id.image_view);
icon.setImageDrawable(getIcon(getActivity(), R.drawable.map_zoom_in));
Button button = (Button)itemView.findViewById(R.id.button);
button.setText(getActivity().getResources().getText(R.string.favorite_category_add_new));
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//((PointEditorFragment) getParentFragment()).setCategory(null);
//dismiss();
}
});
ll.addView(itemView);
builder.setView(v);
builder.setNegativeButton(R.string.shared_string_cancel, null);
return builder.create();
}
public static SelectCategoryDialogFragment createInstance() {
return new SelectCategoryDialogFragment();
}
private static Drawable getIcon(final Activity activity, int iconId) {
OsmandApplication app = (OsmandApplication)activity.getApplication();
IconsCache iconsCache = app.getIconsCache();
boolean light = app.getSettings().isLightContent();
return iconsCache.getIcon(iconId,
light ? R.color.icon_color : R.color.icon_color_light);
}
private static Drawable getIcon(final Activity activity, int resId, int color) {
OsmandApplication app = (OsmandApplication)activity.getApplication();
Drawable d = app.getResources().getDrawable(resId).mutate();
d.clearColorFilter();
d.setColorFilter(color, PorterDuff.Mode.SRC_IN);
return d;
}
}

View file

@ -30,12 +30,15 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.PlatformUtil;
@ -76,7 +79,6 @@ public class EditPoiFragment extends DialogFragment {
private ViewPager viewPager;
private boolean isLocalEdit;
private boolean mIsUserInput = true;
private EditText poiNameEditText;
private EditPoiData.TagsChangedListener mTagsChangedListener;
private AutoCompleteTextView poiTypeEditText;
private Node node;
@ -112,6 +114,8 @@ public class EditPoiFragment extends DialogFragment {
.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
setStyle(STYLE_NO_FRAME, themeId);
getActivity().getWindow()
.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@ -214,7 +218,7 @@ public class EditPoiFragment extends DialogFragment {
}
});
poiNameEditText = (EditText) view.findViewById(R.id.poiNameEditText);
EditText poiNameEditText = (EditText) view.findViewById(R.id.poiNameEditText);
poiNameEditText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@ -256,27 +260,8 @@ public class EditPoiFragment extends DialogFragment {
}
}
});
poiTypeEditText.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(final View v, MotionEvent event) {
final EditText editText = (EditText) v;
final int DRAWABLE_RIGHT = 2;
if (event.getAction() == MotionEvent.ACTION_UP) {
if (event.getX() >= (editText.getRight()
- editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width()
- editText.getPaddingRight())) {
if (editPoiData.amenity.getType() != null) {
DialogFragment dialogFragment =
PoiSubTypeDialogFragment.createInstance(editPoiData.amenity);
dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment");
}
return true;
}
}
return false;
}
});
poiNameEditText.setOnEditorActionListener(mOnEditorActionListener);
poiTypeEditText.setOnEditorActionListener(mOnEditorActionListener);
Button saveButton = (Button) view.findViewById(R.id.saveButton);
int saveButtonTextId = isLocalEdit ? R.string.shared_string_save :
@ -285,61 +270,7 @@ public class EditPoiFragment extends DialogFragment {
saveButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(poiTypeEditText.getText())) {
poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type));
return;
}
OsmPoint.Action action = node.getId() == -1 ? OsmPoint.Action.CREATE : OsmPoint.Action.MODIFY;
for (Tag tag : editPoiData.tags) {
if (tag.tag.equals(POI_TYPE_TAG)) {
final PoiType poiType = allTranslatedSubTypes.get(tag.value.trim().toLowerCase());
if (poiType != null) {
node.putTag(poiType.getOsmTag(), poiType.getOsmValue());
if (poiType.getOsmTag2() != null) {
node.putTag(poiType.getOsmTag2(), poiType.getOsmValue2());
}
} else {
node.putTag(editPoiData.amenity.getType().getDefaultTag(), tag.value);
}
// } else if (tag.tag.equals(OSMSettings.OSMTagKey.DESCRIPTION.getValue())) {
// description = tag.value;
} else {
if (tag.value.length() > 0) {
node.putTag(tag.tag, tag.value);
} else {
node.removeTag(tag.tag);
}
}
}
commitNode(action, node, mOpenstreetmapUtil.getEntityInfo(),
"",
false,//closeChange.isSelected(),
new Runnable() {
@Override
public void run() {
if (isLocalEdit) {
AccessibleToast.makeText(
getActivity(),
R.string.osm_changes_added_to_local_edits,
Toast.LENGTH_LONG).show();
} else {
final String message = node.getId() == -1 ?
getResources().getString(R.string.poi_action_add)
: getResources().getString(R.string.poi_action_change);
AccessibleToast.makeText(
getActivity(),
MessageFormat.format(
getResources().getString(
R.string.poi_action_succeded_template), message),
Toast.LENGTH_LONG).show();
}
if (getActivity() instanceof MapActivity) {
((MapActivity) getActivity()).getMapView().refreshMap(true);
}
dismiss();
}
}, getActivity(), mOpenstreetmapUtil);
save();
}
});
@ -352,11 +283,69 @@ public class EditPoiFragment extends DialogFragment {
fragmentManager.popBackStack();
}
});
updateType(editPoiData.amenity);
setAdapterForPoiTypeEditText();
setCancelable(false);
return view;
}
private void save() {
if (TextUtils.isEmpty(poiTypeEditText.getText())) {
poiTypeEditText.setError(getResources().getString(R.string.please_specify_poi_type));
return;
}
OsmPoint.Action action = node.getId() == -1 ? OsmPoint.Action.CREATE : OsmPoint.Action.MODIFY;
for (Tag tag : editPoiData.tags) {
if (tag.tag.equals(POI_TYPE_TAG)) {
final PoiType poiType = allTranslatedSubTypes.get(tag.value.trim().toLowerCase());
if (poiType != null) {
node.putTag(poiType.getOsmTag(), poiType.getOsmValue());
if (poiType.getOsmTag2() != null) {
node.putTag(poiType.getOsmTag2(), poiType.getOsmValue2());
}
} else {
node.putTag(editPoiData.amenity.getType().getDefaultTag(), tag.value);
}
// } else if (tag.tag.equals(OSMSettings.OSMTagKey.DESCRIPTION.getValue())) {
// description = tag.value;
} else {
if (tag.value.length() > 0) {
node.putTag(tag.tag, tag.value);
} else {
node.removeTag(tag.tag);
}
}
}
commitNode(action, node, mOpenstreetmapUtil.getEntityInfo(),
"",
false,//closeChange.isSelected(),
new Runnable() {
@Override
public void run() {
if (isLocalEdit) {
AccessibleToast.makeText(
getActivity(),
R.string.osm_changes_added_to_local_edits,
Toast.LENGTH_LONG).show();
} else {
final String message = node.getId() == -1 ?
getResources().getString(R.string.poi_action_add)
: getResources().getString(R.string.poi_action_change);
AccessibleToast.makeText(
getActivity(),
MessageFormat.format(
getResources().getString(
R.string.poi_action_succeded_template), message),
Toast.LENGTH_LONG).show();
}
if (getActivity() instanceof MapActivity) {
((MapActivity) getActivity()).getMapView().refreshMap(true);
}
dismiss();
}
}, getActivity(), mOpenstreetmapUtil);
}
@Override
public void onResume() {
super.onResume();
@ -462,13 +451,38 @@ public class EditPoiFragment extends DialogFragment {
mIsUserInput = true;
poiTypeTextInputLayout.setHint(amenity.getType().getTranslation());
setAdapterForPoiTypeEditText();
poiTypeEditText.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(final View v, MotionEvent event) {
final EditText editText = (EditText) v;
final int DRAWABLE_RIGHT = 2;
if (event.getAction() == MotionEvent.ACTION_UP) {
if (event.getX() >= (editText.getRight()
- editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width()
- editText.getPaddingRight())) {
if (editPoiData.amenity.getType() != null) {
DialogFragment dialogFragment =
PoiSubTypeDialogFragment.createInstance(editPoiData.amenity);
dialogFragment.show(getChildFragmentManager(), "PoiSubTypeDialogFragment");
}
return true;
}
}
return false;
}
});
}
private void setAdapterForPoiTypeEditText() {
final Map<String, PoiType> subCategories = new LinkedHashMap<>();
for (Map.Entry<String, PoiType> s : allTranslatedSubTypes.entrySet()) {
if (!subCategories.containsKey(s.getKey())) {
subCategories.put(Algorithms.capitalizeFirstLetterAndLowercase(s.getKey()), s.getValue());
}
}
final ArrayAdapter<Object> adapter = new ArrayAdapter<>(getActivity(),
R.layout.list_textview, subCategories.keySet().toArray());
poiTypeEditText.setAdapter(adapter);
@ -477,6 +491,7 @@ public class EditPoiFragment extends DialogFragment {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
Object item = parent.getAdapter().getItem(position);
LOG.debug("item=" + item);
if (subCategories.containsKey(item)) {
String keyName = subCategories.get(item).getKeyName();
poiTypeEditText.setText(keyName);
@ -487,6 +502,7 @@ public class EditPoiFragment extends DialogFragment {
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
private OsmandApplication getMyApplication() {
@ -614,4 +630,17 @@ public class EditPoiFragment extends DialogFragment {
return builder.create();
}
}
private TextView.OnEditorActionListener mOnEditorActionListener =
new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_SEND) {
save();
handled = true;
}
return handled;
}
};
}

View file

@ -27,12 +27,17 @@ public class PoiTypeDialogFragment extends DialogFragment {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final List<PoiCategory> categories = poiTypes.getCategories(false);
ArrayList<String> vals = new ArrayList<>(categories.size());
ArrayList<PoiCategory> toDelete = new ArrayList<>();
// TODO replace with constants
for (PoiCategory category : categories) {
if (category.getKeyName().equals("user_defined_other")
|| category.getKeyName().equals("osmwiki")) continue;
vals.add(category.getTranslation());
|| category.getKeyName().equals("osmwiki")) {
toDelete.add(category);
} else {
vals.add(category.getTranslation());
}
}
categories.removeAll(toDelete);
builder.setItems(vals.toArray(new String[vals.size()]), new Dialog.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {