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

This commit is contained in:
Victor Shcherb 2015-09-08 20:24:26 +02:00
commit 142e8d591e
23 changed files with 718 additions and 194 deletions

View file

@ -4,6 +4,7 @@
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:theme="?attr/new_app_theme">
<LinearLayout
@ -47,9 +48,10 @@
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textColor="@color/dashboard_black"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"/>
osmand:typeface="@string/font_roboto_medium"
tools:text="poi name"/>
</LinearLayout>
<View
@ -84,9 +86,10 @@
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textColor="@color/dashboard_black"
android:textColor="?android:attr/textColorPrimary"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"/>
osmand:typeface="@string/font_roboto_medium"
tools:text="landmark"/>
</LinearLayout>
</LinearLayout>

View file

@ -2,12 +2,12 @@
<LinearLayout android:id="@+id/context_menu_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/context_menu_shadow_layout"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
@ -24,12 +24,12 @@
android:id="@+id/context_menu_main"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="?attr/bg_map_context_menu"
android:orientation="vertical">
<LinearLayout
android:id="@+id/context_menu_top_view"
android:baselineAligned="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
@ -53,8 +53,9 @@
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical">
@ -79,25 +80,41 @@
android:layout_marginTop="3dp"
android:text="@string/other_location"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_list_text_size"/>
android:textSize="@dimen/default_desc_text_size"/>
</LinearLayout>
<LinearLayout
android:id="@+id/context_menu_close_btn_layout"
android:orientation="horizontal"
android:layout_width="32dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/context_menu_close_btn_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="12dp"
android:scaleType="center"
android:src="@drawable/ic_action_remove_dark"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#c9c9c9"/>
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
<LinearLayout
android:id="@+id/context_menu_buttons"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="64dp"
android:layout_gravity="bottom"
android:background="@android:color/white">
android:layout_gravity="bottom">
<ImageButton
android:id="@+id/context_menu_route_button"
@ -110,9 +127,9 @@
android:src="@drawable/map_directions"/>
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="#c9c9c9"/>
android:layout_width="1dp"
android:background="?attr/dashboard_divider"/>
<ImageButton
android:id="@+id/context_menu_fav_button"
@ -125,9 +142,9 @@
android:src="@drawable/ic_action_fav_dark"/>
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="#c9c9c9"/>
android:layout_width="1dp"
android:background="?attr/dashboard_divider"/>
<ImageButton
android:id="@+id/context_menu_share_button"
@ -140,9 +157,9 @@
android:src="@drawable/abc_ic_menu_share_mtrl_alpha"/>
<View
android:layout_width="1px"
android:layout_height="match_parent"
android:background="#c9c9c9"/>
android:layout_width="1dp"
android:background="?attr/dashboard_divider"/>
<ImageButton
android:id="@+id/context_menu_more_button"
@ -155,6 +172,21 @@
android:src="@drawable/ic_action_core_overflow_dark"/>
</LinearLayout>
<LinearLayout
android:id="@+id/context_menu_bottom_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dashboard_divider"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -2084,4 +2084,8 @@
<string name="av_locations">Месцазнаходжаньні</string>
<string name="number_of_rows_in_dash">Колькасьць радкоў на галоўным экране %1$s</string>
<string name="tag_poi_amenity">грамадзкі аб\'ект</string>
</resources>
<string name="poi_action_delete">выдаліць</string>
<string name="working_days">Працоўныя дні</string>
<string name="recent_places">Нядаўнія месцы</string>
<string name="favourites">Упадабанае</string>
</resources>

View file

@ -1141,4 +1141,7 @@
<string name="poi_landfill_waste_nuclear">Residus radioactius</string>
<string name="poi_brownfield">Camp per rehabilitar</string>
<string name="poi_start_date">Data d\'inici</string>
<string name="poi_wheelchair">Cadira de rodes</string>
</resources>

View file

@ -2139,4 +2139,10 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et
<string name="add_opening_hours">Ajouter des heures d\'ouverture</string>
<string name="poi_dialog_poi_type">Type de PI</string>
<string name="av_locations">Positions</string>
</resources>
<string name="poi_action_delete">Supprimer</string>
<string name="contact_info">Contact</string>
<string name="please_specify_poi_type">Merci d\'indiquer un type de PI.</string>
<string name="working_days">Jours travaillés</string>
<string name="recent_places">Emplacements récents</string>
<string name="favourites">Favoris</string>
</resources>

View file

@ -451,7 +451,7 @@
<string name="poi_tram_stop">Parada de tranvía</string>
<string name="poi_bus_station">Estación de autobuses</string>
<string name="poi_railway_station">Estación ferroviaria</string>
<string name="poi_ferry_terminal"/>
<string name="poi_ferry_terminal">Terminal de ferris</string>
<string name="poi_observation_tower">Atalaia</string>
<string name="poi_bell_tower">Campanario</string>
<string name="poi_recycling_centre">Centro</string>
@ -600,4 +600,181 @@
<string name="poi_denomination_coptic_orthodox">Ortodoxa copta</string>
<string name="poi_denomination_wesleyan">Wesleyana</string>
<string name="poi_denomination_maronite">Maronita</string>
<string name="poi_internet_access_public">Acceso á Internet: público</string>
<string name="poi_internet_access_wired">Acceso á Internet: con fíos</string>
<string name="poi_internet_access_service">Acceso á Internet: servizo</string>
<string name="poi_internet_access_terminal">Acceso á Internet: terminal</string>
<string name="poi_internet_access_wlan">Acceso á Internet: rede local sen fíos</string>
<string name="poi_denomination_mahayana">Mahayana</string>
<string name="poi_viewpoint">Miradoiro</string>
<string name="poi_locality">Localidade</string>
<string name="poi_rest_area">Área de descanso</string>
<string name="poi_sport_motor">Deporte de motor</string>
<string name="poi_boundary_stone">Marco</string>
<string name="poi_general_tourist_attraction_yes">Atracción turística xeral</string>
<string name="poi_attraction_amusement_ride">Atracción de feira</string>
<string name="poi_lodging">Aloxamento</string>
<string name="poi_guest_house">Pensión</string>
<string name="poi_religion_zoroastrian">Zoroastriana</string>
<string name="poi_denomination_united">Unida</string>
<string name="poi_denomination_iglesia_ni_cristo">Iglesia ni cristo</string>
<string name="poi_denomination_latter_day_saints">Santos dos Últimos Días</string>
<string name="poi_denomination_united_church_of_christ">Igrexa Unida de Cristo</string>
<string name="poi_tomb">Tumba</string>
<string name="poi_piste">Pista</string>
<string name="poi_piste_downhill">Pista de esquí</string>
<string name="poi_piste_nordic">Pista de esquí nórdico</string>
<string name="poi_ski_rental">Alugueiro de esquís</string>
<string name="poi_gallery">Galería de arte</string>
<string name="poi_stripclub">Club de striptease</string>
<string name="poi_ski_resort">Estación de esquí</string>
<string name="poi_dog_park">Parque para cans</string>
<string name="poi_harbour">Porto</string>
<string name="poi_bench">Banco</string>
<string name="poi_craft_agricultural_engines">Motores agrícolas</string>
<string name="poi_craft_beekeeper">Apicultor</string>
<string name="poi_craft_optician">Óptico</string>
<string name="poi_shower">Ducha</string>
<string name="poi_smoking_area">Zona de fumadores</string>
<string name="poi_stone">Pelouro notábel</string>
<string name="poi_valley">Val</string>
<string name="poi_water">Auga</string>
<string name="poi_wood">Bosque</string>
<string name="poi_tree">Árbore</string>
<string name="poi_beacon">Baliza</string>
<string name="poi_dyke">Dique</string>
<string name="poi_mooring">Amarre</string>
<string name="poi_military_landuse">Zona militar</string>
<string name="poi_military_nuclear_explosion_site">Lugar de explosión nuclear</string>
<string name="poi_wiki_place">Wikipedia</string>
<string name="poi_wiki_lang_en">Wiki en inglés</string>
<string name="poi_wiki_lang_ar">Wiki en árabe</string>
<string name="poi_wiki_lang_be">Wiki en bielorruso</string>
<string name="poi_wiki_lang_bg">Wiki en búlgaro</string>
<string name="poi_wiki_lang_ca">Wiki en catalán</string>
<string name="poi_wiki_lang_ceb">Wiki en cebuano</string>
<string name="poi_wiki_lang_cs">Wiki en checo</string>
<string name="poi_wiki_lang_da">Wiki en dinamarqués</string>
<string name="poi_wiki_lang_de">Wiki en alemán</string>
<string name="poi_wiki_lang_el">Wiki en grego</string>
<string name="poi_wiki_lang_et">Wiki en estoniano</string>
<string name="poi_wiki_lang_es">Wiki en español</string>
<string name="poi_wiki_lang_fi">Wiki en finlandés</string>
<string name="poi_wiki_lang_fr">Wiki en francés</string>
<string name="poi_wiki_lang_gl">Wiki en galego</string>
<string name="poi_wiki_lang_he">Wiki en hebreo</string>
<string name="poi_wiki_lang_hi">Wiki en hindi</string>
<string name="poi_wiki_lang_hr">Wiki en croata</string>
<string name="poi_wiki_lang_ht">Wiki en haitiano</string>
<string name="poi_wiki_lang_hu">Wiki en húngaro</string>
<string name="poi_wiki_lang_id">Wiki en indonesio</string>
<string name="poi_wiki_lang_it">Wiki en italiano</string>
<string name="poi_wiki_lang_ja">Wiki en xaponés</string>
<string name="poi_wiki_lang_ko">Wiki en coreano</string>
<string name="poi_wiki_lang_lt">Wiki en lituano</string>
<string name="poi_wiki_lang_lv">Wiki en letón</string>
<string name="poi_wiki_lang_ms">Wiki en malaio</string>
<string name="poi_wiki_lang_new">Wiki en newar</string>
<string name="poi_wiki_lang_nl">Wiki en holandés</string>
<string name="poi_wiki_lang_nn">Wiki en noruegués nynorsk</string>
<string name="poi_wiki_lang_no">Wiki en noruegués</string>
<string name="poi_wiki_lang_pl">Wiki en polaco</string>
<string name="poi_wiki_lang_pt">Wiki en portugués</string>
<string name="poi_wiki_lang_ro">Wiki en romanés</string>
<string name="poi_wiki_lang_ru">Wiki en ruso</string>
<string name="poi_wiki_lang_sk">Wiki en eslovaco</string>
<string name="poi_wiki_lang_sl">Wiki en esloveno</string>
<string name="poi_wiki_lang_sr">Wiki en serbio</string>
<string name="poi_wiki_lang_sv">Wiki en sueco</string>
<string name="poi_wiki_lang_sw">Wiki en suahili</string>
<string name="poi_wiki_lang_te">Wiki en telugu</string>
<string name="poi_wiki_lang_th">Wiki en tailandés</string>
<string name="poi_wiki_lang_tr">Wiki en turco</string>
<string name="poi_wiki_lang_uk">Wiki en ucraíno</string>
<string name="poi_wiki_lang_vi">Wiki en vietnamita</string>
<string name="poi_wiki_lang_vo">Wiki en volapük</string>
<string name="poi_wiki_lang_zh">Wiki en chinés</string>
<string name="poi_barrier_entrance">Entrada</string>
<string name="poi_entrance_main">Entrada principal</string>
<string name="poi_entrance">Entrada</string>
<string name="poi_entrance_exit">Saída</string>
<string name="poi_opening_hours">Horario de apertura</string>
<string name="poi_description">Descrición</string>
<string name="poi_phone">Teléfono</string>
<string name="poi_website">Sitio web</string>
<string name="poi_email">Correo electrónico</string>
<string name="poi_fax">Fax</string>
<string name="poi_facebook">Facebook</string>
<string name="poi_twitter">Twitter</string>
<string name="poi_skype">Skype</string>
<string name="poi_youtube">Youtube</string>
<string name="poi_instagram">Instagram</string>
<string name="poi_vk">Vkontakte</string>
<string name="poi_google_plus">Google+</string>
<string name="poi_mobile">Móbil</string>
<string name="poi_maxheight">Altura máxima</string>
<string name="poi_maxweight">Peso máximo</string>
<string name="poi_abandoned">Abandonado</string>
<string name="poi_abandoned_poi">Obxecto abandonado</string>
<string name="poi_disused">En desuso</string>
<string name="poi_brand">Marca</string>
<string name="poi_drinking_water_yes">Auga potábel</string>
<string name="poi_drinking_water_no">Auga non potábel</string>
<string name="poi_supervised_yes">Vixiado</string>
<string name="poi_supervised_no">Non vixiado</string>
<string name="poi_seasonal_yes">Temporal</string>
<string name="poi_seasonal_no">Non temporal</string>
<string name="poi_seasonal_dry_season">Estación seca</string>
<string name="poi_seasonal_wet_season">Estación húmida</string>
<string name="poi_seasonal_spring">Primavera</string>
<string name="poi_seasonal_summer">Verán</string>
<string name="poi_seasonal_autumn">Outono</string>
<string name="poi_seasonal_winter">Inverno</string>
<string name="poi_crossing_traffic_signals">Con sinais de tráfico</string>
<string name="poi_crossing_uncontrolled">Sen control</string>
<string name="poi_crossing_unmarked">Sen marcas</string>
<string name="poi_start_date">Data de inicio</string>
<string name="poi_wheelchair">Cadeira de rodas</string>
<string name="poi_access_private">Acceso privado</string>
<string name="poi_access_no">Sen acceso</string>
<string name="poi_access_permissive">Acceso permisivo</string>
<string name="poi_access_customers">Acceso para clientes</string>
<string name="poi_access_delivery">Acceso para entregas</string>
<string name="poi_access_agricultural">Acceso agrícola</string>
<string name="poi_content_water">Auga (contido)</string>
<string name="poi_content_fuel">Combustíbel (contido)</string>
<string name="poi_content_wine">Viño (contido)</string>
<string name="poi_content_biomass">Biomasa (contido)</string>
<string name="poi_content_crop">Colleita (contido)</string>
<string name="poi_content_fodder">Forraxe (contido)</string>
<string name="poi_content_beer">Cervexa (contido)</string>
<string name="poi_content_salt">Sal (contido)</string>
<string name="poi_scuba_diving_shop">Tenda de materiais de mergullo con botella</string>
<string name="poi_car_repair">Taller de automoción</string>
<string name="poi_recycling_low_energy_bulbs">Lámpadas de baixo consumo</string>
<string name="poi_club_ethnic">Club étnico</string>
<string name="poi_club_nature">Club da natureza</string>
<string name="poi_club_shooting">Club de tiro</string>
<string name="poi_club_tourism">Club turista</string>
<string name="poi_collection_times">Horario de recollida</string>
<string name="poi_building">Edificio</string>
<string name="poi_content_grain">Gran (contido)</string>
<string name="poi_animal_shelter_dog">Canceira</string>
<string name="poi_animal_shelter_cat">Refuxio para gatos</string>
<string name="poi_animal_shelter_dog_cat">Refuxio para cans e gatos</string>
<string name="poi_animal_shelter_bird">Refuxio para aves</string>
</resources>

View file

@ -442,7 +442,7 @@
<string name="context_menu_item_directions_from">Indicacións desde</string>
<string name="route_descr_map_location">"Mapa: "</string>
<string name="route_descr_lat_lon">Lat %1$.3f, lon %2$.3f</string>
<string name="route_descr_current_location">Posición actaul</string>
<string name="route_descr_current_location">Posición actual</string>
<string name="route_to">Para:</string>
<string name="route_via">Pasando por:</string>
<string name="route_from">Desde:</string>
@ -606,7 +606,7 @@
<string name="shared_string_control_start">Comezar</string>
<string name="map_widget_av_notes">Notas de son/vídeo</string>
<string name="osmand_srtm_short_description_80_chars">Engadido de OsmAnd para curvas de nivel sen conexión</string>
<string name="osmand_srtm_long_description_1000_chars">Este engadido fornece curvas de nivel que poden ser mostradas nos mapas sen conexión de OsmAnd. Os datos globais (entre os 70 graos norte e os 70 graos sul) están baseados nas medicións de SRTM (Misión Topográfica con Radar da Lanzadeira Espacial) e ASTER (Radiómetro Espacial Avanzado de Emisión Térmica e Reflexión) e instrumentos de imaxes a bordo do Terra, o satélite máis importante do Sistema de Observación Terrestre da NASA. ASTER é un esforzo cooperativo entre a NASA, o Ministerio de Economía do Xapón, Comercio e Industria (METI) e Sistemas Espaciais Xaponeses (J-spaceystems).</string>
<string name="osmand_srtm_long_description_1000_chars">"Este engadido fornece unha capa de sobreposición de curvas de nivel e unha capa de sombras de altitude (relevo) que poden ser mostradas nos mapas sen conexión de OsmAnd. Esta funcionalidade pode ser moi apreciada por atletas, camiñantes, sendeiristas e calqueira que teña interese pola estrutura de relevo da paisaxe.\n\nOs datos globais (entre os 70 graos norte e os 70 graos sul) están baseados nas medicións de SRTM (Misión Topográfica con Radar da Lanzadeira Espacial) e ASTER (Radiómetro Espacial Avanzado de Emisión Térmica e Reflexión) e instrumentos de imaxes a bordo do Terra, o satélite máis importante do Sistema de Observación Terrestre da NASA. ASTER é un esforzo cooperativo entre a NASA, o Ministerio de Economía do Xapón, Comercio e Industria (METI) e Sistemas Espaciais Xaponeses (J-spaceystems). "</string>
<string name="map_widget_distancemeasurement">Medición de distancias</string>
<string name="audionotes_location_not_defined">A situación que asociar coa nota aínda non foi definida. Con «Empregar a situación...» pódeselle asignar unha nota á situación indicada</string>
@ -615,7 +615,7 @@
<string name="audionotes_plugin_name">Notas de son/vídeo</string>
<string name="index_srtm_parts">partes</string>
<string name="index_srtm_ele">Curvas de nivel</string>
<string name="srtm_plugin_description">Facilita a descarga de curvas de nivel e sombreados sen conexión («Configuración» → «Xestionar os ficheiros de mapas» → «Descargar» → Seleccione o tipo de mapa que desexe).</string>
<string name="srtm_plugin_description">"Este engadido fornece unha capa de sobreposición de curvas de nivel e unha capa de sombras de altitude (relevo) que poden ser mostradas nos mapas sen conexión de OsmAnd. Esta funcionalidade pode ser moi apreciada por atletas, camiñantes, sendeiristas e calqueira que teña interese pola estrutura de relevo da paisaxe.\n\nOs datos globais (entre os 70 graos norte e os 70 graos sul) están baseados nas medicións de SRTM (Misión Topográfica con Radar da Lanzadeira Espacial) e ASTER (Radiómetro Espacial Avanzado de Emisión Térmica e Reflexión) e instrumentos de imaxes a bordo do Terra, o satélite máis importante do Sistema de Observación Terrestre da NASA. ASTER é un esforzo cooperativo entre a NASA, o Ministerio de Economía do Xapón, Comercio e Industria (METI) e Sistemas Espaciais Xaponeses (J-spaceystems). "</string>
<string name="srtm_plugin_name">Curvas de nivel</string>
<string name="download_select_map_types">Outros mapas</string>
<string name="download_roads_only_item">Só as estradas</string>
@ -1015,7 +1015,7 @@
\n\t- Other small features "</string>
<string name="free_version_message">Esta versión gratuíta do OsmAnd está limitada a %1$s descargas e non admite artigos da Wikipedia sen conexión.</string>
<string name="free_version_title">Versión libre</string>
<string name="poi_context_menu_showdescription">Mostrar a descrición dos puntos de interese (PDI)</string>
<string name="poi_context_menu_showdescription">Mostrar a descrición do punto de interese (PDI)</string>
<string name="index_name_north_america">Norteamérica</string>
<string name="index_name_us">Norteamérica - Estados Unidos</string>
<string name="index_name_central_america">América Central</string>
@ -1968,4 +1968,34 @@
<string name="shared_string_action_template">Acción {0}</string>
<string name="shared_string_collapse">Contraer</string>
<string name="shared_string_address">Enderezo</string>
<string name="shared_string_logoff">Pechar a sesión</string>
<string name="rename_failed">Non foi posíbel cambiar o nome</string>
<string name="days_behind">días de atraso</string>
<string name="rendering_attr_pisteGrooming_name">Coidado de pistas</string>
<string name="nautical_maps_missing">Para poder mostrar mapas náuticos hai que descargar o mapa especial sen conexión</string>
<string name="edit_group">Editar o grupo</string>
<string name="parking_place">Lugar de aparcamento</string>
<string name="version_settings_descr">Descargar versións nocturnas</string>
<string name="version_settings">Construcións (versións)</string>
<string name="voices">Indicacións con voz</string>
<string name="poi_action_delete">eliminar</string>
<string name="use_fast_recalculation">Recálculo automático da ruta</string>
<string name="failed_to_upload">Non foi posíbel enviar</string>
<string name="opening_at">Abre ás</string>
<string name="closing_at">Pecha ás</string>
<string name="add_opening_hours">Engadir as horas de apertura</string>
<string name="working_days">Días laborábeis</string>
<string name="recent_places">Lugares recentes</string>
<string name="favourites">Favoritos</string>
<string name="av_locations">Lugares</string>
<string name="rendering_value_boldOutline_name">Bordo groso</string>
<string name="lang_nv">Navaho</string>
<string name="disable_recording_once_app_killed_descrp">Detén o rexistro de GPX cando se mata o aplicativo (mediante apps recentes). A indicación do modo de durmir de OsmAnd desaparece da barra de notificacións de Android).</string>
<string name="agps_info">Información de A-GPS</string>
<string name="agps_data_last_downloaded">Datos de A-GPS descargados por última vez: %1$s</string>
<string name="delay_to_start_navigation_descr">Indicar o tempo de agarda durante o que ficar na pantalla de planificación de rutas</string>
<string name="delay_to_start_navigation">Iniciar a navegación paso a paso despois de…</string>
<string name="parking_place_limited">Tempo de aparcamento limitado a</string>
<string name="plugin_nautical_name">Vista de mapa náutico</string>
<string name="save_track_to_gpx_globally_headline">Rexistro de pistas baixo petición</string>
</resources>

View file

@ -2166,4 +2166,8 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz
<string name="poi_dialog_poi_type">Tipo di PDI</string>
<string name="number_of_rows_in_dash">Numero di righe del cruscotto %1$s</string>
<string name="please_specify_poi_type">Per favore specifica il tipo si PDI.</string>
<string name="poi_action_delete">Elimina</string>
<string name="working_days">Giorni lavorativi</string>
<string name="recent_places">Luoghi recenti</string>
<string name="favourites">Preferiti</string>
</resources>

View file

@ -2088,4 +2088,6 @@
<string name="number_of_rows_in_dash">Количество строк на странице %1$s</string>
<string name="please_specify_poi_type">Пожалуйста, укажите тип POI.</string>
<string name="rendering_value_boldOutline_name">Жирный контур</string>
</resources>
<string name="working_days">Рабочие дни</string>
<string name="favourites">Избранное</string>
</resources>

View file

@ -1962,4 +1962,20 @@
<string name="routing_attr_avoid_shuttle_train_name">Izogni se vožnji z vlakom</string>
<string name="routing_attr_avoid_shuttle_train_description">Izogni se vožnji z vlakom</string>
<string name="offline_maps_and_navigation">Zemljevidi za delo brez\npovezave in navigacijo</string>
<string name="favourites">Priljubljene</string>
<string name="av_locations_descr">Datoteka GPX z opombami</string>
<string name="av_locations">Mesta</string>
<string name="poi_action_delete">izbriši</string>
<string name="tab_title_basic">Osnovno</string>
<string name="tab_title_advanced">Napredno</string>
<string name="tag_poi_name">ime</string>
<string name="tag_poi_amenity">prednost</string>
<string name="contact_info">Podatki stika</string>
<string name="description">Opis</string>
<string name="add_opening_hours">Dodaj odpiralni čas</string>
<string name="poi_dialog_poi_type">Vrsta točke POI</string>
<string name="number_of_rows_in_dash">Število vrstic v %1$s</string>
<string name="please_specify_poi_type">Določiti je treba vrsto točke POI.</string>
<string name="working_days">Delovni dnevi</string>
<string name="recent_places">Nedavna mesta</string>
</resources>

View file

@ -38,7 +38,6 @@ public class NavigationService extends Service implements LocationListener {
// global id don't conflict with others
private final static int NOTIFICATION_SERVICE_ID = 5;
public final static String OSMAND_STOP_SERVICE_ACTION = "OSMAND_STOP_SERVICE_ACTION"; //$NON-NLS-1$
public final static String OSMAND_SAVE_SERVICE_ACTION = "OSMAND_SAVE_SERVICE_ACTION";
public static int USED_BY_NAVIGATION = 1;
public static int USED_BY_GPX = 2;
public static int USED_BY_LIVE = 4;
@ -176,26 +175,23 @@ public class NavigationService extends Service implements LocationListener {
if (settings.SAVE_GLOBAL_TRACK_TO_GPX.get()) {
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(false);
}
OsMoPlugin plugin = OsmandPlugin.getEnabledPlugin(OsMoPlugin.class);
if (plugin != null) {
if (plugin.getTracker().isEnabledTracker()) {
plugin.getTracker().disableTracker();
OsMoPlugin osmoPlugin = OsmandPlugin.getEnabledPlugin(OsMoPlugin.class);
if (osmoPlugin != null) {
if (osmoPlugin.getTracker().isEnabledTracker()) {
osmoPlugin.getTracker().disableTracker();
}
}
OsmandMonitoringPlugin monitoringPlugin =
OsmandPlugin.getEnabledPlugin(OsmandMonitoringPlugin.class);
if (monitoringPlugin != null) {
monitoringPlugin.stopRecording();
}
NavigationService.this.stopSelf();
}
};
registerReceiver(broadcastReceiver, new IntentFilter(OSMAND_STOP_SERVICE_ACTION));
saveBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final OsmandMonitoringPlugin plugin = OsmandPlugin
.getEnabledPlugin(OsmandMonitoringPlugin.class);
plugin.saveCurrentTrack();
}
};
registerReceiver(saveBroadcastReceiver, new IntentFilter(OSMAND_SAVE_SERVICE_ACTION));
//Show currently active wake-up interval
int soi = settings.SERVICE_OFF_INTERVAL.get();
@ -215,14 +211,6 @@ public class NavigationService extends Service implements LocationListener {
// notification.flags = Notification.FLAG_NO_CLEAR;
// startForeground(NOTIFICATION_SERVICE_ID, notification);
String stop = getResources().getString(R.string.shared_string_control_stop);
Intent stopIntent = new Intent(OSMAND_STOP_SERVICE_ACTION);
PendingIntent stopPendingIntent = PendingIntent.getBroadcast(this, 0, stopIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
String pause = getResources().getString(R.string.shared_string_save);
Intent saveIntent = new Intent(OSMAND_SAVE_SERVICE_ACTION);
PendingIntent savePendingIntent = PendingIntent.getBroadcast(this, 0, saveIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Intent contentIntent = new Intent(this, MapActivity.class);
PendingIntent contentPendingIntent = PendingIntent.getActivity(this, 0, contentIntent,
PendingIntent.FLAG_UPDATE_CURRENT);

View file

@ -1,10 +1,11 @@
package net.osmand.plus.activities;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map.Entry;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.widget.ListAdapter;
import android.widget.Toast;
import net.osmand.CallbackWithObject;
import net.osmand.ResultMatcher;
@ -12,7 +13,6 @@ import net.osmand.StateChangedListener;
import net.osmand.access.AccessibleToast;
import net.osmand.map.ITileSource;
import net.osmand.map.TileSourceManager.TileSourceTemplate;
import net.osmand.osm.PoiCategory;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.Item;
import net.osmand.plus.GPXUtilities.GPXFile;
@ -47,12 +47,11 @@ import net.osmand.plus.views.RouteLayer;
import net.osmand.plus.views.TransportInfoLayer;
import net.osmand.plus.views.TransportStopsLayer;
import net.osmand.plus.views.mapwidgets.MapWidgetRegistry;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.widget.ListAdapter;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map.Entry;
/**
* Object is responsible to maintain layers using by map activity
@ -259,7 +258,7 @@ public class MapActivityLayers {
addFilterToList(adapter, list, f);
}
Builder builder = new AlertDialog.Builder(activity);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
ListAdapter listAdapter = adapter.createListAdapter(activity, app.getSettings().isLightContent());
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener(){
@Override
@ -321,7 +320,7 @@ public class MapActivityLayers {
final List<Entry<String, String>> entriesMapList = new ArrayList<Entry<String, String>>(entriesMap.entrySet());
Builder builder = new AlertDialog.Builder(activity);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
String selectedTileSourceKey = settings.MAP_TILE_SOURCES.get();

View file

@ -1,12 +1,16 @@
package net.osmand.plus.dialogs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Toast;
import net.osmand.access.AccessibleToast;
import net.osmand.core.android.MapRendererContext;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.ContextMenuAdapter.OnRowItemClick;
@ -20,7 +24,6 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.PluginActivity;
import net.osmand.plus.activities.SettingsActivity;
import net.osmand.plus.activities.TransportRouteHelper;
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
import net.osmand.plus.poi.PoiUIFilter;
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
import net.osmand.plus.render.RendererRegistry;
@ -28,21 +31,18 @@ import net.osmand.plus.views.GPXLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.RouteLayer;
import net.osmand.plus.views.corenative.NativeCoreContext;
import gnu.trove.list.array.TIntArrayList;
import net.osmand.core.android.MapRendererContext;
import net.osmand.render.RenderingRuleProperty;
import net.osmand.render.RenderingRuleStorageProperties;
import net.osmand.render.RenderingRulesStorage;
import net.osmand.util.Algorithms;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import gnu.trove.list.array.TIntArrayList;
public class ConfigureMapMenu {
@ -473,7 +473,7 @@ public class ConfigureMapMenu {
protected void showPreferencesDialog(final ContextMenuAdapter adapter, final ArrayAdapter<?> a, final int pos, final MapActivity activity,
String category, List<RenderingRuleProperty> ps, final List<CommonPreference<Boolean>> prefs) {
Builder bld = new AlertDialog.Builder(activity);
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
boolean[] checkedItems = new boolean[prefs.size()];
for (int i = 0; i < prefs.size(); i++) {
checkedItems[i] = prefs.get(i).get();

View file

@ -1,12 +1,24 @@
package net.osmand.plus.helpers;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.app.Activity;
import android.app.Application;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Build;
import android.support.v7.app.AlertDialog;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.CallbackWithObject;
import net.osmand.IndexConstants;
@ -20,26 +32,14 @@ import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.util.Algorithms;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Application;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Build;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class GpxUiHelper {
@ -232,7 +232,7 @@ public class GpxUiHelper {
final List<String> list, final ContextMenuAdapter adapter) {
final OsmandApplication app = (OsmandApplication) activity.getApplication();
final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
Builder b = new AlertDialog.Builder(activity);
AlertDialog.Builder b = new AlertDialog.Builder(activity);
// final int padding = (int) (12 * activity.getResources().getDisplayMetrics().density + 0.5f);
final boolean light = app.getSettings().isLightContent();
final int layout;

View file

@ -1,7 +1,20 @@
package net.osmand.plus.helpers;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.data.LatLon;
import net.osmand.data.LocationPoint;
@ -16,21 +29,9 @@ import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper;
import net.osmand.plus.poi.PoiUIFilter;
import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.util.MapUtils;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
/**
*/

View file

@ -0,0 +1,27 @@
package net.osmand.plus.mapcontextmenu;
import android.graphics.drawable.Drawable;
import android.view.View;
import net.osmand.plus.IconsCache;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
public abstract class BottomSectionBuilder {
protected OsmandApplication app;
public BottomSectionBuilder(OsmandApplication app) {
this.app = app;
}
public abstract void buildSection(View view);
public Drawable getRowIcon(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);
}
}

View file

@ -0,0 +1,130 @@
package net.osmand.plus.mapcontextmenu;
import android.content.res.Resources;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import net.osmand.data.Amenity;
import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.MapPoiTypes;
import net.osmand.osm.PoiType;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import java.util.Map;
import static android.util.TypedValue.COMPLEX_UNIT_DIP;
public class InfoSectionBuilder extends BottomSectionBuilder {
private final Amenity amenity;
public InfoSectionBuilder(OsmandApplication app, final Amenity amenity) {
super(app);
this.amenity = amenity;
}
private void buildRow(View view, int iconId, String text) {
LinearLayout ll = new LinearLayout(view.getContext());
ll.setOrientation(LinearLayout.HORIZONTAL);
LinearLayout.LayoutParams llParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) ;
llParams.setMargins(0, dpToPx(10f), 0, dpToPx(10f));
ll.setLayoutParams(llParams);
// Icon
LinearLayout llIcon = new LinearLayout(view.getContext());
llIcon.setOrientation(LinearLayout.HORIZONTAL);
llIcon.setLayoutParams(new LinearLayout.LayoutParams(dpToPx(42f), ViewGroup.LayoutParams.MATCH_PARENT));
ll.addView(llIcon);
ImageView icon = new ImageView(view.getContext());
LinearLayout.LayoutParams llIconParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) ;
llIconParams.setMargins(dpToPx(12f), 0, 0, 0);
llIconParams.gravity = Gravity.CENTER_VERTICAL;
icon.setLayoutParams(llIconParams);
icon.setScaleType(ImageView.ScaleType.CENTER);
icon.setImageDrawable(getRowIcon(iconId));
llIcon.addView(icon);
// Text
LinearLayout llText = new LinearLayout(view.getContext());
llText.setOrientation(LinearLayout.VERTICAL);
LinearLayout.LayoutParams llTextParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
llTextParams.setMargins(0, dpToPx(4f), 0, dpToPx(4f));
llText.setLayoutParams(llTextParams);
ll.addView(llText);
TextView textView = new TextView(view.getContext());
LinearLayout.LayoutParams llTextViewParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
llTextViewParams.setMargins(dpToPx(10f), 0, dpToPx(10f), 0);
llText.setLayoutParams(llTextViewParams);
textView.setText(text);
//textView.setText("sdf dsaf fsdasdfg adsf asdsfd asdf sdf adsfg asdf sdfa sdf dsf agsfdgd fgsfd sdf asdf adg adf sdf asdf dfgdfsg sdfg adsf asdf asdf sdf SDF ASDF ADSF ASDF ASDF DAF SDAF dfg dsfg dfg sdfg rg rth sfghs dfgs dfgsdfg adfg dfg sdfg dfs ");
llText.addView(textView);
((LinearLayout)view).addView(ll);
View horizontalLine = new View(view.getContext());
LinearLayout.LayoutParams llHorLineParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(1f));
llHorLineParams.gravity = Gravity.BOTTOM;
horizontalLine.setLayoutParams(llHorLineParams);
TypedValue typedValue = new TypedValue();
Resources.Theme theme = view.getContext().getTheme();
theme.resolveAttribute(R.attr.dashboard_divider, typedValue, true);
int color = typedValue.data;
horizontalLine.setBackgroundColor(color);
((LinearLayout)view).addView(horizontalLine);
}
public int dpToPx(float dp) {
Resources r = app.getResources();
return (int) TypedValue.applyDimension(
COMPLEX_UNIT_DIP,
dp,
r.getDisplayMetrics()
);
}
@Override
public void buildSection(View view) {
MapPoiTypes poiTypes = app.getPoiTypes();
for(Map.Entry<String, String> e : amenity.getAdditionalInfo().entrySet()) {
int iconId = 0;
String key = e.getKey();
String vl = e.getValue();
if(key.startsWith("name:")) {
continue;
} else if(Amenity.OPENING_HOURS.equals(key)) {
iconId = R.drawable.mm_clock; // todo: change icon
} else if(Amenity.PHONE.equals(key)) {
iconId = R.drawable.mm_amenity_telephone; // todo: change icon
} else if(Amenity.WEBSITE.equals(key)) {
iconId = R.drawable.mm_internet_access; // todo: change icon
} else {
iconId = R.drawable.ic_type_info; // todo: change icon
AbstractPoiType pt = poiTypes.getAnyPoiAdditionalTypeByKey(e.getKey());
if (pt != null) {
if(pt instanceof PoiType && !((PoiType) pt).isText()) {
vl = pt.getTranslation();
} else {
vl = /*pt.getTranslation() + ": " + */amenity.unzipContent(e.getValue());
}
} else {
vl = /*Algorithms.capitalizeFirstLetterAndLowercase(e.getKey()) +
": " + */amenity.unzipContent(e.getValue());
}
}
buildRow(view, iconId, vl);
}
}
}

View file

@ -134,7 +134,7 @@ public class MapContextMenu {
res = typeName;
}
return Algorithms.isEmpty(res) ? "Address is unknown yet" : res;
return Algorithms.isEmpty(res) ? "Address is unknown yet" : res; // todo: text constant
}
public String getLocationStr() {
@ -144,6 +144,17 @@ public class MapContextMenu {
return foundStreetName;
}
public BottomSectionBuilder getBottomSectionBuilder() {
if (object != null) {
if (object instanceof Amenity) {
return new InfoSectionBuilder(app, (Amenity)object);
}
}
return null;
}
public void buttonNavigatePressed() {
mapActivity.getMapActions().showNavigationContextMenuPoint(pointDescription.getLat(), pointDescription.getLon());
}

View file

@ -10,10 +10,8 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.DecelerateInterpolator;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import net.osmand.PlatformUtil;
@ -21,12 +19,9 @@ 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.activities.search.SearchActivity;
import org.apache.commons.logging.Log;
import java.util.Map;
public class MapContextMenuFragment extends Fragment {
@ -89,6 +84,8 @@ public class MapContextMenuFragment extends Fragment {
View topView = view.findViewById(R.id.context_menu_top_view);
mainView = view.findViewById(R.id.context_menu_main);
//LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(400));
//mainView.setLayoutParams(lp);
topView.setOnTouchListener(new View.OnTouchListener() {
@ -104,21 +101,16 @@ public class MapContextMenuFragment extends Fragment {
case MotionEvent.ACTION_MOVE:
float y = event.getY();
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mainView.getLayoutParams();
float top = lp.topMargin + (y - dy);
if (top < 0) {
lp.topMargin = (int) top;
mainView.setLayoutParams(lp);
}
mainView.setY(mainView.getY() + (y - dy));
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
float posY = view.getHeight() - mainViewHeight;
if (mainView.getY() != posY) {
if (mainView.getY() != posY)
mainView.animate().y(posY).setDuration(200).setInterpolator(new DecelerateInterpolator()).start();
}
break;
}
@ -126,6 +118,7 @@ public class MapContextMenuFragment extends Fragment {
}
});
// Left icon
IconsCache iconsCache = getMyApplication().getIconsCache();
boolean light = getMyApplication().getSettings().isLightContent();
@ -140,12 +133,27 @@ public class MapContextMenuFragment extends Fragment {
light ? R.color.icon_color : R.color.icon_color_light));
}
// Text line 1
TextView line1 = (TextView) view.findViewById(R.id.context_menu_line1);
line1.setText(MapContextMenu.getInstance().getAddressStr());
// Text line 2
TextView line2 = (TextView) view.findViewById(R.id.context_menu_line2);
line2.setText(MapContextMenu.getInstance().getLocationStr());
// Close button
final ImageView closeButtonView = (ImageView)view.findViewById(R.id.context_menu_close_btn_view);
closeButtonView.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark,
light ? R.color.actionbar_dark_color : R.color.actionbar_light_color));
closeButtonView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((MapActivity)getActivity()).getMapLayers().getContextMenuLayer().hideMapContextMenuMarker();
dismissMenu();
}
});
// Action buttons
final ImageButton buttonNavigate = (ImageButton) view.findViewById(R.id.context_menu_route_button);
buttonNavigate.setImageDrawable(iconsCache.getIcon(R.drawable.map_directions,
light ? R.color.actionbar_dark_color : R.color.actionbar_light_color));
@ -186,6 +194,20 @@ public class MapContextMenuFragment extends Fragment {
}
});
// Bottom view
BottomSectionBuilder bottomSectionBuilder = MapContextMenu.getInstance().getBottomSectionBuilder();
if (bottomSectionBuilder != null) {
View bottomView = view.findViewById(R.id.context_menu_bottom_view);
bottomView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
bottomSectionBuilder.buildSection(bottomView);
}
/*
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
toolbar.setTitle(R.string.poi_create_title);

View file

@ -3,9 +3,15 @@ package net.osmand.plus.monitoring;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v4.app.NotificationCompat;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
@ -45,6 +51,8 @@ import gnu.trove.list.array.TIntArrayList;
public class OsmandMonitoringPlugin extends OsmandPlugin {
private static final String ID = "osmand.monitoring";
private static final int notificationId = ID.hashCode();
public final static String OSMAND_SAVE_SERVICE_ACTION = "OSMAND_SAVE_SERVICE_ACTION";
private OsmandSettings settings;
private OsmandApplication app;
private TextInfoWidget monitoringControl;
@ -329,6 +337,10 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
public void stopRecording(){
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(false);
if (app.getNavigationService() != null) {
NotificationManager mNotificationManager =
(NotificationManager) app.getNavigationService()
.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.cancel(notificationId);
app.getNavigationService().stopIfNeeded(app, NavigationService.USED_BY_GPX);
}
}
@ -367,7 +379,39 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
}
});
}
String stop = map.getResources().getString(R.string.shared_string_control_stop);
Intent stopIntent = new Intent(NavigationService.OSMAND_STOP_SERVICE_ACTION);
PendingIntent stopPendingIntent = PendingIntent.getBroadcast(map, 0, stopIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
String save = map.getResources().getString(R.string.shared_string_save);
Intent saveIntent = new Intent(OSMAND_SAVE_SERVICE_ACTION);
PendingIntent savePendingIntent = PendingIntent.getBroadcast(map, 0, saveIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
BroadcastReceiver saveBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
final OsmandMonitoringPlugin plugin = OsmandPlugin
.getEnabledPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
plugin.saveCurrentTrack();
}
}
};
map.registerReceiver(saveBroadcastReceiver, new IntentFilter(OSMAND_SAVE_SERVICE_ACTION));
final NotificationCompat.Builder notificationBuilder =
new android.support.v7.app.NotificationCompat.Builder(map)
.setContentTitle(map.getResources().getString(R.string.map_widget_monitoring))
.setSmallIcon(R.drawable.ic_action_polygom_dark)
// .setLargeIcon(Helpers.getBitmap(R.drawable.mirakel, getBaseContext()))
.setOngoing(true)
.addAction(R.drawable.ic_action_rec_stop, stop, stopPendingIntent)
.addAction(R.drawable.ic_action_save, save, savePendingIntent);
NotificationManager mNotificationManager =
(NotificationManager) map.getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(notificationId, notificationBuilder.build());
}
public static void showIntervalChooseDialog(final Context uiCtx, final String patternMsg,

View file

@ -1,14 +1,6 @@
package net.osmand.plus.monitoring;
import android.view.Window;
import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmAndTaskManager.OsmAndTaskRunnable;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.SettingsBaseActivity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@ -21,6 +13,15 @@ import android.preference.Preference.OnPreferenceChangeListener;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.view.Window;
import net.osmand.plus.NavigationService;
import net.osmand.plus.OsmAndTaskManager.OsmAndTaskRunnable;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.SettingsBaseActivity;
public class SettingsMonitoringActivity extends SettingsBaseActivity {

View file

@ -19,6 +19,7 @@ import net.osmand.plus.osmedit.OsmPoint;
public class SendPoiDialogFragment extends DialogFragment {
public static final String TAG = "SendPoiDialogFragment";
public static final String OPENSTREETMAP_POINT = "openstreetmap_point";
private static String comment;
@NonNull
@Override
@ -31,6 +32,7 @@ public class SendPoiDialogFragment extends DialogFragment {
final EditText passwordEditText = (EditText) view.findViewById(R.id.passwordEditText);
final CheckBox closeChangeSetCheckBox =
(CheckBox) view.findViewById(R.id.closeChangeSetCheckBox);
messageEditText.setText(comment);
final OsmandSettings settings = ((OsmandApplication) getActivity().getApplication())
.getSettings();
userNameEditText.setText(settings.USER_NAME.get());
@ -44,12 +46,13 @@ public class SendPoiDialogFragment extends DialogFragment {
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
comment = messageEditText.getText().toString();
settings.USER_NAME.set(userNameEditText.getText().toString());
settings.USER_PASSWORD.set(passwordEditText.getText().toString());
for (OsmPoint osmPoint : poi) {
if (osmPoint.getGroup() == OsmPoint.Group.POI) {
((OpenstreetmapPoint) osmPoint)
.setComment(messageEditText.getText().toString());
.setComment(comment);
break;
}
}

View file

@ -4,14 +4,9 @@ import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PointF;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.os.Build;
import android.text.Html;
@ -68,7 +63,9 @@ public class ContextMenuLayer extends OsmandMapLayer {
private LatLon latLon;
private String description;
private Map<Object, IContextMenuProvider> selectedObjects = new ConcurrentHashMap<Object, IContextMenuProvider>();
private Object selectedObj;
private IContextMenuProvider contextObject;
private TextView textView;
private ImageView closeButton;
private OsmandMapTileView view;
@ -78,10 +75,8 @@ public class ContextMenuLayer extends OsmandMapLayer {
private float scaleCoefficient = 1;
private CallbackWithObject<LatLon> selectOnMap = null;
private Bitmap mapContextMarker;
private boolean showMapContextMarker;
private Paint mapMarkerPaintIcon;
private boolean showContextMarker;
private ImageView contextMarker;
public ContextMenuLayer(MapActivity activity){
this.activity = activity;
@ -130,11 +125,14 @@ public class ContextMenuLayer extends OsmandMapLayer {
closeButton.setImageDrawable(view.getResources().getDrawable(R.drawable.headliner_close));
closeButton.setClickable(true);
showMapContextMarker = false;
mapMarkerPaintIcon = new Paint();
mapMarkerPaintIcon.setColorFilter(new PorterDuffColorFilter(activity.getResources().getColor(R.color.osmand_orange), PorterDuff.Mode.SRC_IN));
mapContextMarker = BitmapFactory.decodeResource(view.getResources(), R.drawable.ic_action_marker2);
showContextMarker = false;
contextMarker = new ImageView(view.getContext());
contextMarker.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
contextMarker.setImageDrawable(view.getResources().getDrawable(R.drawable.map_pin_context_menu));
contextMarker.setClickable(true);
int minw = contextMarker.getDrawable().getMinimumWidth();
int minh = contextMarker.getDrawable().getMinimumHeight();
contextMarker.layout(0, 0, minw, minh);
if(latLon != null){
setLocation(latLon, description);
@ -153,8 +151,10 @@ public class ContextMenuLayer extends OsmandMapLayer {
int x = (int) box.getPixXFromLatLon(latLon.getLatitude(), latLon.getLongitude());
int y = (int) box.getPixYFromLatLon(latLon.getLatitude(), latLon.getLongitude());
if (showMapContextMarker)
canvas.drawBitmap(mapContextMarker, x - mapContextMarker.getWidth() / 2, y - mapContextMarker.getHeight(), mapMarkerPaintIcon);
if (showContextMarker) {
canvas.translate(x - contextMarker.getWidth() / 2, y - contextMarker.getHeight());
contextMarker.draw(canvas);
}
textView.setTextColor(nightMode != null && nightMode.isNightMode() ? Color.GRAY : Color.WHITE);
if (textView.getText().length() > 0) {
@ -201,15 +201,15 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
public void showMapContextMenuMarker() {
if (!showMapContextMarker) {
showMapContextMarker = true;
if (!showContextMarker) {
showContextMarker = true;
view.refreshMap();
}
}
public void hideMapContextMenuMarker() {
if (showMapContextMarker) {
showMapContextMarker = false;
if (showContextMarker) {
showContextMarker = false;
view.refreshMap();
}
}
@ -273,17 +273,19 @@ public class ContextMenuLayer extends OsmandMapLayer {
if (latLon != null) {
if (selectedObjects.size() == 1) {
setLocation(null, "");
Object selectedObj = selectedObjects.keySet().iterator().next();
showMapContextMenu(selectedObj, latLon);
} else {
String description = getSelectedObjectDescription();
setLocation(latLon, description);
selectedObj = selectedObjects.keySet().iterator().next();
contextObject = selectedObjects.get(selectedObj);
showMapContextMenu(latLon);
} else if (selectedObjects.size() > 1) {
showContextMenuForSelectedObjects(latLon);
}
} else {
setLocation(null, "");
final double lat = tileBox.getLatFromPixel((int) point.x, (int) point.y);
final double lon = tileBox.getLonFromPixel((int) point.x, (int) point.y);
showMapContextMenu(null, new LatLon(lat, lon));
selectedObj = null;
contextObject = null;
showMapContextMenu(new LatLon(lat, lon));
//setLocation(new LatLon(lat, lon), null);
}
view.refreshMap();
@ -362,7 +364,19 @@ public class ContextMenuLayer extends OsmandMapLayer {
}
return 0;
}
public boolean pressedContextMarker(RotatedTileBox tb, float px, float py) {
if (latLon != null && showContextMarker) {
Rect bs = contextMarker.getDrawable().getBounds();
int dx = (int) (px - tb.getPixXFromLatLon(latLon.getLatitude(), latLon.getLongitude()));
int dy = (int) (py - tb.getPixYFromLatLon(latLon.getLatitude(), latLon.getLongitude()));
int bx = dx + bs.width() / 2;
int by = dy + bs.height();
return (bs.contains(bx, by));
}
return false;
}
public String getSelectedObjectName(){
return getSelectedObjectInfo(true);
}
@ -412,6 +426,11 @@ public class ContextMenuLayer extends OsmandMapLayer {
@Override
public boolean onSingleTap(PointF point, RotatedTileBox tileBox) {
if (pressedContextMarker(tileBox, point.x, point.y)) {
showMapContextMenu(latLon);
return true;
}
boolean nativeMode = (Build.VERSION.SDK_INT >= 14) || view.getSettings().SCROLL_MAP_BY_GESTURES.get();
int val = pressedInTextView(tileBox, point.x, point.y);
if(selectOnMap != null) {
@ -438,12 +457,11 @@ public class ContextMenuLayer extends OsmandMapLayer {
if (latLon != null) {
if (selectedObjects.size() == 1) {
setLocation(null, "");
Object selectedObj = selectedObjects.keySet().iterator().next();
showMapContextMenu(selectedObj, latLon);
} else {
String description = getSelectedObjectDescription();
setLocation(latLon, description);
view.refreshMap();
selectedObj = selectedObjects.keySet().iterator().next();
contextObject = selectedObjects.get(selectedObj);
showMapContextMenu(latLon);
} else if (selectedObjects.size() > 1) {
showContextMenuForSelectedObjects(latLon);
return true;
}
}
@ -467,30 +485,33 @@ public class ContextMenuLayer extends OsmandMapLayer {
builder.setItems(d, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Object selectedObj = s.get(which);
showMapContextMenu(selectedObj, l);
selectedObj = s.get(which);
contextObject = selectedObjects.get(selectedObj);
showMapContextMenu(l);
}
});
builder.show();
} else {
Object selectedObj = selectedObjects.keySet().iterator().next();
showMapContextMenu(selectedObj, l);
selectedObj = selectedObjects.keySet().iterator().next();
contextObject = selectedObjects.get(selectedObj);
showMapContextMenu(l);
}
}
private void showMapContextMenu(Object obj, LatLon latLon) {
private void showMapContextMenu(LatLon latLon) {
PointDescription pointDescription;
if (obj != null) {
pointDescription = selectedObjects.get(obj).getObjectName(obj);
pointDescription.setLat(latLon.getLatitude());
pointDescription.setLon(latLon.getLongitude());
if (selectedObj != null && contextObject != null) {
pointDescription = contextObject.getObjectName(selectedObj);
LatLon objLocation = contextObject.getObjectLocation(selectedObj);
pointDescription.setLat(objLocation.getLatitude());
pointDescription.setLon(objLocation.getLongitude());
} else {
pointDescription = new PointDescription(latLon.getLatitude(), latLon.getLongitude());
}
this.latLon = latLon;
this.latLon = new LatLon(pointDescription.getLat(), pointDescription.getLon());
showMapContextMenuMarker();
MapContextMenu.getInstance().show(pointDescription, obj);
MapContextMenu.getInstance().show(pointDescription, selectedObj);
}