Merge branch 'master' into app_profiles

# Conflicts:
#	OsmAnd/res/values/strings.xml
This commit is contained in:
madwasp79 2019-04-18 10:23:05 +03:00
commit 0d5fb3d0dc
29 changed files with 571 additions and 181 deletions

View file

@ -213,4 +213,8 @@
<string name="shared_string_appearance">Udseende</string>
<string name="show_gps_points">Vis GPX-punkter</string>
<string name="show_gps_points_descr">Vis antallet af indsamlede og sendte GPX-punkter.</string>
<string name="search_contacts">Søg efter kontaktpersoner</string>
<string name="search_contacts_descr">Søg på tværs af alle grupper og kontaktpersoner.</string>
<string name="type_contact_or_group_name">Skriv navnet på kontakt eller gruppe</string>
<string name="shared_string_search">Søg</string>
</resources>

View file

@ -32,4 +32,20 @@
style="@style/Widget.AppCompat.Button.Borderless"
tools:drawableTop="@drawable/ic_action_message"/>
<View
android:id="@+id/sendLogButtonDiv"
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="?attr/divider_color"/>
<Button
android:id="@+id/sendLogButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="@string/send_log"
style="@style/Widget.AppCompat.Button.Borderless"
tools:drawableTop="@drawable/ic_crashlog"/>
</LinearLayout>

View file

@ -1520,7 +1520,7 @@
<string name="poi_automated_no">No automatizado</string>
<string name="poi_full_service_yes">Servicio completo</string>
<string name="poi_aeroway_fuel">Estación de combustible para aviones;Gasolinera para aviones</string>
<string name="poi_public_bath">Baño público</string>
<string name="poi_public_bath">Baños públicos (termas)</string>
<string name="poi_male_yes">Masculino</string>
<string name="poi_male_no">Hombres: prohibido</string>
<string name="poi_female_yes">Femenino</string>

View file

@ -1520,7 +1520,7 @@
<string name="poi_automated_no">No automatizado</string>
<string name="poi_full_service_yes">Servicio completo</string>
<string name="poi_aeroway_fuel">Gasolinera para aviones;Estación de combustible para aviones</string>
<string name="poi_public_bath">Baño público</string>
<string name="poi_public_bath">Baños públicos (termas)</string>
<string name="poi_male_yes">Masculino</string>
<string name="poi_male_no">Hombres: prohibido</string>
<string name="poi_female_yes">Femenino</string>

View file

@ -1519,7 +1519,7 @@
<string name="poi_automated_no">No automatizado</string>
<string name="poi_full_service_yes">Servicio completo</string>
<string name="poi_aeroway_fuel">Gasolinera para aviones</string>
<string name="poi_public_bath">Baño público</string>
<string name="poi_public_bath">Baños públicos (termas)</string>
<string name="poi_male_yes">Masculino</string>
<string name="poi_male_no">Hombres: prohibido</string>
<string name="poi_female_yes">Femenino</string>

View file

@ -3531,4 +3531,33 @@
<string name="poi_rtsa_scale_3b_asterisk">3Б*</string>
<string name="poi_flare">フレアスタック(余剰ガス燃焼煙突)</string>
<string name="poi_change_delete">削除済みオブジェクト</string>
<string name="poi_climbing_summit_log_yes">サミットブック、登頂記録簿:有り</string>
<string name="poi_climbing_summit_log_no">サミットブック、登頂記録簿:無し</string>
<string name="poi_socket_chademo_output_high"></string>
<string name="poi_socket_chademo_output_medium"></string>
<string name="poi_socket_chademo_output_low"></string>
<string name="poi_socket_type2_output_high"></string>
<string name="poi_socket_type2_output_medium"></string>
<string name="poi_socket_type2_output_low"></string>
<string name="poi_socket_type2_combo_output_high"></string>
<string name="poi_socket_type2_combo_output_medium"></string>
<string name="poi_socket_type2_combo_output_low"></string>
<string name="poi_socket_type3_output_high"></string>
<string name="poi_socket_type3_output_medium"></string>
<string name="poi_socket_type3_output_low"></string>
<string name="poi_socket_cee_blue_output_high"></string>
<string name="poi_socket_cee_blue_output_medium"></string>
<string name="poi_socket_cee_blue_output_low"></string>
<string name="poi_socket_schuko_output_high"></string>
<string name="poi_socket_schuko_output_medium"></string>
<string name="poi_socket_schuko_output_low"></string>
<string name="poi_glacier_type_icecap">氷帽、氷冠</string>
<string name="poi_hazard">危険域</string>
<string name="poi_hazard_nuclear">核(放射線)危険域</string>
<string name="poi_hazard_erosion">浸食危険域</string>
<string name="poi_hazard_avalanche">雪崩危険域</string>
<string name="poi_hazard_slippery_road">滑りやすい路面</string>
<string name="poi_hazard_flood">洪水危険域</string>
<string name="poi_hazard_minefield">地雷、地雷原</string>
<string name="poi_ruins">廃墟(歴史的なものも含む)</string>
</resources>

View file

@ -3031,4 +3031,21 @@ POIの更新は利用できません</string>
<string name="rendering_attr_surface_compacted_name">砂利や土などの圧縮舗装</string>
<string name="routing_attr_avoid_sett_name">石畳や敷石の道を避ける</string>
<string name="routing_attr_avoid_sett_description">移動時に石畳や敷石の道を通らないようにします</string>
<string name="rendering_attr_smoothness_excellent_name">ローラーブレードやスケボーができる滑らかさ</string>
<string name="rendering_attr_smoothness_good_name">ロードバイクを含め車両全般が走行可能</string>
<string name="rendering_attr_smoothness_intermediate_name">シティバイク、スポーツカー、車椅子、スクーター及びオフロードバイクや車も走行可能</string>
<string name="rendering_attr_smoothness_bad_name">クロスバイク、普通車、人力車などなら走行可能</string>
<string name="rendering_attr_smoothness_very_bad_name">車高の高い車、軽装オフロード車なら走行可能</string>
<string name="rendering_attr_smoothness_horrible_name">重装備のオフロード車なら走行可能</string>
<string name="rendering_attr_smoothness_very_horrible_name">トラクター、ATV、戦車、MTBなど荒れた道でも問題無いもののみ走行可能</string>
<string name="rendering_attr_smoothness_impassable_name">2輪4輪問わず車両は走行不可能</string>
<string name="rendering_attr_highway_class_motorway_name">高速道路、自動車専用道路</string>
<string name="rendering_attr_highway_class_street_name">街路</string>
<string name="rendering_attr_highway_class_footway_name">歩道</string>
<string name="rendering_attr_highway_class_track_name">農業用道路、林道</string>
<string name="rendering_attr_highway_class_bridleway_name">馬道</string>
<string name="rendering_attr_highway_class_steps_name">階段、エスカレーター</string>
<string name="rendering_attr_highway_class_path_name">道(自動車以外のもの向け)</string>
<string name="rendering_attr_highway_class_cycleway_name">自転車道</string>
<string name="add_home">自宅の追加</string>
</resources>

View file

@ -534,7 +534,7 @@
<string name="speak_speed_limit">Fartsgrense</string>
<string name="speak_cameras">Fotobokser</string>
<string name="speak_traffic_warnings">Trafikkvarsler</string>
<string name="osb_author_or_password_not_specified">Oppgi OSM brukernavn og passord i \'Innstillinger\'</string>
<string name="osb_author_or_password_not_specified">Oppgi OSM-brukernavn og passord i \"Innstillinger\"</string>
<string name="clear_intermediate_points">Slett mellomliggende reisemål</string>
<string name="keep_intermediate_points">Behold mellomliggende reisemål</string>
<string name="new_directions_point_dialog">Mellomliggende reisemål er allerede angitt.</string>
@ -1486,7 +1486,7 @@
<string name="use_osm_live_routing">OsmAnd Live-navigering</string>
<string name="access_no_destination">Reisemål er ikke angitt</string>
<string name="access_shared_string_navigate_up">Naviger opp</string>
<string name="open_street_map_login_and_pass">OpenStreetMap brukernavn og passord</string>
<string name="open_street_map_login_and_pass">OpenStreetMap-brukernavn og passord</string>
<string name="osm_live_subscription">OsmAnd Live-abonnement</string>
<string name="osm_live_hide_user_name">Ikke vis mitt navn i rapporter</string>
<string name="osm_live_ask_for_purchase">Kjøp først et OsmAnd Live-abonnement</string>

View file

@ -58,7 +58,7 @@
<string name="shared_string_refresh">Atualizar</string>
<string name="general_settings_descr">Configure a exibição e configurações comuns para o app.</string>
<string name="general_settings">Configurações Gerais</string>
<string name="index_settings_descr">Descarregar e gerenciar ficheiros de mapas offline armazenados no seu dispositivo.</string>
<string name="index_settings_descr">Descarregar e gerenciar ficheiros de mapas offline armazenados no seu aparelho.</string>
<string name="index_settings">Gerir Ficheiros de mapa</string>
<string name="osmand_service">Modo de fundo</string>
<string name="osmand_service_descr">Executar o serviço de segundo plano para usar OsmAnd enquanto o ecrã está desligado.</string>
@ -83,50 +83,50 @@
<string name="phone">Telefone</string>
<string name="download_type_to_filter">Filtro</string>
<string name="use_high_res_maps">Mapa de alta resolução</string>
<string name="use_high_res_maps_descr">Utilizar mapas de alta resolução para dispositivos com alta densidade de ecrã.</string>
<string name="use_high_res_maps_descr">Utilizar mapas de alta resolução para aparelhos com alta densidade de ecrã.</string>
<string name="unknown_location">Posição atual desconhecida</string>
<string name="context_menu_item_search_transport">Pesquisar transportes públicos</string>
<string name="transport_searching_transport">Resultados de transporte (sem destino):</string>
<string name="transport_searching_route">Resultados de transporte ({0} para o destino):</string>
<string name="transport_search_again">Pesquisar transportes de novo</string>
<string name="voice">Vozes</string>
<string name="transport_search_again">Reinicializar pesquisa de transporte</string>
<string name="voice">Voz gravada</string>
<string name="no_vector_map_loaded">Nenhum mapa vetorial foi carregado</string>
<string name="gpx_option_reverse_route">Caminho reverso</string>
<string name="gpx_files_not_found">Nenhum ficheiro GPX encontrado na pasta tracks</string>
<string name="layer_gpx_layer">Rota GPX…</string>
<string name="error_reading_gpx">Erro na leitura de dados GPX</string>
<string name="layer_gpx_layer">Ficheiros GPX…</string>
<string name="error_reading_gpx">Não foi possível ler dados GPX</string>
<string name="vector_data">Mapas vetoriais offline</string>
<string name="transport_context_menu">Procurar transporte na parada</string>
<string name="poi_context_menu_modify">Modificar POI</string>
<string name="poi_context_menu_delete">Apagar POI</string>
<string name="rotate_map_compass_opt">Na direção da bússola</string>
<string name="rotate_map_bearing_opt">Na direção do movimento</string>
<string name="rotate_map_none_opt">Não girar</string>
<string name="rotate_map_to_bearing_descr">Define como o mapa deve ser girado</string>
<string name="rotate_map_compass_opt">Direção da bússola</string>
<string name="rotate_map_bearing_opt">Direção de movimento</string>
<string name="rotate_map_none_opt">Sem rotação (norte sempre para cima)</string>
<string name="rotate_map_to_bearing_descr">Selecione como o mapa deve ser girado.</string>
<string name="rotate_map_to_bearing">Rotação do mapa</string>
<string name="show_route">Mostrar rota</string>
<string name="fav_imported_sucessfully">Importação dos Favoritos bem sucedida</string>
<string name="fav_imported_sucessfully">Favoritos importados</string>
<string name="fav_file_to_load_not_found">O ficheiro GPX contendo os favoritos não foi encontrado em {0}</string>
<string name="fav_saved_sucessfully">Favoritos gravados com sucesso em {0}</string>
<string name="fav_saved_sucessfully">Favoritos gravados em {0}</string>
<string name="no_fav_to_save">Nenhum favorito para gravar</string>
<string name="shared_string_import">Importar</string>
<string name="error_occurred_loading_gpx">Erro ao carregar o ficheiro GPX</string>
<string name="send_report">Enviar o relatório</string>
<string name="none_region_found">Nenhuma região encontrada no cartão SD. Tente fazer o download a partir da Internet.</string>
<string name="poi_namefinder_query_empty">Parâmetros de pesquisa para encontrar o POI</string>
<string name="none_region_found">Não foi possível encontrar mapas descarregados no cartão de memória.</string>
<string name="poi_namefinder_query_empty">Digite para encontrar um POI</string>
<string name="any_poi">Todos</string>
<string name="thanks_yandex_traffic">Obrigado à Yandex por fornecer informações de trânsito.</string>
<string name="thanks_yandex_traffic">Obrigado ao Yandex pela informação de trânsito.</string>
<string name="layer_yandex_traffic">Tráfego Yandex</string>
<string name="layer_route">Rota</string>
<string name="shared_string_favorites">Favoritos</string>
<string name="layer_osm_bugs">Anotações OSM (on-line)</string>
<string name="layer_poi">POI (Ponto de interesse)</string>
<string name="layer_poi">Sobreposição de POI</string>
<string name="layer_map">Fonte dos mapas…</string>
<string name="menu_layers">Camada de mapa</string>
<string name="context_menu_item_search_poi">Encontre um Ponto de Interesse</string>
<string name="use_trackball_descr">Utilize o cursor para mover o mapa</string>
<string name="use_trackball_descr">Utilize um aparelho trackball para mover o mapa.</string>
<string name="use_trackball">Use o cursor</string>
<string name="background_service_wait_int_descr">Definir o tempo limite para determinar a localização</string>
<string name="background_service_wait_int_descr">Definir o tempo limite para determinar a localização.</string>
<string name="background_service_wait_int">Tempo de espera</string>
<string name="where_am_i">Onde estou?</string>
<string name="process_navigation_service">Serviço de navegação OsmAnd</string>
@ -134,12 +134,12 @@
<string name="gps_provider">GPS</string>
<string name="int_seconds">segundos</string>
<string name="int_min">min.</string>
<string name="background_service_int_descr">Escolha um intervalo de atualização da sua posição no serviço em segundo plano</string>
<string name="background_service_int_descr">Escolha um intervalo de atualização da sua posição no serviço em segundo plano.</string>
<string name="background_service_int">Intervalo de posição GPS</string>
<string name="background_service_provider_descr">Escolha um provedor de localização para o serviço em segundo plano</string>
<string name="background_service_provider_descr">Escolha um provedor de localização para o serviço em segundo plano.</string>
<string name="background_service_provider">Provedor de localização</string>
<string name="background_router_service_descr">Activar o serviço em segundo plano para monitorar sua posição por longos períodos</string>
<string name="background_router_service">Usar serviço em segundo plano</string>
<string name="background_router_service_descr">Rastreia a sua posição enquanto o ecrã está desligado.</string>
<string name="background_router_service">Executar OsmAnd em segundo plano</string>
<string name="off_router_service_no_gps_available">O serviço em segundo plano exige a ativação de alguma fonte de localização.</string>
<string name="routing_settings_descr">Especifique opções da rota.</string>
<string name="routing_settings">Navegação</string>
@ -154,8 +154,10 @@
<string name="voice_data_not_supported">Os dados de voz utilizam uma versão não suportada</string>
<string name="voice_data_corrupted">Dados de voz corrompidos</string>
<string name="voice_data_unavailable">Dados de voz selecionados não estão acessíveis</string>
<string name="sd_unmounted">O cartão SD está inacessível. \n Será impossível ver mapas ou procurar coisas.</string>
<string name="sd_mounted_ro">O cartão SD está disponível só para leitura. \nVocê não pode baixar da Internet, só pode visualizar os mapas pré-carregados.</string>
<string name="sd_unmounted">O cartão de memória está inacessível.
\nSerá impossível ver mapas ou procurar coisas.</string>
<string name="sd_mounted_ro">Cartão de memória está disponível só para leitura.
\nAgora só é possível ver o mapa pré-carregado, não descarregar novas áreas.</string>
<string name="unzipping_file">Descomprimindo ficheiro…</string>
<string name="route_tr">Virar à direita e continuar em frente</string>
<string name="route_tshr">Virar bruscamente à direita e continuar em frente</string>
@ -168,39 +170,39 @@
<string name="first_time_continue">Continuar</string>
<string name="first_time_download">Download de regiões</string>
<string name="first_time_msg">Obrigado por usar OsmAnd. Descarrege dados regionais para a utilização offline através de \'Configrações\' → \'Gerir ficheiros de mapas\' para visualizar mapas, localizar endereços, procurar POIs, encontrar transportes públicos e muito mais.</string>
<string name="search_poi_location">Procurando sinal…</string>
<string name="search_near_map">Procure perto do último local conhecido</string>
<string name="search_poi_location">Aguardando o sinal…</string>
<string name="search_near_map">Procurar perto do atual centro do mapa</string>
<string name="search_nearby">Busca nas proximidades</string>
<string name="map_orientation_default">Mesma do dispositivo</string>
<string name="map_orientation_default">Mesma do aparelho</string>
<string name="map_orientation_portrait">Retrato</string>
<string name="map_orientation_landscape">Paisagem</string>
<string name="map_screen_orientation">Orientação do mapa</string>
<string name="map_screen_orientation_descr">Retrato, paisagem ou dispositivo.</string>
<string name="opening_hours_not_supported">O formato do horário de abertura não é suportado para edição</string>
<string name="map_screen_orientation_descr">Retrato, paisagem ou aparelho.</string>
<string name="opening_hours_not_supported">O formato do horário de abertura não pode ser alterado</string>
<string name="add_new_rule">Adicionar uma nova regra</string>
<string name="transport_Routes">Rotas</string>
<string name="transport_Stop">Parada</string>
<string name="transport_stops">paradas</string>
<string name="transport_search_after">Pesquisa rota após</string>
<string name="transport_search_before">Pesquisa rota antes</string>
<string name="transport_search_after">Itinerário subsequente</string>
<string name="transport_search_before">Itinerário anterior</string>
<string name="transport_finish_search">Terminar a perquisa</string>
<string name="transport_stop_to_go_out">Escolha parada de saída</string>
<string name="transport_to_go_after">a percorrer após</string>
<string name="transport_to_go_before">a percorrer antes</string>
<string name="transport_stops_to_pass">paradas a passar</string>
<string name="transport_route_distance">Distância da viagem</string>
<string name="transport">Transportes</string>
<string name="transport_route_distance">Distância do itinerário</string>
<string name="transport">Transporte</string>
<string name="shared_string_ok">Ok</string>
<string name="show_transport_over_map_description">Ver as paradas de transportes públicos no mapa</string>
<string name="show_transport_over_map">Mostrar paradas de transportes</string>
<string name="show_transport_over_map_description">Ver as paradas de transportes públicos no mapa.</string>
<string name="show_transport_over_map">Mostrar paradas de transporte</string>
<string name="hello">Aplicação de navegação OsmAnd</string>
<string name="update_poi_success">Atualização com sucesso dos POI ({0} foram carregados)</string>
<string name="update_poi_error_local">Erro ao atualizar o índice local</string>
<string name="update_poi_error_loading">Erro ao carregar dados do servidor</string>
<string name="update_poi_success">Atualização dos dados de POI ({0} foram carregados)</string>
<string name="update_poi_error_local">Não foi possível atualizar a lista de POIs locais</string>
<string name="update_poi_error_loading">Não foi possível carregar dados do servidor</string>
<string name="update_poi_no_offline_poi_index">Não há dados offline para esta região</string>
<string name="update_poi_is_not_available_for_zoom">Atualização de pontos de interesse não está disponível para níveis de zoom pequenos</string>
<string name="update_poi_is_not_available_for_zoom">Ampliar o zoom permite-lhe actualizar os POIs</string>
<string name="context_menu_item_update_poi">Atualizar pontos de interesse</string>
<string name="context_menu_item_update_map_confirm">Atualizar dados do local via Internet?</string>
<string name="context_menu_item_update_map_confirm">Atualizar dados locais da Internet\?</string>
<string name="search_history_city">Cidade: {0}</string>
<string name="search_history_street">Rua: {0}, {1}</string>
<string name="search_history_int_streets">Interseção : {0} x {1} dans {2}</string>
@ -214,7 +216,7 @@
<string name="searching">Pesquisando…</string>
<string name="searching_address">Pesquisando endereço …</string>
<string name="search_osm_nominatim">Pesquisa on-line usando OSM Nominatim</string>
<string name="hint_search_online">Número, rua, cidade</string>
<string name="hint_search_online">Pesquisa online: Número da casa, rua, cidade</string>
<string name="search_offline_address">Offline</string>
<string name="search_online_address">Internet</string>
<string name="max_level_download_tile">Nível de zoom máx</string>
@ -405,14 +407,14 @@
<string name="online_map_settings_descr">Configurar fontes de mosaicos ou de mapas on-line.</string>
<string name="osmand_rastermaps_plugin_description">"Com este plugin, pode ter acesso a muitos tipos de mapas on-line (também chamada de quadrícula ou ladrilho), de quadrículas pré-definidas do OpenStreetMap (como Mapnik) para imagens de satélite e camadas especiais, como mapas aquáticos, climáticos, geológicos, camadas de sombra de relevo, etc.\n\nQuaisquer desses mapas podem ser usados como mapa principal (base) para ser mostrado no OsmAnd, ou como uma sobreposição, ou sub-camada para outro mapa base (como o mapa off-line normal de OsmAnd). Para fazer qualquer sub-camada do mapa mais visível, certos elementos do mapa vetorial do OsmAnd podem facilmente ser ocultados através do menu \'Configurar mapa\'.
\n\nQuadrículas de mapas podem ser obtidas diretamente através de fontes on-line ou podem ser preparados para uso off-line (e copiadas manualmente para o diretório de dados do OsmAnd) como um banco de dados sqlite, que pode ser produzido por uma variedade de ferramentas de terceiros para preparação de mapas. "</string>
<string name="osmand_background_plugin_description">Mostra as configurações para ativar o rastreamento em segundo plano e a navegação, despertando periodicamente o dispositivo GPS (com o ecrã desligado).</string>
<string name="osmand_accessibility_description">Este plugin torna os recursos de acessibilidade do dispositivo disponíveis diretamente no OsmAnd. Ele facilita, p. ex., o ajuste da velocidade de fala para vozes TTS, configurando a navegação no ecrã do teclado direcional, usando um trackball para controle de zoom, ou feedback texto-para-fala, por exemplo, para anunciar automaticamente a sua posição.</string>
<string name="osmand_background_plugin_description">Mostra as configurações para ativar o rastreamento em segundo plano e a navegação, despertando periodicamente o aparelho GPS (com o ecrã desligado).</string>
<string name="osmand_accessibility_description">Este plugin torna os recursos de acessibilidade do aparelho disponíveis diretamente no OsmAnd. Ele facilita, p. ex., o ajuste da velocidade de fala para vozes TTS, configurando a navegação no ecrã do teclado direcional, usando um trackball para controle de zoom, ou feedback texto-para-fala, por exemplo, para anunciar automaticamente a sua posição.</string>
<string name="osmand_development_plugin_description">Este plugin exibe configurações para recursos de desenvolvimento e depuração como testar ou simular roteamento, o desempenho de renderização do ecrã ou solicitação de voz. Essas configurações são destinadas a desenvolvedores e não são necessárias para o usuário geral.</string>
<string name="plugins_screen">Gerenciar plugins</string>
<string name="prefs_plugins_descr">Plugins activam as configurações avançadas e funcionalidades adicionais.</string>
<string name="prefs_plugins">Gerenciar plugins</string>
<string name="osm_editing_plugin_description">Este complemento do OsmAnd pode ser usado para fazer contribuições ao OSM como criar ou modificar POI, abertura ou comentários de erros do OSM e contribuir com ficheiros GPX gravados. OSM é um projeto de mapeamento mundial dirigido pela comunidade e de domínio público. Para mais detalhes, consulte https://openstreetmap.org. Participação ativa é apreciada e as contribuições podem ser feitas diretamente do OsmAnd, se você especificar suas credenciais pessoais de OSM no app.</string>
<string name="vector_maps_may_display_faster_on_some_devices">Mapas vectoriais são visualizados mais rápido. Podem não funcionar bem em alguns dispositivos.</string>
<string name="vector_maps_may_display_faster_on_some_devices">Mapas vectoriais são visualizados mais rápido. Podem não funcionar bem em alguns aparelhos.</string>
<string name="play_commands_of_currently_selected_voice">Selecione uma voz e teste reproduzindo os avisos</string>
<string name="debugging_and_development">Desenvolvimento OsmAnd</string>
<string name="native_rendering">Renderização nativa</string>
@ -482,7 +484,7 @@
<string name="use_fluorescent_overlays_descr">Use cores fluorescentes para exibir trajectos e rotas.</string>
<string name="offline_edition">Edição offline</string>
<string name="offline_edition_descr">Usar sempre a edição offline.</string>
<string name="update_poi_does_not_change_indexes">As alterações de PI dentro da aplicação não afectam os ficheiros de mapas descaaregados; em vez disso, as alterações são guardadas num ficheiro no seu dispositivo.</string>
<string name="update_poi_does_not_change_indexes">As alterações de PI dentro da aplicação não afectam os ficheiros de mapas descaaregados; em vez disso, as alterações são guardadas num ficheiro no seu aparelho.</string>
<string name="local_openstreetmap_uploading">A enviar…</string>
<string name="local_openstreetmap_were_uploaded">{0} POIs/Anotações enviados</string>
<string name="local_openstreetmap_uploadall">Enviar todos</string>
@ -523,7 +525,7 @@
<string name="download_files_not_enough_space">Espaço livre insuficiente, precisa de %1$s MB (só tem: %2$s disponíveis).</string>
<string name="download_files_question_space">Descarregar {0} ficheiro(s)\? O espaço de armazenamento usado é {1} MB. (O espaço disponível é {2} MB.)</string>
<string name="use_transparent_map_theme">Tema transparente</string>
<string name="native_library_not_supported">A biblioteca nativa não é compatível com este dispositivo.</string>
<string name="native_library_not_supported">A biblioteca nativa não é compatível com este aparelho.</string>
<string name="init_native_library">Inicializando biblioteca nativa…</string>
<string name="choose_auto_follow_route">Auto-centrar visualização do mapa</string>
<string name="choose_auto_follow_route_descr">Tempo até o mapa ser centrado na posição atual.</string>
@ -1409,7 +1411,7 @@
<string name="version_settings">Compilações</string>
<string name="navigation_over_track">Iniciar navegação através do trajeto?</string>
<string name="rendering_attr_transportStops_name">Parada de transporte</string>
<string name="use_opengl_render_descr">Usar a renderização OpenGL acelerada por hardware (pode usar mais bateria ou não funcionar em dispositivos muito antigos).</string>
<string name="use_opengl_render_descr">Usar a renderização OpenGL acelerada por hardware (pode usar mais bateria ou não funcionar em aparelhos muito antigos).</string>
<string name="wake_on_voice">Ligar o ecrã</string>
<string name="configure_map">Configurar mapa</string>
<string name="shared_string_waypoints">ponto de rota</string>
@ -1596,12 +1598,15 @@
<string name="plugin_touringview_descr">"Esta opção muda o estilo de mapa do Osmand para a \"visão Touring \', uma visão especial de alto detalhe, para viajantes e motoristas profissionais.\n\nEsta exibição fornece, em qualquer zoom de mapa, a quantidade máxima de informação de viagem disponível no mapa (particularmente estradas, trilhas, caminhos, e marcas de orientação).\n\nTambém separa claramente todos os tipos de estradas de forma inequívoca com um código de cores, que se revela útil para a condução de veículos grandes (por exemplo).\n\nOferece opções especiais de turismo, como mostrar ciclovias ou rotas alpinas de montanha.\n\nNão é necessário fazer download dum mapa especial, a exibição é feita a partir dos mapas padrão.\n\nEssa visão pode ser revertida, basta desactiva-la, ou alterar o estilo de mapa em \'Configurar mapa\'. "</string>
<string name="rendering_attr_roadStyle_description">Estilo de estrada</string>
<string name="error_avoid_specific_road">Nenhum desvio encontrado</string>
<string name="wake_on_voice_descr">Ligar o ecrã do dispositivo (se estiver desligado) ao aproximar a uma curva.</string>
<string name="wake_on_voice_descr">Ligar o ecrã do aparelho (se estiver desligado) ao aproximar a uma curva.</string>
<string name="map_widget_top">Barra de estado</string>
<string name="map_widget_right">Painel direito</string>
<string name="map_widget_left">Painel esquerdo</string>
<string name="search_radius_proximity">Dentro</string>
<string name="anonymous_user_hint">Um utilizador anónimo não pode:\n- Criar grupos;\n- Sincronizar grupos e dispositivos com o servidor;\n- Gerir grupos e dispositivos num painel de controle pessoal no sitio web.</string>
<string name="anonymous_user_hint">Um utilizador anónimo não pode:
\n- Criar grupos;
\n- Sincronizar grupos e dispositivos com o servidor;
\n- Gerir grupos e aparelhos num painel de controle pessoal no sitio web.</string>
<string name="anonymous_user">Utilizador anónimo</string>
<string name="logged_as">Ligado como %1$s</string>
<string name="shared_string_not_selected">Não seleccionado</string>
@ -2632,7 +2637,7 @@
\n• Avisar erros de dados
\n• Fazer upload de trilhas GPX para o OSM diretamente do app
\n• Adicionar POIs e fazer o upload diretamente para OSM (ou mais tarde se off-line)
\n• Gravação de viagem opcional também em modo background (enquanto o dispositivo está no modo sleep)
\n• Gravação de viagem opcional também em modo background (enquanto o aparelho está no modo sleep)
\nOsmAnd é um software de código aberto desenvolvido ativamente. Todos podem contribuir para o app, reportando bugs, melhorando as traduções ou programando novas funcionalidades. Além disso, o projeto conta com contribuições financeiras para financiar o desenvolvimento e testes de novas funcionalidades.
\n</string>
<string name="osmand_plus_extended_description_part8">Cobertura de mapa e qualidade aproximada:

View file

@ -3456,5 +3456,6 @@
<string name="poi_rtsa_scale_filter">Категория сложности</string>
<string name="poi_flare">Газовый факел</string>
<string name="poi_rescue_box">Спасательный ящик</string>
</resources>

View file

@ -1160,7 +1160,7 @@
<string name="settings_privacy">隐私</string>
<string name="proxy_pref_title">代理</string>
<string name="voice_pref_title">语音</string>
<string name="quick_action_navigation_voice_on">语音已开启</string>
<string name="quick_action_navigation_voice_on">语音静音</string>
<string name="interrupt_music">暂停音乐</string>
<string name="interrupt_music_descr">在语音提示时完全暂停音乐播放(不仅仅是降低其音量)</string>
<string name="select_voice_provider_descr">为您的语言选择或下载语音指引</string>
@ -2242,7 +2242,7 @@
<string name="quick_action_take_photo_note">设置图片注释</string>
<string name="quick_action_add_osm_bug">添加 OSM 注解</string>
<string name="quick_action_navigation_voice">打开关闭声音</string>
<string name="quick_action_navigation_voice_off">语音已关闭</string>
<string name="quick_action_navigation_voice_off">语音开启</string>
<string name="quick_action_add_gpx">添加 GPX 地标</string>
<string name="quick_action_add_parking">添加停车场</string>
<string name="quick_action_new_action">添加动作</string>
@ -2263,7 +2263,7 @@
<string name="quick_action_add_parking_descr">轻触动作按钮将会在屏幕中心的位置增加一个停车场。</string>
<string name="quick_action_interim_dialog">显示一个临时的对话框</string>
<string name="favorite_autofill_toast_text">" 保存到 "</string>
<string name="favorite_empty_place_name"></string>
<string name="favorite_empty_place_name"></string>
<string name="quick_action_duplicates">指定的快速动作已经在使用中,已更名为 %1$s以避免重复。</string>
<string name="quick_action_duplicate">快速动作名称重复</string>
<string name="quick_action_showhide_favorites_descr">轻触动作按钮将会在地图上显示或隐收藏夹标点。</string>
@ -2282,7 +2282,7 @@
<string name="quick_action_bug_descr">此消息将会自动填写注释字段。</string>
<string name="quick_action_bug_message">消息</string>
<string name="quick_action_category_descr">选择要保存收藏夹中的类别</string>
<string name="quick_action_gpx_category_descr">选择可选类别</string>
<string name="quick_action_gpx_category_descr">选择一个可选类别</string>
<string name="quick_action_poi_list">POI 列表</string>
<string name="quick_action_sh_poi_descr">您可以添加一个或多个要显示在地图上的 POI 类别。</string>
<string name="quick_action_page_list_descr">轻触动作按钮会直达下面的清单。</string>
@ -2567,4 +2567,8 @@
<string name="add_intermediate">添加中继点</string>
<string name="route_add_start_point">添加起始点</string>
<string name="route_descr_select_start_point">选择起始点</string>
<string name="quick_action_switch_day_mode">日间模式</string>
<string name="quick_action_switch_night_mode">夜间模式</string>
<string name="quick_action_day_night_switch_mode">切换日间/夜间模式</string>
<string name="download_wiki_region_placeholder">此地区</string>
</resources>

View file

@ -3935,4 +3935,6 @@
<string name="poi_flare">Gas flare;Flare stack</string>
<string name="poi_change_delete">Deleted object</string>
<string name="poi_rescue_box">Rescue box</string>
</resources>

View file

@ -11,8 +11,7 @@
Thx - Hardy
-->
-->
<string name="send_log">Send log</string>
<string name="osmand_default_routing">OsmAnd routing</string>
<string name="application_profiles_descr">Select the profiles to be visible in the app.</string>
<string name="application_profiles">Application profiles</string>

View file

@ -23,6 +23,7 @@ import android.widget.ProgressBar;
import android.widget.SeekBar;
import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
import net.osmand.plus.activities.HelpActivity;
import net.osmand.plus.activities.actions.AppModeDialog;
@ -31,6 +32,7 @@ import net.osmand.plus.dialogs.HelpArticleDialogFragment;
import org.apache.commons.logging.Log;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
@ -208,6 +210,26 @@ public class ContextMenuAdapter {
}
}
});
File logFile = app.getAppPath(OsmandApplication.EXCEPTION_PATH);
View sendLogButtonDiv = convertView.findViewById(R.id.sendLogButtonDiv);
TextView sendLogButton = (TextView) convertView.findViewById(R.id.sendLogButton);
if (logFile.exists()) {
Drawable sendLogIcon =
app.getUIUtilities().getThemedIcon(R.drawable.ic_crashlog);
sendLogButton.setCompoundDrawablesWithIntrinsicBounds(null, sendLogIcon, null, null);
sendLogButton.setCompoundDrawablePadding(AndroidUtils.dpToPx(app, 8f));
sendLogButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
app.sendCrashLog();
}
});
sendLogButtonDiv.setVisibility(View.VISIBLE);
sendLogButton.setVisibility(View.VISIBLE);
} else {
sendLogButtonDiv.setVisibility(View.GONE);
sendLogButton.setVisibility(View.GONE);
}
return convertView;
}

View file

@ -9,6 +9,7 @@ import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.os.AsyncTask;
@ -26,6 +27,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.CallbackWithObject;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
@ -45,6 +47,8 @@ import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.api.SQLiteAPI;
import net.osmand.plus.api.SQLiteAPIImpl;
import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.dashboard.DashErrorFragment;
import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.helpers.AvoidSpecificRoads;
@ -82,7 +86,7 @@ import btools.routingapp.BRouterServiceConnection;
import btools.routingapp.IBRouterService;
public class OsmandApplication extends MultiDexApplication {
public static final String EXCEPTION_PATH = "exception.log"; //$NON-NLS-1$
public static final String EXCEPTION_PATH = "exception.log";
private static final org.apache.commons.logging.Log LOG = PlatformUtil.getLog(OsmandApplication.class);
private static final String SHOW_PLUS_VERSION_INAPP_PARAM = "show_plus_version_inapp";
@ -618,12 +622,12 @@ public class OsmandApplication extends MultiDexApplication {
StringBuilder msg = new StringBuilder();
msg.append("Version ")
.append(Version.getFullVersion(OsmandApplication.this))
.append("\n") //$NON-NLS-1$
.append("\n")
.append(DateFormat.format("dd.MM.yyyy h:mm:ss", System.currentTimeMillis()));
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0);
if (info != null) {
msg.append("\nApk Version : ").append(info.versionName).append(" ").append(info.versionCode); //$NON-NLS-1$ //$NON-NLS-2$
msg.append("\nApk Version : ").append(info.versionName).append(" ").append(info.versionCode);
}
} catch (Throwable e) {
}
@ -650,7 +654,7 @@ public class OsmandApplication extends MultiDexApplication {
defaultHandler.uncaughtException(thread, ex);
} catch (Exception e) {
// swallow all exceptions
android.util.Log.e(PlatformUtil.TAG, "Exception while handle other exception", e); //$NON-NLS-1$
android.util.Log.e(PlatformUtil.TAG, "Exception while handle other exception", e);
}
}
@ -1032,4 +1036,32 @@ public class OsmandApplication extends MultiDexApplication {
public MapViewTrackingUtilities getMapViewTrackingUtilities() {
return mapViewTrackingUtilities;
}
public void sendCrashLog() {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"crash@osmand.net"});
File file = getAppPath(OsmandApplication.EXCEPTION_PATH);
intent.putExtra(Intent.EXTRA_STREAM, AndroidUtils.getUriForFile(this, file));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("vnd.android.cursor.dir/email");
intent.putExtra(Intent.EXTRA_SUBJECT, "OsmAnd bug");
StringBuilder text = new StringBuilder();
text.append("\nDevice : ").append(Build.DEVICE);
text.append("\nBrand : ").append(Build.BRAND);
text.append("\nModel : ").append(Build.MODEL);
text.append("\nProduct : ").append(Build.PRODUCT);
text.append("\nBuild : ").append(Build.DISPLAY);
text.append("\nVersion : ").append(Build.VERSION.RELEASE);
text.append("\nApp Version : ").append(Version.getAppName(this));
try {
PackageInfo info = getPackageManager().getPackageInfo(getPackageName(), 0);
if (info != null) {
text.append("\nApk Version : ").append(info.versionName).append(" ").append(info.versionCode);
}
} catch (PackageManager.NameNotFoundException e) {
PlatformUtil.getLog(ErrorBottomSheetDialog.class).error("", e);
}
intent.putExtra(Intent.EXTRA_TEXT, text.toString());
startActivity(Intent.createChooser(intent, getString(R.string.send_report)));
}
}

View file

@ -58,32 +58,7 @@ public class DashErrorFragment extends DashBaseFragment {
errorBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"crash@osmand.net"}); //$NON-NLS-1$
File file = getMyApplication().getAppPath(OsmandApplication.EXCEPTION_PATH);
intent.putExtra(Intent.EXTRA_STREAM, AndroidUtils.getUriForFile(getMyApplication(),file));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("vnd.android.cursor.dir/email"); //$NON-NLS-1$
intent.putExtra(Intent.EXTRA_SUBJECT, "OsmAnd bug"); //$NON-NLS-1$
StringBuilder text = new StringBuilder();
text.append("\nDevice : ").append(Build.DEVICE); //$NON-NLS-1$
text.append("\nBrand : ").append(Build.BRAND); //$NON-NLS-1$
text.append("\nModel : ").append(Build.MODEL); //$NON-NLS-1$
text.append("\nProduct : ").append(Build.PRODUCT); //$NON-NLS-1$
text.append("\nBuild : ").append(Build.DISPLAY); //$NON-NLS-1$
text.append("\nVersion : ").append(Build.VERSION.RELEASE); //$NON-NLS-1$
text.append("\nApp Version : ").append(Version.getAppName(getMyApplication())); //$NON-NLS-1$
try {
PackageInfo info = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(),
0);
if (info != null) {
text.append("\nApk Version : ").append(info.versionName).append(" ").append(info.versionCode); //$NON-NLS-1$ //$NON-NLS-2$
}
} catch (PackageManager.NameNotFoundException e) {
PlatformUtil.getLog(DashErrorFragment.class).error("", e);
}
intent.putExtra(Intent.EXTRA_TEXT, text.toString());
startActivity(Intent.createChooser(intent, getString(R.string.send_report)));
getMyApplication().sendCrashLog();
}
});

View file

@ -1,12 +1,10 @@
package net.osmand.plus.dialogs;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -14,29 +12,27 @@ import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandActionBarActivity;
import net.osmand.plus.base.BottomSheetDialogFragment;
import net.osmand.plus.helpers.FontCache;
import java.io.File;
import java.text.MessageFormat;
public class ErrorBottomSheetDialog extends BottomSheetDialogFragment {
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_error_fragment, container, false);
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
FragmentActivity activity = requireActivity();
OsmandApplication app = (OsmandApplication) activity.getApplication();
View view = activity.getLayoutInflater().inflate(R.layout.dash_error_fragment, container, false);
String msg = MessageFormat.format(getString(R.string.previous_run_crashed), OsmandApplication.EXCEPTION_PATH);
Typeface typeface = FontCache.getRobotoMedium(getActivity());
Typeface typeface = FontCache.getRobotoMedium(activity);
ImageView iv = ((ImageView) view.findViewById(R.id.error_icon));
iv.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_crashlog));
iv.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_crashlog));
TextView message = ((TextView) view.findViewById(R.id.error_header));
message.setTypeface(typeface);
message.setText(msg);
@ -45,32 +41,10 @@ public class ErrorBottomSheetDialog extends BottomSheetDialogFragment {
errorBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"crash@osmand.net"}); //$NON-NLS-1$
File file = getMyApplication().getAppPath(OsmandApplication.EXCEPTION_PATH);
intent.putExtra(Intent.EXTRA_STREAM, AndroidUtils.getUriForFile(getMyApplication(), file));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.setType("vnd.android.cursor.dir/email"); //$NON-NLS-1$
intent.putExtra(Intent.EXTRA_SUBJECT, "OsmAnd bug"); //$NON-NLS-1$
StringBuilder text = new StringBuilder();
text.append("\nDevice : ").append(Build.DEVICE); //$NON-NLS-1$
text.append("\nBrand : ").append(Build.BRAND); //$NON-NLS-1$
text.append("\nModel : ").append(Build.MODEL); //$NON-NLS-1$
text.append("\nProduct : ").append(Build.PRODUCT); //$NON-NLS-1$
text.append("\nBuild : ").append(Build.DISPLAY); //$NON-NLS-1$
text.append("\nVersion : ").append(Build.VERSION.RELEASE); //$NON-NLS-1$
text.append("\nApp Version : ").append(Version.getAppName(getMyApplication())); //$NON-NLS-1$
try {
PackageInfo info = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(),
0);
if (info != null) {
text.append("\nApk Version : ").append(info.versionName).append(" ").append(info.versionCode); //$NON-NLS-1$ //$NON-NLS-2$
OsmandApplication app = getMyApplication();
if (app != null) {
app.sendCrashLog();
}
} catch (PackageManager.NameNotFoundException e) {
PlatformUtil.getLog(ErrorBottomSheetDialog.class).error("", e);
}
intent.putExtra(Intent.EXTRA_TEXT, text.toString());
startActivity(Intent.createChooser(intent, getString(R.string.send_report)));
dismiss();
}
});

View file

@ -51,7 +51,6 @@ public class PerformLiveUpdateAsyncTask
final OsmandApplication myApplication = getMyApplication();
OsmandSettings.CommonPreference<Long> lastCheckPreference =
LiveUpdatesHelper.preferenceLastCheck(localIndexFileName, myApplication.getSettings());
LOG.debug(String.format("Last update check for %1s -> %2$d, current check time: %3$d", localIndexFileName, lastCheckPreference.get(), System.currentTimeMillis()));
lastCheckPreference.set(System.currentTimeMillis());
}
@ -92,7 +91,6 @@ public class PerformLiveUpdateAsyncTask
iu.timestamp, iu.sizeText, iu.contentSize,
iu.containerSize, DownloadActivityType.LIVE_UPDATES_FILE);
itemsToDownload.add(indexItem);
LOG.debug(String.format("Filename %1$s -> server timestamp: %2$s, content size: %3$s", iu.fileName, iu.timestamp, iu.contentSize));
}
DownloadIndexesThread downloadThread = application.getDownloadThread();
if (context instanceof DownloadIndexesThread.DownloadEvents) {

View file

@ -363,7 +363,7 @@ public class TrackDetailsMenu {
}
}
private void refreshChart(LineChart chart, boolean forceFit) {
public void refreshChart(LineChart chart, boolean forceFit) {
MapActivity mapActivity = getMapActivity();
GpxDisplayItem gpxItem = getGpxItem();
if (mapActivity == null || gpxItem == null) {
@ -724,7 +724,7 @@ public class TrackDetailsMenu {
}
}
public class TrackChartPoints {
public static class TrackChartPoints {
private List<WptPt> xAxisPoints;
private LatLon highlightedPoint;
private int segmentColor;

View file

@ -1,5 +1,7 @@
package net.osmand.plus.resources;
import android.view.LayoutInflater;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
import net.osmand.binary.BinaryMapIndexReader;
@ -7,6 +9,7 @@ import net.osmand.osm.io.NetworkUtils;
import net.osmand.plus.R;
import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@ -24,7 +27,7 @@ import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
public class IncrementalChangesManager {
private static final Log LOG = PlatformUtil.getLog(IncrementalChangesManager.class);
private static final String URL = "https://osmand.net/check_live";
private static final org.apache.commons.logging.Log log = PlatformUtil.getLog(IncrementalChangesManager.class);
private ResourceManager resourceManager;
@ -291,13 +294,14 @@ public class IncrementalChangesManager {
@Override
public String toString() {
return "Update " + fileName + " " + sizeText + " MB " + date;
return "Update " + fileName + " " + sizeText + " MB " + date + ", timestamp: " + timestamp;
}
}
private List<IncrementalUpdate> getIncrementalUpdates(String file, long timestamp) throws IOException,
XmlPullParserException {
String url = URL + "?aosmc=true&timestamp=" + timestamp + "&file=" + URLEncoder.encode(file);
LOG.debug(String.format("getIncrementalUpdates(): URL => %s", url)); //todo delete
HttpURLConnection conn = NetworkUtils.getHttpURLConnection(url);
conn.setUseCaches(false);
XmlPullParser parser = PlatformUtil.newXMLPullParser();
@ -313,10 +317,12 @@ public class IncrementalChangesManager {
dt.sizeText = parser.getAttributeValue("", "size");
dt.timestamp = Long.parseLong(parser.getAttributeValue("", "timestamp"));
dt.fileName = parser.getAttributeValue("", "name");
LOG.debug(String.format("getIncrementalUpdates(): update => %s", dt.toString())); //todo delete
lst.add(dt);
}
}
}
LOG.debug(String.format("getIncrementalUpdates(): list size => %s", lst.size())); //todo delete
return lst;
}

View file

@ -2029,17 +2029,4 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
showMenu = true;
showMenuState = menuState;
}
public enum PermanentAppModeOptions {
CAR(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY),
BICYCLE(MuteSoundRoutingParameter.KEY, DRIVING_STYLE, GeneralRouter.USE_HEIGHT_OBSTACLES),
PEDESTRIAN(MuteSoundRoutingParameter.KEY, GeneralRouter.USE_HEIGHT_OBSTACLES);
List<String> routingParameters;
PermanentAppModeOptions(String... routingParameters) {
this.routingParameters = Arrays.asList(routingParameters);
}
}
}

View file

@ -1,5 +1,6 @@
package net.osmand.plus.routepreparationmenu;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
@ -20,13 +21,18 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.github.mikephil.charting.charts.HorizontalBarChart;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.listener.ChartTouchListener;
import net.osmand.AndroidUtils;
import net.osmand.GPXUtilities.GPXFile;
@ -57,9 +63,11 @@ import net.osmand.plus.helpers.GpxUiHelper.GPXDataSetType;
import net.osmand.plus.helpers.GpxUiHelper.OrderedLineDataSet;
import net.osmand.plus.mapcontextmenu.InterceptorLinearLayout;
import net.osmand.plus.mapcontextmenu.MenuBuilder.CollapsableView;
import net.osmand.plus.mapcontextmenu.other.TrackDetailsMenu;
import net.osmand.plus.render.MapRenderRepositories;
import net.osmand.plus.routepreparationmenu.cards.BaseCard;
import net.osmand.plus.routepreparationmenu.cards.BaseCard.CardListener;
import net.osmand.plus.routepreparationmenu.cards.CardChartListener;
import net.osmand.plus.routepreparationmenu.cards.PublicTransportCard;
import net.osmand.plus.routepreparationmenu.cards.PublicTransportCard.PublicTransportCardListener;
import net.osmand.plus.routepreparationmenu.cards.RouteDirectionsCard;
@ -86,7 +94,7 @@ import java.util.ArrayList;
import java.util.List;
public class RouteDetailsFragment extends ContextMenuFragment implements PublicTransportCardListener,
CardListener {
CardListener, CardChartListener {
public static final String ROUTE_ID_KEY = "route_id_key";
private static final float PAGE_MARGIN = 5f;
@ -106,6 +114,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
@Nullable
private PublicTransportCard transportCard;
private RouteDetailsFragmentListener routeDetailsListener;
private RouteStatisticCard statisticCard;
private List<RouteInfoCard> routeInfoCards = new ArrayList<>();
private TrackDetailsMenu trackDetailsMenu;
public interface RouteDetailsFragmentListener {
void onNavigationRequested();
@ -171,6 +182,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
MapActivity mapActivity = getMapActivity();
if (mapActivity != null && isPortrait()) {
mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(View.GONE);
if (trackDetailsMenu != null) {
trackDetailsMenu.setMapActivity(mapActivity);
}
}
}
@ -179,6 +193,9 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
MapActivity mapActivity = getMapActivity();
if (mapActivity != null && isPortrait()) {
mapActivity.findViewById(R.id.bottom_controls_container).setVisibility(View.VISIBLE);
if (trackDetailsMenu != null) {
trackDetailsMenu.setMapActivity(null);
}
}
super.onPause();
}
@ -295,7 +312,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
return;
}
OsmandApplication app = mapActivity.getMyApplication();
RouteStatisticCard statisticCard = new RouteStatisticCard(mapActivity, gpx, new View.OnTouchListener() {
statisticCard = new RouteStatisticCard(mapActivity, gpx, new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
InterceptorLinearLayout mainView = getMainView();
@ -312,6 +329,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
});
statisticCard.setTransparentBackground(true);
statisticCard.setListener(this);
statisticCard.setChartListener(this);
menuCards.add(statisticCard);
cardsContainer.addView(statisticCard.build(mapActivity));
buildRowDivider(cardsContainer, false);
@ -346,6 +364,16 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
addRouteCard(cardsContainer, routeSmoothnessCard);
}
}
trackDetailsMenu = new TrackDetailsMenu();
GpxDisplayItem gpxItem = statisticCard.getGpxItem();
if (gpxItem != null) {
trackDetailsMenu.setGpxItem(gpxItem);
}
trackDetailsMenu.setMapActivity(mapActivity);
LineChart chart = statisticCard.getChart();
if (chart != null) {
trackDetailsMenu.refreshChart(chart, true);
}
}
private void createRouteDirectionsCard(LinearLayout cardsContainer) {
@ -361,12 +389,39 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
buildRowDivider(cardsContainer, false);
}
private void addRouteCard(LinearLayout cardsContainer, RouteInfoCard routeInfoCard) {
private OnTouchListener getChartTouchListener() {
return new OnTouchListener() {
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent ev) {
if (ev.getSource() != 0) {
for (RouteInfoCard card : routeInfoCards) {
final HorizontalBarChart ch = card.getChart();
if (ch != null && v instanceof HorizontalBarChart && ch != v) {
final MotionEvent event = MotionEvent.obtainNoHistory(ev);
event.setSource(0);
ch.dispatchTouchEvent(event);
}
}
}
return false;
}
};
}
@SuppressLint("ClickableViewAccessibility")
private void addRouteCard(final LinearLayout cardsContainer, RouteInfoCard routeInfoCard) {
OsmandApplication app = requireMyApplication();
menuCards.add(routeInfoCard);
routeInfoCard.setListener(this);
cardsContainer.addView(routeInfoCard.build(app));
buildRowDivider(cardsContainer, false);
routeInfoCards.add(routeInfoCard);
HorizontalBarChart chart = routeInfoCard.getChart();
if (chart != null) {
chart.setOnTouchListener(getChartTouchListener());
}
}
public Drawable getCollapseIcon(boolean collapsed) {
@ -542,7 +597,7 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
TargetPointsHelper targetPointsHelper = app.getTargetPointsHelper();
TargetPoint startPoint = targetPointsHelper.getPointToStart();
TargetPoint endPoint = targetPointsHelper.getPointToNavigate();
int[] startTime = { 0 };
int[] startTime = {0};
List<TransportRouteResultSegment> segments = routeResult.getSegments();
for (int i = 0; i < segments.size(); i++) {
boolean first = i == 0;
@ -1543,7 +1598,6 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
@Override
public void onCardPressed(@NonNull BaseCard card) {
}
@Override
@ -1567,6 +1621,62 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
}
private void refreshChart() {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null && trackDetailsMenu != null && statisticCard != null) {
LineChart chart = statisticCard.getChart();
if (chart != null) {
trackDetailsMenu.refreshChart(chart, false);
mapActivity.refreshMap();
}
}
}
@Override
public void onValueSelected(BaseCard card, Entry e, Highlight h) {
refreshChart();
}
@Override
public void onNothingSelected(BaseCard card) {
}
@Override
public void onChartGestureStart(BaseCard card, MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture) {
}
@Override
public void onChartGestureEnd(BaseCard card, MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture) {
}
@Override
public void onChartLongPressed(BaseCard card, MotionEvent me) {
}
@Override
public void onChartDoubleTapped(BaseCard card, MotionEvent me) {
}
@Override
public void onChartSingleTapped(BaseCard card, MotionEvent me) {
}
@Override
public void onChartFling(BaseCard card, MotionEvent me1, MotionEvent me2, float velocityX,
float velocityY) {
}
@Override
public void onChartScale(BaseCard card, MotionEvent me, float scaleX, float scaleY) {
}
@Override
public void onChartTranslate(BaseCard card, Highlight h, MotionEvent me, float dX, float dY) {
if (h != null) {
refreshChart();
}
}
public static class CumulativeInfo {
public int distance;
public int time;
@ -1577,7 +1687,8 @@ public class RouteDetailsFragment extends ContextMenuFragment implements PublicT
}
}
public static CumulativeInfo getRouteDirectionCumulativeInfo(int position, List<RouteDirectionInfo> routeDirections) {
public static CumulativeInfo getRouteDirectionCumulativeInfo(int position, List<
RouteDirectionInfo> routeDirections) {
CumulativeInfo cumulativeInfo = new CumulativeInfo();
if (position >= routeDirections.size()) {
return cumulativeInfo;

View file

@ -31,8 +31,8 @@ import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerStartItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.development.OsmandDevelopmentPlugin;
import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.AvoidRoadsRoutingParameter;
import net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.AvoidPTTypesRoutingParameter;
import net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.AvoidRoadsRoutingParameter;
import net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.DividerItem;
import net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.GpxLocalRoutingParameter;
import net.osmand.plus.routepreparationmenu.RoutingOptionsHelper.LocalRoutingParameter;
@ -46,7 +46,6 @@ import net.osmand.plus.routing.RoutingHelper;
import net.osmand.router.GeneralRouter;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -354,7 +353,7 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
}
private List<LocalRoutingParameter> getRoutingParameters(ApplicationMode applicationMode) {
List<String> routingParameters = new ArrayList<>();
List<String> routingParameters;
if (applicationMode.isDerivedRoutingFrom(ApplicationMode.CAR)) {
routingParameters = AppModeOptions.CAR.routingParameters;
} else if (applicationMode.isDerivedRoutingFrom(ApplicationMode.BICYCLE)) {
@ -483,8 +482,8 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
OtherSettingsRoutingParameter.KEY,
RouteSimulationItem.KEY),
PUBLIC_TRANSPORT(// MuteSoundRoutingParameter.KEY,
// DividerItem.KEY,
PUBLIC_TRANSPORT(MuteSoundRoutingParameter.KEY,
DividerItem.KEY,
AvoidPTTypesRoutingParameter.KEY,
// ShowAlongTheRouteItem.KEY,
// DividerItem.KEY,

View file

@ -44,6 +44,7 @@ import net.osmand.util.MapUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.List;
@ -66,9 +67,20 @@ public class RoutingOptionsHelper {
app = application;
settings = app.getSettings();
modes.put(ApplicationMode.CAR, new RouteMenuAppModes(ApplicationMode.CAR, getRoutingParameters(ApplicationMode.CAR, MapRouteInfoMenu.PermanentAppModeOptions.CAR.routingParameters)));
modes.put(ApplicationMode.BICYCLE, new RouteMenuAppModes(ApplicationMode.BICYCLE, getRoutingParameters(ApplicationMode.BICYCLE, MapRouteInfoMenu.PermanentAppModeOptions.BICYCLE.routingParameters)));
modes.put(ApplicationMode.PEDESTRIAN, new RouteMenuAppModes(ApplicationMode.PEDESTRIAN, getRoutingParameters(ApplicationMode.PEDESTRIAN, MapRouteInfoMenu.PermanentAppModeOptions.PEDESTRIAN.routingParameters)));
addRouteMenuAppModes(ApplicationMode.CAR, PermanentAppModeOptions.CAR.routingParameters);
addRouteMenuAppModes(ApplicationMode.BICYCLE, PermanentAppModeOptions.BICYCLE.routingParameters);
addRouteMenuAppModes(ApplicationMode.PEDESTRIAN, PermanentAppModeOptions.PEDESTRIAN.routingParameters);
addRouteMenuAppModes(ApplicationMode.PUBLIC_TRANSPORT, PermanentAppModeOptions.PUBLIC_TRANSPORT.routingParameters);
addRouteMenuAppModes(ApplicationMode.BOAT, PermanentAppModeOptions.BOAT.routingParameters);
addRouteMenuAppModes(ApplicationMode.AIRCRAFT, PermanentAppModeOptions.AIRCAFT.routingParameters);
addRouteMenuAppModes(ApplicationMode.HIKING, PermanentAppModeOptions.HIKING.routingParameters);
addRouteMenuAppModes(ApplicationMode.MOTORCYCLE, PermanentAppModeOptions.MOTORCYCLE.routingParameters);
addRouteMenuAppModes(ApplicationMode.TRUCK, PermanentAppModeOptions.TRUCK.routingParameters);
addRouteMenuAppModes(ApplicationMode.TRAIN, PermanentAppModeOptions.TRAIN.routingParameters);
}
private void addRouteMenuAppModes(ApplicationMode am, List<String> routingParameters) {
modes.put(am, new RouteMenuAppModes(am, getRoutingParameters(am, routingParameters)));
}
public void addNewRouteMenuParameter(ApplicationMode applicationMode, LocalRoutingParameter parameter) {
@ -951,4 +963,24 @@ public class RoutingOptionsHelper {
return false;
}
}
public enum PermanentAppModeOptions {
CAR(MuteSoundRoutingParameter.KEY, AvoidRoadsRoutingParameter.KEY),
BICYCLE(MuteSoundRoutingParameter.KEY, DRIVING_STYLE, GeneralRouter.USE_HEIGHT_OBSTACLES),
PEDESTRIAN(MuteSoundRoutingParameter.KEY, GeneralRouter.USE_HEIGHT_OBSTACLES),
PUBLIC_TRANSPORT(MuteSoundRoutingParameter.KEY),
BOAT(MuteSoundRoutingParameter.KEY),
AIRCAFT(MuteSoundRoutingParameter.KEY),
HIKING(MuteSoundRoutingParameter.KEY),
MOTORCYCLE(MuteSoundRoutingParameter.KEY),
TRUCK(MuteSoundRoutingParameter.KEY),
TRAIN(MuteSoundRoutingParameter.KEY);
List<String> routingParameters;
PermanentAppModeOptions(String... routingParameters) {
this.routingParameters = Arrays.asList(routingParameters);
}
}
}

View file

@ -6,6 +6,7 @@ import android.support.annotation.ColorInt;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@ -29,6 +30,7 @@ public abstract class BaseCard {
protected boolean nightMode;
private CardListener listener;
private CardChartListener chartListener;
public interface CardListener {
void onCardLayoutNeeded(@NonNull BaseCard card);
@ -44,6 +46,11 @@ public abstract class BaseCard {
public abstract int getCardLayoutId();
@Nullable
public View getView() {
return view;
}
public int getViewHeight() {
return view != null ? view.getHeight() : 0;
}
@ -66,6 +73,14 @@ public abstract class BaseCard {
this.listener = listener;
}
public CardChartListener getChartListener() {
return chartListener;
}
public void setChartListener(CardChartListener chartListener) {
this.chartListener = chartListener;
}
public void setLayoutNeeded() {
CardListener listener = this.listener;
if (listener != null) {

View file

@ -0,0 +1,88 @@
package net.osmand.plus.routepreparationmenu.cards;
import android.view.MotionEvent;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.listener.ChartTouchListener;
public interface CardChartListener {
/**
* Called when a value has been selected inside the chart.
*
* @param e The selected Entry
* @param h The corresponding highlight object that contains information
* about the highlighted position such as dataSetIndex, ...
*/
void onValueSelected(BaseCard card, Entry e, Highlight h);
/**
* Called when nothing has been selected or an "un-select" has been made.
*/
void onNothingSelected(BaseCard card);
/**
* Callbacks when a touch-gesture has started on the chart (ACTION_DOWN)
*
* @param me
* @param lastPerformedGesture
*/
void onChartGestureStart(BaseCard card, MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture);
/**
* Callbacks when a touch-gesture has ended on the chart (ACTION_UP, ACTION_CANCEL)
*
* @param me
* @param lastPerformedGesture
*/
void onChartGestureEnd(BaseCard card, MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture);
/**
* Callbacks when the chart is longpressed.
*
* @param me
*/
void onChartLongPressed(BaseCard card, MotionEvent me);
/**
* Callbacks when the chart is double-tapped.
*
* @param me
*/
void onChartDoubleTapped(BaseCard card, MotionEvent me);
/**
* Callbacks when the chart is single-tapped.
*
* @param me
*/
void onChartSingleTapped(BaseCard card, MotionEvent me);
/**
* Callbacks then a fling gesture is made on the chart.
*
* @param me1
* @param me2
* @param velocityX
* @param velocityY
*/
void onChartFling(BaseCard card, MotionEvent me1, MotionEvent me2, float velocityX, float velocityY);
/**
* Callbacks when the chart is scaled / zoomed via pinch zoom gesture.
*
* @param me
* @param scaleX scalefactor on the x-axis
* @param scaleY scalefactor on the y-axis
*/
void onChartScale(BaseCard card, MotionEvent me, float scaleX, float scaleY);
/**
* Callbacks when the chart is moved / translated via drag gesture.
*
* @param me
* @param dX translation distance on the x-axis
* @param dY translation distance on the y-axis
*/
void onChartTranslate(BaseCard card, Highlight h, MotionEvent me, float dX, float dY);
}

View file

@ -1,6 +1,7 @@
package net.osmand.plus.routepreparationmenu.cards;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.ColorUtils;
import android.support.v7.view.ContextThemeWrapper;
@ -26,6 +27,7 @@ import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SettingsNavigationActivity;
import net.osmand.plus.helpers.GpxUiHelper;
import net.osmand.router.RouteStatistics;
import net.osmand.router.RouteStatistics.Boundaries;
import net.osmand.router.RouteStatistics.RouteSegmentAttribute;
import net.osmand.router.RouteStatistics.Statistics;
@ -65,6 +67,11 @@ public class RouteInfoCard extends BaseCard {
updateContent(routeStatistics);
}
@Nullable
public HorizontalBarChart getChart() {
return (HorizontalBarChart) view.findViewById(R.id.chart);
}
private <E> void updateContent(final Statistics<E> routeStatistics) {
updateHeader();
final HorizontalBarChart chart = (HorizontalBarChart) view.findViewById(R.id.chart);
@ -78,22 +85,18 @@ public class RouteInfoCard extends BaseCard {
int i = h.getStackIndex();
if (elems.size() > i) {
selectedPropertyName = elems.get(i).getPropertyName();
LinearLayout container = (LinearLayout) view.findViewById(R.id.route_items);
if (!showLegend) {
showLegend = true;
if (showLegend) {
updateLegend(routeStatistics);
}
container.removeAllViews();
attachLegend(container, routeStatistics);
setLayoutNeeded();
}
}
@Override
public void onNothingSelected() {
LinearLayout container = (LinearLayout) view.findViewById(R.id.route_items);
showLegend = false;
container.removeAllViews();
setLayoutNeeded();
selectedPropertyName = null;
if (showLegend) {
updateLegend(routeStatistics);
}
}
});
LinearLayout container = (LinearLayout) view.findViewById(R.id.route_items);
@ -113,6 +116,13 @@ public class RouteInfoCard extends BaseCard {
});
}
protected <E> void updateLegend(Statistics<E> routeStatistics) {
LinearLayout container = (LinearLayout) view.findViewById(R.id.route_items);
container.removeAllViews();
attachLegend(container, routeStatistics);
setLayoutNeeded();
}
private Drawable getCollapseIcon(boolean collapsed) {
return collapsed ? getContentIcon(R.drawable.ic_action_arrow_down) : getActiveIcon(R.drawable.ic_action_arrow_up);
}

View file

@ -12,15 +12,16 @@ import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
import com.github.mikephil.charting.listener.ChartTouchListener.ChartGesture;
import com.github.mikephil.charting.listener.OnChartGestureListener;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import net.osmand.AndroidUtils;
import net.osmand.GPXUtilities.GPXFile;
@ -62,6 +63,16 @@ public class RouteStatisticCard extends BaseCard {
makeGpxDisplayItem();
}
@Nullable
public GPXFile getGpx() {
return gpx;
}
@Nullable
public GpxDisplayItem getGpxItem() {
return gpxItem;
}
@Override
public int getCardLayoutId() {
return R.layout.route_info_header;
@ -218,6 +229,11 @@ public class RouteStatisticCard extends BaseCard {
}
}
@Nullable
public LineChart getChart() {
return (LineChart) view.findViewById(R.id.chart);
}
private void buildHeader(GPXTrackAnalysis analysis) {
final LineChart mChart = (LineChart) view.findViewById(R.id.chart);
GpxUiHelper.setupGPXChart(mChart, 4, 24f, 16f, !nightMode, true);
@ -242,6 +258,24 @@ public class RouteStatisticCard extends BaseCard {
LineData data = new LineData(dataSets);
mChart.setData(data);
mChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
@Override
public void onValueSelected(Entry e, Highlight h) {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onValueSelected(RouteStatisticCard.this, e, h);
}
}
@Override
public void onNothingSelected() {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onNothingSelected(RouteStatisticCard.this);
}
}
});
mChart.setOnChartGestureListener(new OnChartGestureListener() {
float highlightDrawX = -1;
@ -253,6 +287,10 @@ public class RouteStatisticCard extends BaseCard {
} else {
highlightDrawX = -1;
}
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartGestureStart(RouteStatisticCard.this, me, lastPerformedGesture);
}
}
@Override
@ -264,36 +302,65 @@ public class RouteStatisticCard extends BaseCard {
} else {
gpxItem.chartHighlightPos = -1;
}
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartGestureEnd(RouteStatisticCard.this, me, lastPerformedGesture);
}
}
@Override
public void onChartLongPressed(MotionEvent me) {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartLongPressed(RouteStatisticCard.this, me);
}
}
@Override
public void onChartDoubleTapped(MotionEvent me) {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartDoubleTapped(RouteStatisticCard.this, me);
}
}
@Override
public void onChartSingleTapped(MotionEvent me) {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartSingleTapped(RouteStatisticCard.this, me);
}
}
@Override
public void onChartFling(MotionEvent me1, MotionEvent me2, float velocityX, float velocityY) {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartFling(RouteStatisticCard.this, me1, me2, velocityX, velocityY);
}
}
@Override
public void onChartScale(MotionEvent me, float scaleX, float scaleY) {
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartScale(RouteStatisticCard.this, me, scaleX, scaleY);
}
}
@Override
public void onChartTranslate(MotionEvent me, float dX, float dY) {
Highlight h = null;
if (highlightDrawX != -1) {
Highlight h = mChart.getHighlightByTouchPoint(highlightDrawX, 0f);
h = mChart.getHighlightByTouchPoint(highlightDrawX, 0f);
if (h != null) {
mChart.highlightValue(h);
}
}
CardChartListener chartListener = getChartListener();
if (chartListener != null) {
chartListener.onChartTranslate(RouteStatisticCard.this, h, me, dX, dY);
}
}
});
mChart.setVisibility(View.VISIBLE);

View file

@ -57,8 +57,6 @@ public class MapInfoLayer extends OsmandMapLayer {
private TopTextView streetNameView;
private TopToolbarView topToolbarView;
private TrackChartPoints trackChartPoints;
public MapInfoLayer(MapActivity map, RouteLayer layer){
this.map = map;
settings = map.getMyApplication().getSettings();
@ -224,7 +222,6 @@ public class MapInfoLayer extends OsmandMapLayer {
}
public void setTrackChartPoints(TrackChartPoints trackChartPoints) {
this.trackChartPoints = trackChartPoints;
routeLayer.setTrackChartPoints(trackChartPoints);
}