This commit is contained in:
GaidamakUA 2015-10-09 10:39:43 +03:00
commit 9a4f2788f1
34 changed files with 1263 additions and 574 deletions

View file

@ -146,3 +146,5 @@
- Rotterdam: "RET metro logo" by Sebastiaan1997 - Own work. Licensed under CC BY-SA 3.0 via Commons - https://commons.wikimedia.org/wiki/File:RET_metro_logo.svg#/media/File:RET_metro_logo.svg - Rotterdam: "RET metro logo" by Sebastiaan1997 - Own work. Licensed under CC BY-SA 3.0 via Commons - https://commons.wikimedia.org/wiki/File:RET_metro_logo.svg#/media/File:RET_metro_logo.svg
- Amsterdam: "Amsterdam metro" by Peeperman - Own work. Licensed under Public Domain via Commons - https://commons.wikimedia.org/wiki/File:Amsterdam_metro.svg#/media/File:Amsterdam_metro.svg - Amsterdam: "Amsterdam metro" by Peeperman - Own work. Licensed under Public Domain via Commons - https://commons.wikimedia.org/wiki/File:Amsterdam_metro.svg#/media/File:Amsterdam_metro.svg
- Brussels: "Brussels Metro logo" by Source. Licensed under Fair use via Wikipedia - https://en.wikipedia.org/wiki/File:Brussels_Metro_logo.svg#/media/File:Brussels_Metro_logo.svg - Brussels: "Brussels Metro logo" by Source. Licensed under Fair use via Wikipedia - https://en.wikipedia.org/wiki/File:Brussels_Metro_logo.svg#/media/File:Brussels_Metro_logo.svg
- Lyon: "Métro-M-Lyon" by Otourly - Own work. Licensed under CC BY-SA 3.0 via Wikimedia Commons - https://commons.wikimedia.org/wiki/File:M%C3%A9tro-M-Lyon.svg#/media/File:M%C3%A9tro-M-Lyon.svg
- Washington: "WMATA Metro Logo" by Noclip - Own work. Licensed under Public Domain via Commons - https://commons.wikimedia.org/wiki/File:WMATA_Metro_Logo.svg#/media/File:WMATA_Metro_Logo.svg

View file

@ -177,13 +177,13 @@
android:id="@+id/context_menu_bottom_scroll" android:id="@+id/context_menu_bottom_scroll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/ctx_menu_info_view_bg" android:background="?attr/ctx_menu_info_view_bg">
android:fillViewport="true">
<LinearLayout <LinearLayout
android:id="@+id/context_menu_bottom_view" android:id="@+id/context_menu_bottom_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/ctx_menu_info_view_bg"
android:orientation="vertical"> android:orientation="vertical">
</LinearLayout> </LinearLayout>

View file

@ -169,7 +169,7 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginRight="16dp" android:layout_marginRight="16dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:completionThreshold="1" android:editable="false"
android:drawableRight="@drawable/ic_action_arrow_drop_down"/> android:drawableRight="@drawable/ic_action_arrow_drop_down"/>
</LinearLayout> </LinearLayout>

View file

@ -0,0 +1,53 @@
<?xml version='1.0' encoding='utf-8'?>
<resources><string name="poi_shop">দোকান</string>
<string name="poi_shop_food">খাবার দোকান</string>
<string name="poi_emergency">জরুরী</string>
<string name="poi_transportation">পরিবহন</string>
<string name="poi_road_obstacle">সড়ক প্রতিবন্ধক</string>
<string name="poi_filling_station">তেল স্টেশন</string>
<string name="poi_personal_transport">ব্যক্তিগত পরিবহন</string>
<string name="poi_public_transport">গণপরিবহন</string>
<string name="poi_air_transport">বিমান পরিবহন</string>
<string name="poi_water_transport">নৌ পরিবহন</string>
<string name="poi_bicycle_transport">বাইসাইকেল পরিবহন</string>
<string name="poi_aerialway_transport">আকাশপথ পরিবহন</string>
<string name="poi_traffic_enforcement">ট্রাফিক প্রয়োগ</string>
<string name="poi_man_made">মানব নির্মিত</string>
<string name="poi_transport_construction">পরিবহন নির্মাণ</string>
<string name="poi_water_supply">পানি সরবরাহ</string>
<string name="poi_power">বিদ্যুৎ</string>
<string name="poi_communication">যোগাযোগ</string>
<string name="poi_trash_disposal">আবর্জনাভূমি</string>
<string name="poi_landuse">ভূমি ব্যবহার</string>
<string name="poi_education">শিক্ষা</string>
<string name="poi_administrative">প্রশাসনিক</string>
<string name="poi_healthcare">স্বাস্থ্যকেন্দ্র</string>
<string name="poi_office">কার্যালয়</string>
<string name="poi_sport">ক্রীড়া</string>
<string name="poi_tourism">ভ্রমণ</string>
<string name="poi_internet_access">ইন্টারনেট সুবিধা</string>
<string name="poi_entertainment">অবসর</string>
<string name="poi_club">ক্লাব</string>
<string name="poi_sustenance">খাদ্য</string>
<string name="poi_cafe_and_restaurant">ক্যাফে ও রেস্তোরাঁ</string>
<string name="poi_service">সেবা</string>
<string name="poi_finance">অর্থ</string>
<string name="poi_natural">প্রাকৃতিক</string>
<string name="poi_military">সামরিক</string>
<string name="poi_osmwiki">উইকিপিডিয়া</string>
<string name="poi_user_defined_other">ব্যবহারকারী কর্তৃক নির্ধারিত</string>
<string name="poi_bakery">বেকারি</string>
<string name="poi_alcohol">চায়ের দোকান</string>
<string name="poi_chocolate">চকলেট দোকান</string>
<string name="poi_coffee">কফির দোকান</string>
<string name="poi_mall">মল</string>
<string name="poi_beverages">পানীয় দোকান</string>
<string name="poi_butcher">মাংস বাজার</string>
<string name="poi_farm">ফার্মের দোকান</string>
<string name="poi_confectionery">কনফেকশনারী</string>
<string name="poi_supermarket">সুপার মার্কেট</string>
<string name="poi_tea">চায়ের দোকান</string>
<string name="poi_books">বইয়ের দোকান</string>
<string name="poi_bicycle">বাইসাইকেল দোকান</string>
</resources>

View file

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='utf-8'?>
<resources><string name="regions">অঞ্চল</string>
<string name="additional_maps">অতিরিক্ত ম্যাপ</string>
<string name="region_maps">অঞ্চল ম্যাপ</string>
<string name="world_maps">বিশ্ব মানচিত্র</string>
<string name="world_regions">বিশ্ব অঞ্চল</string>
<string name="hillshade_layer_disabled">পর্বতছায়া স্তর নিষ্ক্রিয়</string>
<string name="favorite_category_add_new">নতুন সংযোজন</string>
</resources>

View file

@ -1313,4 +1313,15 @@
<string name="poi_resource_stone">Pedra</string> <string name="poi_resource_stone">Pedra</string>
<string name="poi_resource_tin">Estany</string> <string name="poi_resource_tin">Estany</string>
<string name="poi_resource_tuff">Tuf</string> <string name="poi_resource_tuff">Tuf</string>
<string name="poi_bridge_movable_retractable">Tipus de pont mòbil: retràctil</string>
<string name="poi_bridge_movable_bascule">Tipus de pont mòbil: basculant</string>
<string name="poi_bridge_movable_swing">Tipus de pont mòbil: giratori</string>
<string name="poi_bridge_movable_lift">Tipus de pont mòbil: ascensional</string>
<string name="poi_bridge_movable_drawbridge">Tipus de pont mòbil: llevadís</string>
<string name="poi_bridge_movable_submersible">Tipus de pont mòbil: sumergible</string>
<string name="poi_bridge_movable_transporter">Tipus de pont mòbil: transbordador</string>
<string name="poi_bridge_pedestrian">Passarel·la de vianants</string>
<string name="poi_bridge_bicycle">Pont per bicicletes</string>
<string name="poi_bridge_railway">Pont ferroviari</string>
</resources> </resources>

View file

@ -2158,4 +2158,12 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
<string name="downloading_number_of_files">Baixada - %1$d fitxer</string> <string name="downloading_number_of_files">Baixada - %1$d fitxer</string>
<string name="hillshade_layer_disabled">Capa d\'ombrejat desactivada</string> <string name="hillshade_layer_disabled">Capa d\'ombrejat desactivada</string>
<string name="buy">Compra</string> <string name="buy">Compra</string>
<string name="regions">Regions</string>
<string name="additional_maps">Mapes addicionals</string>
<string name="region_maps">Mapes de regió</string>
<string name="world_maps">Mapes del món</string>
<string name="world_regions">Regions del món</string>
<string name="later">Mes tard</string>
<string name="get_full_version">Obteniu la versió completa</string>
<string name="downloads">Baixades</string>
</resources> </resources>

View file

@ -1886,4 +1886,62 @@
<string name="poi_architecture_renaissance">Arkitektur: renæssance</string> <string name="poi_architecture_renaissance">Arkitektur: renæssance</string>
<string name="poi_architecture_romanesque">Arkitektur: romansk stil</string> <string name="poi_architecture_romanesque">Arkitektur: romansk stil</string>
<string name="poi_tunnel_waterway">Vand tunnel</string>
<string name="poi_tunnel_car">Vejtunnel</string>
<string name="poi_tunnel_pedestrian">Fodgænger tunnel</string>
<string name="poi_tunnel_railway">Jernbanetunnel</string>
<string name="poi_bridge_car">Vejbro</string>
<string name="poi_bridge_pedestrian">Fodgængerbro</string>
<string name="poi_bridge_bicycle">Cykelbro</string>
<string name="poi_bridge_railway">Jernbanebro</string>
<string name="poi_bridge_waterway">Vandvejsbro</string>
<string name="poi_bridge_structure_beam">Broen struktur: stråle</string>
<string name="poi_bridge_structure_simple_suspension">Broen struktur: simple suspension</string>
<string name="poi_bridge_structure_suspension">Broen struktur: simple suspension</string>
<string name="poi_bridge_structure_arch">Broen struktur: arch</string>
<string name="poi_bridge_structure_truss">Broen struktur: bandagist</string>
<string name="poi_bridge_structure_floating">Broen struktur: flydende</string>
<string name="poi_bridge_structure_humpback">Broen struktur: pukkelhval</string>
<string name="poi_bridge_structure_cable_stayed">Broen struktur: skråstagsbro</string>
<string name="poi_bridge_structure_boardwalk">Broen struktur: boardwalk</string>
<string name="poi_bridge_structure_simple_wooden">Broen struktur: simple træ</string>
<string name="poi_bridge_structure_viaduct">Broen struktur: viadukt</string>
<string name="poi_bridge_structure_aqueduct">Broen struktur: akvædukt</string>
<string name="poi_bridge_structure_log">Broen struktur: bandagist</string>
<string name="poi_bridge_type_movable">Bro type: bevægelige</string>
<string name="poi_bridge_movable_bascule">Flytbar bro type: klapbro</string>
<string name="poi_bridge_movable_swing">Flytbar bro type: swing</string>
<string name="poi_bridge_movable_lift">Flytbar bro type: løft</string>
<string name="poi_bridge_movable_drawbridge">Flytbar bro type: vindebro</string>
<string name="poi_bridge_movable_submersible">Flytbar bro type: dykkede</string>
<string name="poi_bridge_movable_transporter">Flytbar bro type: transporter</string>
<string name="poi_bridge_movable_retractable">Flytbar bro type: Udtrækkelig</string>
<string name="poi_lit_yes">Tændt: ja</string>
<string name="poi_lit_no">Tændt: nej</string>
<string name="poi_surface_unpaved">Overflade: asfalterede</string>
<string name="poi_surface_paved">Overflade: banede</string>
<string name="poi_surface_asphalt">Overflade: asfalt</string>
<string name="poi_surface_concrete">Overflade: beton</string>
<string name="poi_surface_sett">Overflade: Indstil</string>
<string name="poi_surface_cobblestone">Overflade: brosten</string>
<string name="poi_surface_paving_stones">Overflade: brosten</string>
<string name="poi_surface_pebblestone">Overflade: pebblestone</string>
<string name="poi_surface_stone">Overflade: sten</string>
<string name="poi_surface_metal">Overflade: metal</string>
<string name="poi_surface_wood">Overflade: træ</string>
<string name="poi_surface_gravel">Overflade: grus</string>
<string name="poi_surface_fine_gravel">Overflade: fint grus</string>
<string name="poi_surface_compacted">Overflade: komprimeret</string>
<string name="poi_surface_sand">Overflade: sand</string>
<string name="poi_surface_grass">Overflade: græs</string>
<string name="poi_surface_grass_paver">Overflade: græs brolægger</string>
<string name="poi_surface_ground">Overflade: jorden</string>
<string name="poi_surface_dirt">Overflade: snavs</string>
<string name="poi_surface_mud">Overflade: mudder</string>
<string name="poi_surface_ice">Overflade: is</string>
<string name="poi_surface_salt">Overflade: salt</string>
<string name="poi_surface_snow">Overflade: sne</string>
</resources> </resources>

View file

@ -2176,4 +2176,5 @@
<string name="region_maps">Regionskort</string> <string name="region_maps">Regionskort</string>
<string name="world_maps">Verdenskort</string> <string name="world_maps">Verdenskort</string>
<string name="world_regions">Regioner i verden</string> <string name="world_regions">Regioner i verden</string>
<string name="downloads">Filhentninger</string>
</resources> </resources>

View file

@ -1836,4 +1836,60 @@
<string name="poi_artwork_type_stele">Tipo de obra: estela</string> <string name="poi_artwork_type_stele">Tipo de obra: estela</string>
<string name="poi_artwork_type_fountain">Tipo de obra: fuente</string> <string name="poi_artwork_type_fountain">Tipo de obra: fuente</string>
<string name="poi_width">Ancho</string>
<string name="poi_architect_name">Arquitecto</string>
<string name="poi_architecture_modern">Arquitectura moderna</string>
<string name="poi_architecture_stalinist_neoclassicism">Arquitectura neoclasista stalinista</string>
<string name="poi_architecture_eclectic">Arquitectura ecléctica</string>
<string name="poi_architecture_new_objectivity">Arquitectura: nueva objetividad</string>
<string name="poi_architecture_contemporary">Arquitectura contemporánea</string>
<string name="poi_architecture_constructivism">Arquitectura constructivista</string>
<string name="poi_architecture_umgebinde">Arquitectura: umgebinde</string>
<string name="poi_architecture_timber_frame">Arquitectura de madera</string>
<string name="poi_architecture_art_nouveau">Arquitectura: arte nuevo</string>
<string name="poi_architecture_neoclassicism">Arquitectura neoclasista</string>
<string name="poi_architecture_victorian">Arquitectura victoriana</string>
<string name="poi_architecture_brutalism">Arquitectura brutalista</string>
<string name="poi_architecture_classicism">Arquitectura clasicista</string>
<string name="poi_architecture_gothic">Arquitectura gótica</string>
<string name="poi_architecture_oldrussian">Arquitectura rusa antigua</string>
<string name="poi_architecture_baroque">Arquitectura barroca</string>
<string name="poi_architecture_postconstructivism">Arquitectura post-constructivista</string>
<string name="poi_architecture_wilhelminian_style">Arquitectura estilo guillerminista</string>
<string name="poi_architecture_renaissance">Arquitectura renacentista</string>
<string name="poi_architecture_romanesque">Arquitectura románica</string>
<string name="poi_tunnel_waterway">Túnel fluvial</string>
<string name="poi_tunnel_car">Túnel vial</string>
<string name="poi_tunnel_pedestrian">Túnel peatonal</string>
<string name="poi_tunnel_railway">Túnel ferroviario</string>
<string name="poi_bridge_car">Puente vial</string>
<string name="poi_bridge_pedestrian">Puente peatonal</string>
<string name="poi_bridge_bicycle">Puente para bicicletas</string>
<string name="poi_bridge_railway">Puente ferroviario</string>
<string name="poi_bridge_waterway">Puente fluvial</string>
<string name="poi_wetland_saltern">Salina</string>
<string name="poi_bridge_structure_beam">Estructura del puente: viga</string>
<string name="poi_bridge_structure_simple_suspension">Estructura del puente: suspensión simple</string>
<string name="poi_bridge_structure_suspension">Estructura del puente: suspensión</string>
<string name="poi_bridge_structure_arch">Estructura del puente: arco</string>
<string name="poi_bridge_structure_truss">Estructura del puente: reticulada</string>
<string name="poi_bridge_structure_floating">Estructura del puente: flotante</string>
<string name="poi_bridge_structure_cable_stayed">Estructura del puente: atirantado</string>
<string name="poi_bridge_structure_humpback">Estructura del puente: jorobado</string>
<string name="poi_bridge_structure_boardwalk">Estructura del puente: pasarela</string>
<string name="poi_bridge_structure_viaduct">Estructura del puente: viaducto</string>
<string name="poi_bridge_structure_aqueduct">Estructura del puente: acueducto</string>
<string name="poi_bridge_structure_log">Estructura del puente: tronco</string>
<string name="poi_bridge_type_movable">Estructura del puente: móvil</string>
<string name="poi_bridge_movable_bascule">Tipo de puente móvil: báscula</string>
<string name="poi_bridge_movable_swing">Tipo de puente móvil: oscilación</string>
<string name="poi_bridge_movable_lift">Tipo de puente móvil: ascensor</string>
<string name="poi_bridge_movable_drawbridge">Tipo de puente móvil: levadizo</string>
<string name="poi_bridge_movable_submersible">Tipo de puente móvil: sumergible</string>
<string name="poi_bridge_movable_transporter">Tipo de puente móvil: transportador</string>
<string name="poi_bridge_movable_retractable">Tipo de puente móvil: retráctil</string>
</resources> </resources>

View file

@ -2094,4 +2094,10 @@
<string name="activate_srtm_plugin">Active el complemento SRTM</string> <string name="activate_srtm_plugin">Active el complemento SRTM</string>
<string name="later">Luego</string> <string name="later">Luego</string>
<string name="get_full_version">Obtener versión completa</string> <string name="get_full_version">Obtener versión completa</string>
<string name="regions">Regiones</string>
<string name="additional_maps">Mapas adicionales</string>
<string name="region_maps">Mapas regionales</string>
<string name="world_maps">Mapas mundiales</string>
<string name="world_regions">Regiones del mundo</string>
<string name="downloads">Descargas</string>
</resources> </resources>

File diff suppressed because it is too large Load diff

View file

@ -2219,5 +2219,21 @@
<string name="favourites_context_menu_add">Añadir favorito</string> <string name="favourites_context_menu_add">Añadir favorito</string>
<string name="roads">Carreteras</string> <string name="roads">Carreteras</string>
<string name="favorite_category_add_new">Añadir nuevo</string> <string name="favorite_category_add_new">Añadir nuevo</string>
<string name="favorite_category_select">Seleccionar categoría</string> <string name="favorite_category_select">Elegir categoría</string>
<string name="regions">Regiones</string>
<string name="additional_maps">Mapas adicionales</string>
<string name="region_maps">Mapas regionales</string>
<string name="world_maps">Mapas mundiales</string>
<string name="world_regions">Regiones del mundo</string>
<string name="hillshade_layer_disabled">Capa de sombreado desactivada</string>
<string name="srtm_plugin_disabled">Curvas de nivel desactivadas</string>
<string name="downloading_number_of_files">Descargando - %1$d archivo/s</string>
<string name="show_free_version_banner">Mostrar banner de versión gratuita</string>
<string name="show_free_version_banner_description">Aunque tenga la versión paga, podrá ver el banner de la versión gratuita</string>
<string name="buy">COMPRAR</string>
<string name="activate_seamarks_plugin">Active el complemento náutico</string>
<string name="activate_srtm_plugin">Active el complemento SRTM</string>
<string name="later">Luego</string>
<string name="get_full_version">Obtener versión completa</string>
<string name="downloads">Descargas</string>
</resources> </resources>

View file

@ -2194,4 +2194,10 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="activate_srtm_plugin">Merci d\'activer le greffon SRTM</string> <string name="activate_srtm_plugin">Merci d\'activer le greffon SRTM</string>
<string name="later">Plus tard</string> <string name="later">Plus tard</string>
<string name="get_full_version">Obtenir la version complète</string> <string name="get_full_version">Obtenir la version complète</string>
<string name="regions">Régions</string>
<string name="additional_maps">Cartes supplémentaires</string>
<string name="region_maps">Cartes régionales</string>
<string name="world_maps">Cartes mondiales</string>
<string name="world_regions">Régions dans le monde</string>
<string name="downloads">Téléchargements</string>
</resources> </resources>

View file

@ -2220,4 +2220,5 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="region_maps">Mappe regionali</string> <string name="region_maps">Mappe regionali</string>
<string name="world_maps">Mappe mondiali</string> <string name="world_maps">Mappe mondiali</string>
<string name="world_regions">Regioni mondiali</string> <string name="world_regions">Regioni mondiali</string>
<string name="downloads">Download</string>
</resources> </resources>

View file

@ -2267,4 +2267,21 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant
<string name="simulate_your_location_descr">Symuluj za pomocą nagranej trasy GPX lub wyznaczonej trasy</string> <string name="simulate_your_location_descr">Symuluj za pomocą nagranej trasy GPX lub wyznaczonej trasy</string>
<string name="downloads_left_template">%1$s pozostało do pobrania</string> <string name="downloads_left_template">%1$s pozostało do pobrania</string>
<string name="downloading_number_of_fiels">Pobieranie - %1$d pliku</string> <string name="downloading_number_of_fiels">Pobieranie - %1$d pliku</string>
<string name="regions">Regiony</string>
<string name="additional_maps">Dodatkowe mapy</string>
<string name="region_maps">Mapy regionów</string>
<string name="world_maps">Mapy świata</string>
<string name="world_regions">Regiony świata</string>
<string name="hillshade_layer_disabled">Wyłączona warstwa cieniowania wzgórz</string>
<string name="srtm_plugin_disabled">Wyłączone poziomice</string>
<string name="favourites_edit_dialog_title">Informacje ulubione</string>
<string name="downloading_number_of_files">Pobieranie - %1$d plik</string>
<string name="show_free_version_banner">Pokaż baner darmowej wersji</string>
<string name="show_free_version_banner_description">Nawet jeśli posiadasz płatną wersję to nadal nadal możesz zobaczyć baner darmowej wersji</string>
<string name="buy">KUP</string>
<string name="activate_seamarks_plugin">Proszę aktywuj plugin latarni morskich</string>
<string name="activate_srtm_plugin">Proszę aktywuj plugin SRTM</string>
<string name="later">Później</string>
<string name="get_full_version">Pobierz pełną wersję</string>
<string name="downloads">Pobierz</string>
</resources> </resources>

View file

@ -1691,4 +1691,62 @@
<string name="poi_architecture_renaissance">Архитектурный стиль: ренессанс</string> <string name="poi_architecture_renaissance">Архитектурный стиль: ренессанс</string>
<string name="poi_architecture_romanesque">Архитектурный стиль: романский</string> <string name="poi_architecture_romanesque">Архитектурный стиль: романский</string>
<string name="poi_tunnel_waterway">Водный туннель</string>
<string name="poi_tunnel_car">Туннель для автомобилей</string>
<string name="poi_tunnel_pedestrian">Туннель для пешеходов</string>
<string name="poi_tunnel_railway">Железнодорожный тоннель</string>
<string name="poi_bridge_car">Автомобильный туннель</string>
<string name="poi_bridge_pedestrian">Пешеходный мост</string>
<string name="poi_bridge_bicycle">Велосипедный мост</string>
<string name="poi_bridge_railway">Железнодорожный мост</string>
<string name="poi_bridge_waterway">Водный мост</string>
<string name="poi_bridge_structure_beam">Конструкция моста: балочный</string>
<string name="poi_bridge_structure_simple_suspension">Конструкция моста: простой подвесной</string>
<string name="poi_bridge_structure_suspension">Конструкция моста: подвесной</string>
<string name="poi_bridge_structure_arch">Конструкция моста: арочный</string>
<string name="poi_bridge_structure_truss">Конструкция моста: ферма</string>
<string name="poi_bridge_structure_floating">Конструкция моста: понтонный</string>
<string name="poi_bridge_structure_humpback">Конструкция моста: горбатый</string>
<string name="poi_bridge_structure_cable_stayed">Конструкция моста: вантовый</string>
<string name="poi_bridge_structure_boardwalk">Конструкция моста: дощатый настил</string>
<string name="poi_bridge_structure_simple_wooden">Конструкция моста: простой деревянный</string>
<string name="poi_bridge_structure_viaduct">Конструкция моста: виадук</string>
<string name="poi_bridge_structure_aqueduct">Конструкция моста: акведук</string>
<string name="poi_bridge_structure_log">Конструкция моста: бревно</string>
<string name="poi_bridge_type_movable">Тип моста: разводной</string>
<string name="poi_bridge_movable_bascule">Тип разводного моста: раскрывающийся</string>
<string name="poi_bridge_movable_swing">Тип разводного моста: поворотный</string>
<string name="poi_bridge_movable_lift">Тип разводного моста: вертикально-подъёмный</string>
<string name="poi_bridge_movable_drawbridge">Тип разводного моста: подъёмный</string>
<string name="poi_bridge_movable_submersible">Тип разводного моста: затопляемый</string>
<string name="poi_bridge_movable_transporter">Тип разводного моста: летающий паром</string>
<string name="poi_bridge_movable_retractable">Тип разводного моста: выдвигаемый</string>
<string name="poi_lit_yes">Объект освещён: да</string>
<string name="poi_lit_no">Объект освещён: нет</string>
<string name="poi_surface_unpaved">Поверхность: без покрытия</string>
<string name="poi_surface_paved">Поверхность: с покрытием</string>
<string name="poi_surface_asphalt">Поверхность: асфальт</string>
<string name="poi_surface_concrete">Поверхность: бетон</string>
<string name="poi_surface_sett">Поверхность: брусчатка</string>
<string name="poi_surface_cobblestone">Поверхность: уложенный булыжник</string>
<string name="poi_surface_paving_stones">Поверхность: тротуарная плитка</string>
<string name="poi_surface_pebblestone">Поверхность: галька</string>
<string name="poi_surface_stone">Поверхность: каменистая</string>
<string name="poi_surface_metal">Поверхность: металл</string>
<string name="poi_surface_wood">Поверхность: лес</string>
<string name="poi_surface_gravel">Поверхность: гравий</string>
<string name="poi_surface_fine_gravel">Поверхность: многослойный гравий</string>
<string name="poi_surface_compacted">Поверхность: утрамбованная почва и камни</string>
<string name="poi_surface_sand">Поверхность: песок</string>
<string name="poi_surface_grass">Поверхность: трава</string>
<string name="poi_surface_grass_paver">Поверхность: неплотное мощение камнями</string>
<string name="poi_surface_ground">Поверхность: голая почва</string>
<string name="poi_surface_dirt">Поверхность: грязь</string>
<string name="poi_surface_mud">Поверхность: грязь без твёрдого слоя</string>
<string name="poi_surface_ice">Поверхность: лёд</string>
<string name="poi_surface_salt">Поверхность: соль (соляные озёра)</string>
<string name="poi_surface_snow">Поверхность: снег (зимник)</string>
</resources> </resources>

View file

@ -2127,4 +2127,5 @@
<string name="world_maps">Карты мира</string> <string name="world_maps">Карты мира</string>
<string name="world_regions">Регионы мира</string> <string name="world_regions">Регионы мира</string>
<string name="favourites_context_menu_add">Добавить избранное</string> <string name="favourites_context_menu_add">Добавить избранное</string>
<string name="region_maps">Карты региона</string>
</resources> </resources>

View file

@ -1198,4 +1198,56 @@
<string name="poi_memorial_statue">Istàtua</string> <string name="poi_memorial_statue">Istàtua</string>
<string name="poi_vending_bread">Pane</string> <string name="poi_vending_bread">Pane</string>
<string name="poi_architect_name">Architetu</string>
<string name="poi_architecture_modern">Architetura: modernu</string>
<string name="poi_architecture_stalinist_neoclassicism">Architetura: classicismu sotzialista/stalinista</string>
<string name="poi_architecture_eclectic">Architetura: ecletismu</string>
<string name="poi_architecture_new_objectivity">Architetura: ogetividade noa</string>
<string name="poi_architecture_contemporary">Architetura: contemporàneu</string>
<string name="poi_architecture_constructivism">Architetura: constructivismu</string>
<string name="poi_architecture_umgebinde">Architetura: umgebinde</string>
<string name="poi_architecture_art_nouveau">Architetura: art nouveau/liberty</string>
<string name="poi_architecture_neoclassicism">Architetura: neoclassicismu</string>
<string name="poi_architecture_victorian">Architetura: istile vitorianu</string>
<string name="poi_architecture_brutalism">Architetura: brutalismu</string>
<string name="poi_architecture_classicism">Architetura: classicismu</string>
<string name="poi_architecture_gothic">Architetura: istile gòticu</string>
<string name="poi_architecture_baroque">Architetura: barocu</string>
<string name="poi_architecture_postconstructivism">Architetura: postconstructivismu</string>
<string name="poi_architecture_wilhelminian_style">Architetura: istile wilhelminianu</string>
<string name="poi_architecture_renaissance">Architetura: rinascimentu</string>
<string name="poi_architecture_romanesque">Architetura: romànicu</string>
<string name="poi_architecture_timber_frame"/>
<string name="poi_width">Largària</string>
<string name="poi_artwork_type_sculpture">Casta de òpera: iscultura</string>
<string name="poi_artwork_type_statue">Casta de òpera: istàtua</string>
<string name="poi_artwork_type_mural">Casta de òpera: murale</string>
<string name="poi_artwork_type_architecture">Casta de òpera: architetura</string>
<string name="poi_artwork_type_painting">Casta de òpera: pintura</string>
<string name="poi_artwork_type_stone">Casta de òpera: pedra</string>
<string name="poi_artwork_type_bust">Casta de òpera: bustu</string>
<string name="poi_artwork_type_installation">Casta de òpera: installatzione</string>
<string name="poi_artwork_type_mosaic">Casta de òpera: mosàicu</string>
<string name="poi_artwork_type_relief">Casta de òpera: rilievu/bassorilievu</string>
<string name="poi_artwork_type_graffiti">Casta de òpera: grafitos</string>
<string name="poi_artwork_type_stele">Casta de òpera: losa</string>
<string name="poi_artwork_type_fountain">Casta de òpera: funtana</string>
<string name="poi_maxwidth">Largària màssima</string>
<string name="poi_iata">Còdighe IATA</string>
<string name="poi_icao">Còdighe ICAO</string>
<string name="poi_faa">Còdighe FAA</string>
<string name="poi_flagpole">Palu de bandera</string>
<string name="poi_palm">Prama</string>
<string name="poi_cypress">Tzipressu</string>
<string name="poi_chimney">Fumajolu</string>
<string name="poi_beach_sand">Casta de plàia: arena</string>
<string name="poi_beach_shingle">Casta de plàia: giarra/ghiàia</string>
<string name="poi_beach_rocky">Casta de plàia: pedrosa</string>
</resources> </resources>

View file

@ -2131,4 +2131,5 @@
<string name="region_maps">Mapas regionales</string> <string name="region_maps">Mapas regionales</string>
<string name="world_maps">Mapas mundiales</string> <string name="world_maps">Mapas mundiales</string>
<string name="world_regions">Regiones de su mundu</string> <string name="world_regions">Regiones de su mundu</string>
<string name="downloads">Iscarrigamentos</string>
</resources> </resources>

View file

@ -2320,4 +2320,16 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda,
<string name="show_free_version_banner">Zobraziť nápis verzie zdarma</string> <string name="show_free_version_banner">Zobraziť nápis verzie zdarma</string>
<string name="show_free_version_banner_description">Aj keď používate platenú verziu, môžete vidieť nápis z verzie zadarmo</string> <string name="show_free_version_banner_description">Aj keď používate platenú verziu, môžete vidieť nápis z verzie zadarmo</string>
<string name="downloading_number_of_files">Sťahovanie - súbor %1$d</string> <string name="downloading_number_of_files">Sťahovanie - súbor %1$d</string>
<string name="regions">Oblasti</string>
<string name="additional_maps">Doplnkové mapy</string>
<string name="region_maps">Mapy oblastí</string>
<string name="world_maps">Svetové mapy</string>
<string name="world_regions">Oblasti sveta</string>
<string name="hillshade_layer_disabled">Tieňovaný reliéf vypnutý</string>
<string name="buy">KÚPIŤ</string>
<string name="activate_seamarks_plugin">Prosím zapnite modul Námorné značky</string>
<string name="activate_srtm_plugin">Prosím zapnite modul Vrstevnice</string>
<string name="later">Neskôr</string>
<string name="get_full_version">Získať plnú verziu</string>
<string name="downloads">Sťahovania</string>
</resources> </resources>

View file

@ -2022,4 +2022,10 @@
<string name="activate_srtm_plugin">Omogočite vstavek SRTM</string> <string name="activate_srtm_plugin">Omogočite vstavek SRTM</string>
<string name="later">Kasneje</string> <string name="later">Kasneje</string>
<string name="get_full_version">Pridobi polno različico programa</string> <string name="get_full_version">Pridobi polno različico programa</string>
<string name="regions">Območja</string>
<string name="additional_maps">Dodatni zemljevidi</string>
<string name="region_maps">Zemljevidi regij</string>
<string name="world_maps">Svetovni zemljevidi</string>
<string name="world_regions">Svetovna območja</string>
<string name="downloads">Prejemi</string>
</resources> </resources>

View file

@ -2155,4 +2155,5 @@
<string name="region_maps">地區地圖</string> <string name="region_maps">地區地圖</string>
<string name="world_maps">世界地圖</string> <string name="world_maps">世界地圖</string>
<string name="world_regions">全球地區</string> <string name="world_regions">全球地區</string>
<string name="downloads">下載</string>
</resources> </resources>

View file

@ -1842,4 +1842,62 @@
<string name="poi_architecture_renaissance">Architecture: renaissance</string> <string name="poi_architecture_renaissance">Architecture: renaissance</string>
<string name="poi_architecture_romanesque">Architecture: romanesque</string> <string name="poi_architecture_romanesque">Architecture: romanesque</string>
<string name="poi_tunnel_waterway">Water tunnel</string>
<string name="poi_tunnel_car">Road tunnel</string>
<string name="poi_tunnel_pedestrian">Pedestrian tunnel</string>
<string name="poi_tunnel_railway">Railway tunnel</string>
<string name="poi_bridge_car">Road bridge</string>
<string name="poi_bridge_pedestrian">Pedestrian bridge</string>
<string name="poi_bridge_bicycle">Bicycle bridge</string>
<string name="poi_bridge_railway">Railway bridge</string>
<string name="poi_bridge_waterway">Waterway bridge</string>
<string name="poi_bridge_structure_beam">Bridge structure: beam</string>
<string name="poi_bridge_structure_simple_suspension">Bridge structure: simple suspension</string>
<string name="poi_bridge_structure_suspension">Bridge structure: suspension</string>
<string name="poi_bridge_structure_arch">Bridge structure: arch</string>
<string name="poi_bridge_structure_truss">Bridge structure: truss</string>
<string name="poi_bridge_structure_floating">Bridge structure: floating</string>
<string name="poi_bridge_structure_humpback">Bridge structure: humpback</string>
<string name="poi_bridge_structure_cable_stayed">Bridge structure: cable-stayed</string>
<string name="poi_bridge_structure_boardwalk">Bridge structure: boardwalk</string>
<string name="poi_bridge_structure_simple_wooden">Bridge structure: simple wooden</string>
<string name="poi_bridge_structure_viaduct">Bridge structure: viaduct</string>
<string name="poi_bridge_structure_aqueduct">Bridge structure: aqueduct</string>
<string name="poi_bridge_structure_log">Bridge structure: log</string>
<string name="poi_bridge_type_movable">Bridge type: movable</string>
<string name="poi_bridge_movable_bascule">Movable bridge type: bascule</string>
<string name="poi_bridge_movable_swing">Movable bridge type: swing</string>
<string name="poi_bridge_movable_lift">Movable bridge type: lift</string>
<string name="poi_bridge_movable_drawbridge">Movable bridge type: drawbridge</string>
<string name="poi_bridge_movable_submersible">Movable bridge type: submersible</string>
<string name="poi_bridge_movable_transporter">Movable bridge type: transporter</string>
<string name="poi_bridge_movable_retractable">Movable bridge type: retractable</string>
<string name="poi_lit_yes">Lit: yes</string>
<string name="poi_lit_no">Lit: no</string>
<string name="poi_surface_unpaved">Surface: unpaved</string>
<string name="poi_surface_paved">Surface: paved</string>
<string name="poi_surface_asphalt">Surface: asphalt</string>
<string name="poi_surface_concrete">Surface: concrete</string>
<string name="poi_surface_sett">Surface: sett</string>
<string name="poi_surface_cobblestone">Surface: cobblestone</string>
<string name="poi_surface_paving_stones">Surface: paving stones</string>
<string name="poi_surface_pebblestone">Surface: pebblestone</string>
<string name="poi_surface_stone">Surface: stone</string>
<string name="poi_surface_metal">Surface: metal</string>
<string name="poi_surface_wood">Surface: wood</string>
<string name="poi_surface_gravel">Surface: gravel</string>
<string name="poi_surface_fine_gravel">Surface: fine gravel</string>
<string name="poi_surface_compacted">Surface: compacted</string>
<string name="poi_surface_sand">Surface: sand</string>
<string name="poi_surface_grass">Surface: grass</string>
<string name="poi_surface_grass_paver">Surface: grass paver</string>
<string name="poi_surface_ground">Surface: ground</string>
<string name="poi_surface_dirt">Surface: dirt</string>
<string name="poi_surface_mud">Surface: mud</string>
<string name="poi_surface_ice">Surface: ice</string>
<string name="poi_surface_salt">Surface: salt</string>
<string name="poi_surface_snow">Surface: snow</string>
</resources> </resources>

View file

@ -1,6 +1,5 @@
package net.osmand.plus.mapcontextmenu; package net.osmand.plus.mapcontextmenu;
import android.app.Activity;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
@ -13,19 +12,14 @@ import net.osmand.data.Amenity;
import net.osmand.data.FavouritePoint; import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType;
import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.mapcontextmenu.details.AmenityMenuController; import net.osmand.plus.mapcontextmenu.details.AmenityMenuController;
import net.osmand.plus.mapcontextmenu.details.FavouritePointMenuController; import net.osmand.plus.mapcontextmenu.details.FavouritePointMenuController;
import net.osmand.plus.mapcontextmenu.details.MenuController; import net.osmand.plus.mapcontextmenu.details.MenuController;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.views.OsmandMapLayer; import net.osmand.plus.views.OsmandMapLayer;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
@ -38,6 +32,7 @@ public class MapContextMenu {
private PointDescription pointDescription; private PointDescription pointDescription;
private Object object; private Object object;
MenuController menuController;
private int leftIconId; private int leftIconId;
private Drawable leftIcon; private Drawable leftIcon;
@ -64,6 +59,10 @@ public class MapContextMenu {
return object; return object;
} }
public MenuController getMenuController() {
return menuController;
}
public MapContextMenu(OsmandApplication app, MapActivity mapActivity) { public MapContextMenu(OsmandApplication app, MapActivity mapActivity) {
this.app = app; this.app = app;
this.mapActivity = mapActivity; this.mapActivity = mapActivity;
@ -71,7 +70,11 @@ public class MapContextMenu {
} }
public boolean init(PointDescription pointDescription, Object object) { public boolean init(PointDescription pointDescription, Object object) {
if (isMenuVisible()) { return init(pointDescription, object, false);
}
public boolean init(PointDescription pointDescription, Object object, boolean reload) {
if (!reload && isMenuVisible()) {
if (this.object == null || !this.object.equals(object)) { if (this.object == null || !this.object.equals(object)) {
hide(); hide();
} else { } else {
@ -82,10 +85,11 @@ public class MapContextMenu {
this.pointDescription = pointDescription; this.pointDescription = pointDescription;
this.object = object; this.object = object;
leftIconId = 0; leftIconId = 0;
nameStr = null; nameStr = "";
typeStr = null; typeStr = "";
streetStr = null; streetStr = "";
acquireMenuController();
acquireIcons(); acquireIcons();
acquireNameAndType(); acquireNameAndType();
if (needStreetName()) { if (needStreetName()) {
@ -106,6 +110,14 @@ public class MapContextMenu {
} }
} }
public void refreshMenu(PointDescription pointDescription, Object object) {
MapContextMenuFragment fragment = findMenuFragment();
if (fragment != null) {
init(pointDescription, object, true);
fragment.rebuildMenu();
}
}
public void hide() { public void hide() {
MapContextMenuFragment fragment = findMenuFragment(); MapContextMenuFragment fragment = findMenuFragment();
if (fragment != null) { if (fragment != null) {
@ -113,23 +125,37 @@ public class MapContextMenu {
} }
} }
private boolean needStreetName() { private void acquireMenuController() {
boolean res = object != null || Algorithms.isEmpty(pointDescription.getName()); menuController = null;
if (res) {
if (object != null) { if (object != null) {
if (object instanceof Amenity) { if (object instanceof Amenity) {
Amenity a = (Amenity) object; menuController = new AmenityMenuController(app, mapActivity, (Amenity)object);
if (a.getSubType() != null && a.getType() != null) { if (!Algorithms.isEmpty(typeStr)) {
PoiType pt = a.getType().getPoiTypeByKeyName(a.getSubType()); menuController.addPlainMenuItem(R.drawable.ic_action_info_dark, typeStr);
if (pt != null && pt.getOsmTag() != null && pt.getOsmTag().equals("place")) {
res = false;
} }
if (pointDescription != null) {
menuController.addPlainMenuItem(R.drawable.map_my_location, pointDescription.getLocationName(mapActivity, true).replaceAll("\n", ""));
} }
} else if (object instanceof FavouritePoint) { } else if (object instanceof FavouritePoint) {
res = false; menuController = new FavouritePointMenuController(app, mapActivity, (FavouritePoint)object);
if (pointDescription != null) {
menuController.addPlainMenuItem(R.drawable.map_my_location, pointDescription.getLocationName(mapActivity, true).replaceAll("\n", ""));
} }
} }
} }
}
public void onSingleTapOnMap() {
if (menuController == null || !menuController.handleSingleTapOnMap()) {
hide();
}
}
private boolean needStreetName() {
boolean res = object != null || Algorithms.isEmpty(pointDescription.getName());
if (res && menuController != null) {
res = menuController.needStreetName();
}
return res; return res;
} }
@ -165,7 +191,7 @@ public class MapContextMenu {
} }
public String getLocationStr() { public String getLocationStr() {
if (object != null && object instanceof FavouritePoint) { if (menuController != null && menuController.needTypeStr()) {
return typeStr; return typeStr;
} else { } else {
if (Algorithms.isEmpty(streetStr)) { if (Algorithms.isEmpty(streetStr)) {
@ -181,55 +207,17 @@ public class MapContextMenu {
leftIcon = null; leftIcon = null;
secondLineIcon = null; secondLineIcon = null;
if (object != null) { if (menuController != null) {
if (object instanceof Amenity) { leftIconId = menuController.getLeftIconId();
String id = null; leftIcon = menuController.getLeftIcon();
Amenity o = (Amenity) object; secondLineIcon = menuController.getSecondLineIcon();
PoiType st = o.getType().getPoiTypeByKeyName(o.getSubType());
if (st != null) {
if (RenderingIcons.containsBigIcon(st.getIconKeyName())) {
id = st.getIconKeyName();
} else if (RenderingIcons.containsBigIcon(st.getOsmTag() + "_" + st.getOsmValue())) {
id = st.getOsmTag() + "_" + st.getOsmValue();
} }
} }
if (id != null) {
leftIconId = RenderingIcons.getBigIconResourceId(id);
}
} else if (object instanceof FavouritePoint) {
FavouritePoint fav = (FavouritePoint)object;
leftIcon = FavoriteImageDrawable.getOrCreate(mapActivity, fav.getColor(), mapActivity.getMapView().getCurrentRotatedTileBox().getDensity());
secondLineIcon = getIcon(R.drawable.ic_small_group);
}
}
}
private Drawable getIcon(int iconId) {
IconsCache iconsCache = app.getIconsCache();
boolean light = app.getSettings().isLightContent();
return iconsCache.getIcon(iconId,
light ? R.color.icon_color : R.color.icon_color_light);
}
private void acquireNameAndType() { private void acquireNameAndType() {
if (object != null) { if (menuController != null) {
if (object instanceof Amenity) { nameStr = menuController.getNameStr();
Amenity amenity = (Amenity) object; typeStr = menuController.getTypeStr();
PoiCategory pc = amenity.getType();
PoiType pt = pc.getPoiTypeByKeyName(amenity.getSubType());
typeStr = amenity.getSubType();
if (pt != null) {
typeStr = pt.getTranslation();
} else if(typeStr != null){
typeStr = Algorithms.capitalizeFirstLetterAndLowercase(typeStr.replace('_', ' '));
}
nameStr = amenity.getName(settings.MAP_PREFERRED_LOCALE.get());
} else if (object instanceof FavouritePoint) {
FavouritePoint fav = (FavouritePoint)object;
nameStr = fav.getName();
typeStr = fav.getCategory();
}
} }
if (Algorithms.isEmpty(nameStr)) { if (Algorithms.isEmpty(nameStr)) {
@ -242,7 +230,7 @@ public class MapContextMenu {
if (Algorithms.isEmpty(nameStr)) { if (Algorithms.isEmpty(nameStr)) {
if (!Algorithms.isEmpty(typeStr)) { if (!Algorithms.isEmpty(typeStr)) {
nameStr = typeStr; nameStr = typeStr;
typeStr = null; typeStr = "";
} else { } else {
nameStr = app.getResources().getString(R.string.address_unknown); nameStr = app.getResources().getString(R.string.address_unknown);
} }
@ -260,14 +248,11 @@ public class MapContextMenu {
if (object != null) { if (object != null) {
streetStr = RoutingHelper.formatStreetName(object.getName(settings.MAP_PREFERRED_LOCALE.get()), streetStr = RoutingHelper.formatStreetName(object.getName(settings.MAP_PREFERRED_LOCALE.get()),
object.getRef(), object.getDestinationName(settings.MAP_PREFERRED_LOCALE.get())); object.getRef(), object.getDestinationName(settings.MAP_PREFERRED_LOCALE.get()));
if (streetStr != null && streetStr.trim().length() == 0) {
streetStr = null;
}
if (streetStr != null) { if (!Algorithms.isEmpty(streetStr)) {
if (getObject() == null) { if (getObject() == null) {
nameStr = streetStr; nameStr = streetStr;
streetStr = null; streetStr = "";
} }
mapActivity.runOnUiThread(new Runnable() { mapActivity.runOnUiThread(new Runnable() {
public void run() { public void run() {
@ -276,7 +261,7 @@ public class MapContextMenu {
}); });
} }
} else { } else {
streetStr = null; streetStr = "";
} }
return true; return true;
} }
@ -289,24 +274,6 @@ public class MapContextMenu {
}); });
} }
public MenuController getMenuController(Activity activity) {
MenuController menuController = null;
if (object != null) {
if (object instanceof Amenity) {
menuController = new AmenityMenuController(app, activity, (Amenity)object);
if (!Algorithms.isEmpty(typeStr)) {
menuController.addPlainMenuItem(R.drawable.ic_action_info_dark, typeStr);
}
menuController.addPlainMenuItem(R.drawable.map_my_location, pointDescription.getLocationName(activity, true).replaceAll("\n", ""));
} else if (object instanceof FavouritePoint) {
menuController = new FavouritePointMenuController(app, activity, (FavouritePoint)object);
menuController.addPlainMenuItem(R.drawable.map_my_location, pointDescription.getLocationName(activity, true).replaceAll("\n", ""));
}
}
return menuController;
}
public void buttonNavigatePressed() { public void buttonNavigatePressed() {
mapActivity.getMapActions().showNavigationContextMenuPoint(pointDescription.getLat(), pointDescription.getLon()); mapActivity.getMapActions().showNavigationContextMenuPoint(pointDescription.getLat(), pointDescription.getLon());
} }
@ -314,10 +281,8 @@ public class MapContextMenu {
public void buttonFavoritePressed() { public void buttonFavoritePressed() {
if (object != null && object instanceof FavouritePoint) { if (object != null && object instanceof FavouritePoint) {
mapActivity.getFavoritePointEditor().edit((FavouritePoint)object); mapActivity.getFavoritePointEditor().edit((FavouritePoint)object);
//mapActivity.getMapActions().editFavoritePoint((FavouritePoint) object);
} else { } else {
mapActivity.getFavoritePointEditor().add(pointDescription); mapActivity.getFavoritePointEditor().add(pointDescription);
//mapActivity.getMapActions().addFavouritePoint(pointDescription.getLat(), pointDescription.getLon());
} }
} }
@ -337,36 +302,27 @@ public class MapContextMenu {
} }
public void saveMenuState(Bundle bundle) { public void saveMenuState(Bundle bundle) {
if (object != null) { if (menuController != null) {
if (object instanceof Amenity) { menuController.saveEntityState(bundle, KEY_CTX_MENU_OBJECT);
bundle.putSerializable(KEY_CTX_MENU_OBJECT, (Amenity) object);
} else if (object instanceof FavouritePoint) {
bundle.putSerializable(KEY_CTX_MENU_OBJECT, (FavouritePoint) object);
}
} }
bundle.putSerializable(KEY_CTX_MENU_POINT_DESC, pointDescription); bundle.putSerializable(KEY_CTX_MENU_POINT_DESC, pointDescription);
bundle.putSerializable(KEY_CTX_MENU_NAME_STR, nameStr); bundle.putString(KEY_CTX_MENU_NAME_STR, nameStr);
bundle.putSerializable(KEY_CTX_MENU_TYPE_STR, typeStr); bundle.putString(KEY_CTX_MENU_TYPE_STR, typeStr);
bundle.putSerializable(KEY_CTX_MENU_STREET_STR, streetStr); bundle.putString(KEY_CTX_MENU_STREET_STR, streetStr);
} }
public void restoreMenuState(Bundle bundle) { public void restoreMenuState(Bundle bundle) {
object = bundle.getSerializable(KEY_CTX_MENU_OBJECT); object = bundle.getSerializable(KEY_CTX_MENU_OBJECT);
Object pDescObj = bundle.getSerializable(KEY_CTX_MENU_POINT_DESC); Object pDescObj = bundle.getSerializable(KEY_CTX_MENU_POINT_DESC);
if (pDescObj != null) if (pDescObj != null) {
pointDescription = (PointDescription) pDescObj; pointDescription = (PointDescription) pDescObj;
Object nameStrObj = bundle.getSerializable(KEY_CTX_MENU_NAME_STR);
if (nameStrObj != null) {
nameStr = nameStrObj.toString();
}
Object typeStrObj = bundle.getSerializable(KEY_CTX_MENU_TYPE_STR);
if (typeStrObj != null) {
typeStr = typeStrObj.toString();
}
Object streetStrObj = bundle.getSerializable(KEY_CTX_MENU_STREET_STR);
if (streetStrObj != null) {
streetStr = streetStrObj.toString();
} }
acquireMenuController();
nameStr = bundle.getString(KEY_CTX_MENU_NAME_STR);
typeStr = bundle.getString(KEY_CTX_MENU_TYPE_STR);
streetStr = bundle.getString(KEY_CTX_MENU_STREET_STR);
acquireIcons(); acquireIcons();
} }
} }

View file

@ -3,7 +3,6 @@ package net.osmand.plus.mapcontextmenu;
import android.animation.Animator; import android.animation.Animator;
import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi; import android.annotation.TargetApi;
import android.app.Activity;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
@ -25,6 +24,7 @@ import android.view.animation.DecelerateInterpolator;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
@ -98,40 +98,6 @@ public class MapContextMenuFragment extends Fragment {
} }
@Override
public void onAttach(Activity activity) {
super.onAttach(activity);
/*
if(!portrait) {
mapActivity.getMapView().setMapPositionX(1);
mapActivity.getMapView().refreshMap();
}
if(!AndroidUiHelper.isXLargeDevice(mapActivity)) {
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_right_widgets_panel), false);
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_left_widgets_panel), false);
}
if(!portrait) {
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_route_land_left_margin), true);
}
*/
}
@Override
public void onDetach() {
super.onDetach();
/*
mapActivity.getMapView().setMapPositionX(0);
mapActivity.getMapView().refreshMap();
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_route_land_left_margin), false);
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_right_widgets_panel), true);
AndroidUiHelper.updateVisibility(mapActivity.findViewById(R.id.map_left_widgets_panel), true);
*/
}
@Override @Override
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
@ -149,7 +115,7 @@ public class MapContextMenuFragment extends Fragment {
view = inflater.inflate(R.layout.map_context_menu_fragment, container, false); view = inflater.inflate(R.layout.map_context_menu_fragment, container, false);
mainView = view.findViewById(R.id.context_menu_main); mainView = view.findViewById(R.id.context_menu_main);
menuController = getCtxMenu().getMenuController(getActivity()); menuController = getCtxMenu().getMenuController();
if (menuController != null && menuController.isLandscapeLayout()) { if (menuController != null && menuController.isLandscapeLayout()) {
mainView.setLayoutParams(new FrameLayout.LayoutParams(dpToPx(menuController.getLandscapeWidthDp()), ViewGroup.LayoutParams.MATCH_PARENT)); mainView.setLayoutParams(new FrameLayout.LayoutParams(dpToPx(menuController.getLandscapeWidthDp()), ViewGroup.LayoutParams.MATCH_PARENT));
} }
@ -167,7 +133,9 @@ public class MapContextMenuFragment extends Fragment {
menuFullHeight = view.findViewById(R.id.context_menu_main).getHeight(); menuFullHeight = view.findViewById(R.id.context_menu_main).getHeight();
menuTitleHeight = menuTopShadowHeight + menuTopShadowAllHeight; menuTitleHeight = menuTopShadowHeight + menuTopShadowAllHeight;
menuFullHeightMax = menuTitleHeight + (menuBottomViewHeight > 0 ? menuBottomViewHeight + dpToPx(2f) : -dpToPx(SHADOW_HEIGHT_BOTTOM_DP)); menuBottomViewHeight = view.findViewById(R.id.context_menu_bottom_view).getHeight();
recalculateFullHeightMax();
ViewTreeObserver obs = view.getViewTreeObserver(); ViewTreeObserver obs = view.getViewTreeObserver();
@ -316,24 +284,11 @@ public class MapContextMenuFragment extends Fragment {
} }
}); });
// Left icon buildHeader();
IconsCache iconsCache = getMyApplication().getIconsCache(); IconsCache iconsCache = getMyApplication().getIconsCache();
boolean light = getMyApplication().getSettings().isLightContent(); boolean light = getMyApplication().getSettings().isLightContent();
final View iconLayout = view.findViewById(R.id.context_menu_icon_layout);
final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);
Drawable icon = getCtxMenu().getLeftIcon();
int iconId = getCtxMenu().getLeftIconId();
if (icon != null) {
iconView.setImageDrawable(icon);
} else if (iconId != 0) {
iconView.setImageDrawable(iconsCache.getIcon(iconId,
light ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f));
} else {
iconLayout.setVisibility(View.GONE);
}
setAddressLocation();
// Close button // Close button
final ImageView closeButtonView = (ImageView)view.findViewById(R.id.context_menu_close_btn_view); final ImageView closeButtonView = (ImageView)view.findViewById(R.id.context_menu_close_btn_view);
closeButtonView.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark, closeButtonView.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark,
@ -387,7 +342,37 @@ public class MapContextMenuFragment extends Fragment {
} }
}); });
// Menu controller buildBottomView();
getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false);
return view;
}
private void recalculateFullHeightMax() {
menuFullHeightMax = menuTitleHeight + (menuBottomViewHeight > 0 ? menuBottomViewHeight : -dpToPx(SHADOW_HEIGHT_BOTTOM_DP));
}
private void buildHeader() {
IconsCache iconsCache = getMyApplication().getIconsCache();
boolean light = getMyApplication().getSettings().isLightContent();
final View iconLayout = view.findViewById(R.id.context_menu_icon_layout);
final ImageView iconView = (ImageView) view.findViewById(R.id.context_menu_icon_view);
Drawable icon = getCtxMenu().getLeftIcon();
int iconId = getCtxMenu().getLeftIconId();
if (icon != null) {
iconView.setImageDrawable(icon);
} else if (iconId != 0) {
iconView.setImageDrawable(iconsCache.getIcon(iconId,
light ? R.color.osmand_orange : R.color.osmand_orange_dark, 0.75f));
} else {
iconLayout.setVisibility(View.GONE);
}
setAddressLocation();
}
private void buildBottomView() {
View bottomView = view.findViewById(R.id.context_menu_bottom_view); View bottomView = view.findViewById(R.id.context_menu_bottom_view);
if (menuController != null) { if (menuController != null) {
bottomView.setOnTouchListener(new View.OnTouchListener() { bottomView.setOnTouchListener(new View.OnTouchListener() {
@ -398,13 +383,6 @@ public class MapContextMenuFragment extends Fragment {
}); });
menuController.build(bottomView); menuController.build(bottomView);
} }
bottomView.measure(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
menuBottomViewHeight = bottomView.getMeasuredHeight();
getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false);
return view;
} }
@Override @Override
@ -413,6 +391,16 @@ public class MapContextMenuFragment extends Fragment {
getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(true); getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(true);
} }
public void rebuildMenu() {
buildHeader();
LinearLayout bottomLayout = (LinearLayout)view.findViewById(R.id.context_menu_bottom_view);
bottomLayout.removeAllViews();
buildBottomView();
recalculateFullHeightMax();
}
private void showOnMap(double latitude, double longitude) { private void showOnMap(double latitude, double longitude) {
MapActivity ctx = getMapActivity(); MapActivity ctx = getMapActivity();
AnimateDraggingMapThread thread = ctx.getMapView().getAnimatedDraggingThread(); AnimateDraggingMapThread thread = ctx.getMapView().getAnimatedDraggingThread();
@ -532,7 +520,7 @@ public class MapContextMenuFragment extends Fragment {
int slideInAnim = R.anim.slide_in_bottom; int slideInAnim = R.anim.slide_in_bottom;
int slideOutAnim = R.anim.slide_out_bottom; int slideOutAnim = R.anim.slide_out_bottom;
MenuController menuController = mapActivity.getContextMenu().getMenuController(mapActivity); MenuController menuController = mapActivity.getContextMenu().getMenuController();
if (menuController != null) { if (menuController != null) {
slideInAnim = menuController.getSlideInAnimation(); slideInAnim = menuController.getSlideInAnimation();
slideOutAnim = menuController.getSlideOutAnimation(); slideOutAnim = menuController.getSlideOutAnimation();

View file

@ -1,14 +1,22 @@
package net.osmand.plus.mapcontextmenu.details; package net.osmand.plus.mapcontextmenu.details;
import android.app.Activity; import android.os.Bundle;
import net.osmand.data.Amenity; import net.osmand.data.Amenity;
import net.osmand.osm.PoiCategory;
import net.osmand.osm.PoiType;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.render.RenderingIcons;
import net.osmand.util.Algorithms;
public class AmenityMenuController extends MenuController { public class AmenityMenuController extends MenuController {
public AmenityMenuController(OsmandApplication app, Activity activity, final Amenity amenity) { private final Amenity amenity;
super(new AmenityMenuBuilder(app, amenity), activity);
public AmenityMenuController(OsmandApplication app, MapActivity mapActivity, final Amenity amenity) {
super(new AmenityMenuBuilder(app, amenity), mapActivity);
this.amenity = amenity;
} }
@Override @Override
@ -21,4 +29,54 @@ public class AmenityMenuController extends MenuController {
return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN | MenuState.FULL_SCREEN; return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN | MenuState.FULL_SCREEN;
} }
@Override
public boolean needStreetName() {
if (amenity.getSubType() != null && amenity.getType() != null) {
PoiType pt = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
if (pt != null && pt.getOsmTag() != null && pt.getOsmTag().equals("place")) {
return false;
}
}
return true;
}
@Override
public int getLeftIconId() {
String id = null;
PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
if (st != null) {
if (RenderingIcons.containsBigIcon(st.getIconKeyName())) {
id = st.getIconKeyName();
} else if (RenderingIcons.containsBigIcon(st.getOsmTag() + "_" + st.getOsmValue())) {
id = st.getOsmTag() + "_" + st.getOsmValue();
}
}
if (id != null) {
return RenderingIcons.getBigIconResourceId(id);
}
return 0;
}
@Override
public String getTypeStr() {
PoiCategory pc = amenity.getType();
PoiType pt = pc.getPoiTypeByKeyName(amenity.getSubType());
String typeStr = amenity.getSubType();
if (pt != null) {
typeStr = pt.getTranslation();
} else if (typeStr != null) {
typeStr = Algorithms.capitalizeFirstLetterAndLowercase(typeStr.replace('_', ' '));
}
return typeStr;
}
@Override
public String getNameStr() {
return amenity.getName(getMapActivity().getMyApplication().getSettings().MAP_PREFERRED_LOCALE.get());
}
@Override
public void saveEntityState(Bundle bundle, String key) {
bundle.putSerializable(key, amenity);
}
} }

View file

@ -27,11 +27,11 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
this.fav = fav; this.fav = fav;
} }
private void buildRow(View view, int iconId, String text, int textColor, boolean isDescription) { private void buildRow(View view, int iconId, String text, int textColor) {
buildRow(view, getRowIcon(iconId), text, textColor, isDescription); buildRow(view, getRowIcon(iconId), text, textColor);
} }
private void buildRow(final View view, Drawable icon, String text, int textColor, final boolean isDescription) { private void buildRow(final View view, Drawable icon, String text, int textColor) {
boolean light = app.getSettings().isLightContent(); boolean light = app.getSettings().isLightContent();
LinearLayout ll = new LinearLayout(view.getContext()); LinearLayout ll = new LinearLayout(view.getContext());
@ -65,28 +65,15 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
LinearLayout.LayoutParams llTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
llTextParams.setMargins(0, isFirstRow() ? dpToPx(8f) - dpToPx(SHADOW_HEIGHT_BOTTOM_DP) : dpToPx(8f), 0, dpToPx(8f)); llTextParams.setMargins(0, isFirstRow() ? dpToPx(8f) - dpToPx(SHADOW_HEIGHT_BOTTOM_DP) : dpToPx(8f), 0, dpToPx(8f));
textView.setLayoutParams(llTextParams); textView.setLayoutParams(llTextParams);
textView.setTextSize(16); // todo: create constant textView.setTextSize(16);
textView.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_info_text_light : R.color.ctx_menu_info_text_dark)); textView.setTextColor(app.getResources().getColor(light ? R.color.ctx_menu_info_text_light : R.color.ctx_menu_info_text_dark));
textView.setAutoLinkMask(Linkify.ALL); textView.setAutoLinkMask(Linkify.ALL);
textView.setLinksClickable(true); textView.setLinksClickable(true);
// if (isDescription) {
// textView.setMinLines(1);
// textView.setMaxLines(5);
// }
textView.setText(text); textView.setText(text);
if (textColor > 0) { if (textColor > 0) {
textView.setTextColor(view.getResources().getColor(textColor)); textView.setTextColor(view.getResources().getColor(textColor));
} }
// if (isDescription) {
// textView.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// //todo: implement edit fav description dialog
// //POIMapLayer.showDescriptionDialog(view.getContext(), app, fav);
// }
// });
// }
LinearLayout.LayoutParams llTextViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams llTextViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
llTextViewParams.setMargins(0, 0, dpToPx(10f), 0); llTextViewParams.setMargins(0, 0, dpToPx(10f), 0);
@ -122,11 +109,11 @@ public class FavouritePointMenuBuilder extends MenuBuilder {
super.build(view); super.build(view);
if (!Algorithms.isEmpty(fav.getDescription())) { if (!Algorithms.isEmpty(fav.getDescription())) {
buildRow(view, R.drawable.ic_action_note_dark, fav.getDescription(), 0, true); buildRow(view, R.drawable.ic_action_note_dark, fav.getDescription(), 0);
} }
for (PlainMenuItem item : plainMenuItems) { for (PlainMenuItem item : plainMenuItems) {
buildRow(view, item.getIconId(), item.getText(), 0, false); buildRow(view, item.getIconId(), item.getText(), 0);
} }
} }
} }

View file

@ -1,14 +1,24 @@
package net.osmand.plus.mapcontextmenu.details; package net.osmand.plus.mapcontextmenu.details;
import android.app.Activity; import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import net.osmand.data.FavouritePoint; import net.osmand.data.FavouritePoint;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditor;
import net.osmand.plus.mapcontextmenu.editors.FavoritePointEditorFragment;
public class FavouritePointMenuController extends MenuController { public class FavouritePointMenuController extends MenuController {
public FavouritePointMenuController(OsmandApplication app, Activity activity, final FavouritePoint fav) { private FavouritePoint fav;
super(new FavouritePointMenuBuilder(app, fav), activity);
public FavouritePointMenuController(OsmandApplication app, MapActivity mapActivity, final FavouritePoint fav) {
super(new FavouritePointMenuBuilder(app, fav), mapActivity);
this.fav = fav;
} }
@Override @Override
@ -20,4 +30,52 @@ public class FavouritePointMenuController extends MenuController {
protected int getSupportedMenuStatesPortrait() { protected int getSupportedMenuStatesPortrait() {
return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN | MenuState.FULL_SCREEN; return MenuState.HEADER_ONLY | MenuState.HALF_SCREEN | MenuState.FULL_SCREEN;
} }
@Override
public boolean handleSingleTapOnMap() {
Fragment fragment = getMapActivity().getSupportFragmentManager().findFragmentByTag(FavoritePointEditor.TAG);
if (fragment != null) {
((FavoritePointEditorFragment)fragment).dismiss();
return true;
}
return false;
}
@Override
public boolean needStreetName() {
return false;
}
@Override
public boolean needTypeStr() {
return true;
}
@Override
public Drawable getLeftIcon() {
return FavoriteImageDrawable.getOrCreate(getMapActivity().getMyApplication(),
fav.getColor(), getMapActivity().getMapView().getCurrentRotatedTileBox().getDensity());
}
@Override
public Drawable getSecondLineIcon() {
return getIcon(R.drawable.ic_small_group);
}
@Override
public String getTypeStr() {
return fav.getCategory().length() == 0 ?
getMapActivity().getString(R.string.shared_string_favorites) : fav.getCategory();
}
@Override
public String getNameStr() {
return fav.getName();
}
@Override
public void saveEntityState(Bundle bundle, String key) {
bundle.putSerializable(key, fav);
}
} }

View file

@ -1,9 +1,12 @@
package net.osmand.plus.mapcontextmenu.details; package net.osmand.plus.mapcontextmenu.details;
import android.app.Activity; import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View; import android.view.View;
import net.osmand.plus.IconsCache;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.AndroidUiHelper;
public abstract class MenuController { public abstract class MenuController {
@ -14,18 +17,24 @@ public abstract class MenuController {
public static final int FULL_SCREEN = 4; public static final int FULL_SCREEN = 4;
} }
private MapActivity mapActivity;
private MenuBuilder builder; private MenuBuilder builder;
private int currentMenuState; private int currentMenuState;
private boolean portraitMode; private boolean portraitMode;
private boolean largeDevice; private boolean largeDevice;
public MenuController(MenuBuilder builder, Activity activity) { public MenuController(MenuBuilder builder, MapActivity mapActivity) {
this.builder = builder; this.builder = builder;
portraitMode = AndroidUiHelper.isOrientationPortrait(activity); this.mapActivity = mapActivity;
largeDevice = AndroidUiHelper.isXLargeDevice(activity); portraitMode = AndroidUiHelper.isOrientationPortrait(mapActivity);
largeDevice = AndroidUiHelper.isXLargeDevice(mapActivity);
this.currentMenuState = getInitialMenuState(); this.currentMenuState = getInitialMenuState();
} }
public MapActivity getMapActivity() {
return mapActivity;
}
public void build(View rootView) { public void build(View rootView) {
builder.build(rootView); builder.build(rootView);
} }
@ -118,7 +127,38 @@ public abstract class MenuController {
return .7f; return .7f;
} }
protected Drawable getIcon(int iconId) {
IconsCache iconsCache = mapActivity.getMyApplication().getIconsCache();
boolean light = mapActivity.getMyApplication().getSettings().isLightContent();
return iconsCache.getIcon(iconId,
light ? R.color.icon_color : R.color.icon_color_light);
}
public boolean shouldShowButtons() { public boolean shouldShowButtons() {
return true; return true;
} }
public boolean handleSingleTapOnMap() {
return false;
}
public boolean needStreetName() {
return true;
}
public boolean needTypeStr() {
return false;
}
public int getLeftIconId() { return 0; }
public Drawable getLeftIcon() { return null; }
public Drawable getSecondLineIcon() { return null; }
public String getTypeStr() { return ""; }
public String getNameStr() { return ""; }
public abstract void saveEntityState(Bundle bundle, String key);
} }

View file

@ -6,6 +6,7 @@ import android.content.DialogInterface;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import net.osmand.data.FavouritePoint; import net.osmand.data.FavouritePoint;
import net.osmand.data.PointDescription; import net.osmand.data.PointDescription;
@ -15,6 +16,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.FavoriteImageDrawable; import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
public class FavoritePointEditorFragment extends PointEditorFragment { public class FavoritePointEditorFragment extends PointEditorFragment {
@ -84,7 +86,8 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
@Override @Override
protected void save(final boolean needDismiss) { protected void save(final boolean needDismiss) {
final FavouritePoint point = new FavouritePoint(favorite.getLatitude(), favorite.getLongitude(), getNameTextValue(), getCategoryTextValue()); final FavouritePoint point = new FavouritePoint(favorite.getLatitude(), favorite.getLongitude(),
getNameTextValue(), getCategoryTextValue());
point.setDescription(getDescriptionTextValue()); point.setDescription(getDescriptionTextValue());
AlertDialog.Builder builder = FavouritesDbHelper.checkDuplicates(point, helper, getMapActivity()); AlertDialog.Builder builder = FavouritesDbHelper.checkDuplicates(point, helper, getMapActivity());
@ -123,10 +126,13 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
dismiss(false); dismiss(false);
} }
MapContextMenu menu = getMapActivity().getContextMenu();
if (menu.getObject() == favorite) {
PointDescription pointDescription = favorite.getPointDescription(); PointDescription pointDescription = favorite.getPointDescription();
pointDescription.setLat(favorite.getLatitude()); pointDescription.setLat(favorite.getLatitude());
pointDescription.setLon(favorite.getLongitude()); pointDescription.setLon(favorite.getLongitude());
getMapActivity().getContextMenu().show(pointDescription, new FavouritePoint(favorite)); menu.refreshMenu(pointDescription, favorite);
}
} }
private void doAddFavorite(String name, String category, String description) { private void doAddFavorite(String name, String category, String description) {
@ -166,7 +172,7 @@ public class FavoritePointEditorFragment extends PointEditorFragment {
@Override @Override
public String getCategoryInitValue() { public String getCategoryInitValue() {
return favorite.getCategory(); return favorite.getCategory().length() == 0 ? getString(R.string.shared_string_favorites) : favorite.getCategory();
} }
@Override @Override

View file

@ -15,14 +15,12 @@ import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button; import android.widget.Button;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.IconsCache; import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
@ -31,8 +29,6 @@ import net.osmand.plus.mapcontextmenu.editors.dialogs.SelectCategoryDialogFragme
import net.osmand.plus.widgets.AutoCompleteTextViewEx; import net.osmand.plus.widgets.AutoCompleteTextViewEx;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import java.util.List;
import static android.util.TypedValue.COMPLEX_UNIT_DIP; import static android.util.TypedValue.COMPLEX_UNIT_DIP;
public abstract class PointEditorFragment extends Fragment { public abstract class PointEditorFragment extends Fragment {
@ -107,30 +103,15 @@ public abstract class PointEditorFragment extends Fragment {
nameEdit.setText(getNameInitValue()); nameEdit.setText(getNameInitValue());
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) view.findViewById(R.id.category_edit); AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) view.findViewById(R.id.category_edit);
categoryEdit.setText(getCategoryInitValue()); categoryEdit.setText(getCategoryInitValue());
categoryEdit.setThreshold(1);
final FavouritesDbHelper helper = getMyApplication().getFavorites();
List<FavouritesDbHelper.FavoriteGroup> gs = helper.getFavoriteGroups();
String[] list = new String[gs.size()];
for(int i = 0; i < list.length; i++) {
list[i] =gs.get(i).name;
}
categoryEdit.setAdapter(new ArrayAdapter<>(getMapActivity(), R.layout.list_textview, list));
categoryEdit.setOnTouchListener(new View.OnTouchListener() { categoryEdit.setOnTouchListener(new View.OnTouchListener() {
@Override @Override
public boolean onTouch(final View v, MotionEvent event) { 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.getAction() == MotionEvent.ACTION_UP) {
if (event.getX() >= (editText.getRight()
- editText.getCompoundDrawables()[DRAWABLE_RIGHT].getBounds().width()
- editText.getPaddingRight())) {
DialogFragment dialogFragment = DialogFragment dialogFragment =
SelectCategoryDialogFragment.createInstance(); SelectCategoryDialogFragment.createInstance();
dialogFragment.show(getChildFragmentManager(), "SelectCategoryDialogFragment"); dialogFragment.show(getChildFragmentManager(), "SelectCategoryDialogFragment");
return true; return true;
} }
}
return false; return false;
} }
}); });
@ -193,7 +174,8 @@ public abstract class PointEditorFragment extends Fragment {
public void setCategory(String name) { public void setCategory(String name) {
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) getView().findViewById(R.id.category_edit); AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) getView().findViewById(R.id.category_edit);
categoryEdit.setText(name); String n = name.length() == 0 ? getString(R.string.shared_string_favorites) : name;
categoryEdit.setText(n);
ImageView categoryImage = (ImageView) getView().findViewById(R.id.category_image); ImageView categoryImage = (ImageView) getView().findViewById(R.id.category_image);
categoryImage.setImageDrawable(getCategoryIcon()); categoryImage.setImageDrawable(getCategoryIcon());
} }
@ -247,7 +229,9 @@ public abstract class PointEditorFragment extends Fragment {
public String getCategoryTextValue() { public String getCategoryTextValue() {
AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) getView().findViewById(R.id.category_edit); AutoCompleteTextViewEx categoryEdit = (AutoCompleteTextViewEx) getView().findViewById(R.id.category_edit);
return categoryEdit.getText().toString().trim(); String name = categoryEdit.getText().toString().trim();
return name.equals(getString(R.string.shared_string_favorites)) ? "" : name;
} }
public String getDescriptionTextValue() { public String getDescriptionTextValue() {

View file

@ -43,7 +43,8 @@ public class SelectCategoryDialogFragment extends DialogFragment {
icon.setImageDrawable(getIcon(getActivity(), R.drawable.ic_action_folder)); icon.setImageDrawable(getIcon(getActivity(), R.drawable.ic_action_folder));
} }
Button button = (Button)itemView.findViewById(R.id.button); Button button = (Button)itemView.findViewById(R.id.button);
button.setText(category.name); String name = category.name.length() == 0 ? getString(R.string.shared_string_favorites) : category.name;
button.setText(name);
button.setOnClickListener(new View.OnClickListener() { button.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {

View file

@ -477,7 +477,7 @@ public class ContextMenuLayer extends OsmandMapLayer {
} }
} }
activity.getContextMenu().hide(); activity.getContextMenu().onSingleTapOnMap();
return false; return false;
} }