Merge branch 'master' of ssh://github.com/osmandapp/Osmand into search_link
This commit is contained in:
commit
711898c492
17 changed files with 981 additions and 871 deletions
|
@ -1,86 +1,125 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ListView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="0dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/header_layout"
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="@dimen/dashboard_map_toolbar">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/split_interval_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:theme="?attr/actionBarStyle"
|
||||
app:contentInsetLeft="54dp"
|
||||
app:contentInsetStart="54dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
tools:text="2017-02-16" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
android:layout_marginTop="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/header_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/bg_color"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/header_split_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
tools:src="@drawable/ic_action_split_interval"
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginRight="16dp"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/split_interval_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/split_interval_title"
|
||||
android:background="@null"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:text="Split interval:"/>
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/split_interval_text"
|
||||
android:background="@null"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:gravity="right"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
tools:text="10 km"/>
|
||||
android:layout_height="48dp"
|
||||
android:background="?attr/bg_color"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/split_interval_arrow"
|
||||
android:id="@+id/header_split_image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_action_arrow_drop_down"/>
|
||||
android:layout_marginBottom="12dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
tools:src="@drawable/ic_action_split_interval" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/split_interval_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/split_interval_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@null"
|
||||
android:text="Split interval:"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:id="@+id/split_interval_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="right"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium"
|
||||
tools:text="10 km" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/split_interval_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_action_arrow_drop_down" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/card_bottom_divider" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/card_bottom_divider"/>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
|
@ -631,7 +631,7 @@
|
|||
|
||||
<string name="file_can_not_be_renamed">Файл ня можа быць пераназваны.</string>
|
||||
<string name="file_with_name_already_exists">Файл з такой назвай ужо існуе.</string>
|
||||
<string name="gpx_navigation">GPX маршрут</string>
|
||||
<string name="gpx_navigation">GPX-маршрут</string>
|
||||
<string name="poi_query_by_name_matches_categories">Некалькі катэгорый POI знойдзены, што адпавядаюць запыту:</string>
|
||||
<string name="data_to_search_poi_not_available">Лякальных зьвестак для пошуку POI няма.</string>
|
||||
<string name="poi_filter_by_name">Пошук па назве</string>
|
||||
|
@ -715,7 +715,7 @@
|
|||
<string name="tts_missing_language_data">Няма ўсталяваных дадзеных для абранай мовы. Вы хочаце пайсьці на Google Play, каб усталяваць?</string>
|
||||
<string name="gpx_option_reverse_route">Развярнуць кірунак GPX</string>
|
||||
<string name="gpx_option_destination_point">Выкарыстоўваць цяперашні пункт прызначэньня</string>
|
||||
<string name="gpx_option_from_start_point">Прайсьці ўвесь шлях спачатку</string>
|
||||
<string name="gpx_option_from_start_point">Прайсці ўвесь шлях</string>
|
||||
<string name="switch_to_vector_map_to_see">Для гэтага рэгіёну даступныя лякальныя вэктарныя мапы.\n\t\n\tДля іх выкарыстаньня абярыце пункт мэню \'Налада мапы\' → \'Крыніца мапы…\' → \'Лякальныя вэктарныя мапы\'.</string>
|
||||
<string name="choose_audio_stream">Вывад галасавых падказак</string>
|
||||
<string name="choose_audio_stream_descr">Абярыце канал для галасавых падказак</string>
|
||||
|
@ -1223,8 +1223,8 @@
|
|||
<string name="index_name_canada">Паўночная Амэрыка - Канада</string>
|
||||
<string name="index_name_italy">Эўропа - Італія</string>
|
||||
<string name="index_name_gb">Эўропа - Вялікабрытанія</string>
|
||||
<string name="calculate_osmand_route_without_internet">Вылічыць адрэзак маршруту OsmAnd без Інтэрнэту</string>
|
||||
<string name="gpx_option_calculate_first_last_segment">Вылічыць маршрут OsmAnd для першага і апошняга ўчастка маршруту</string>
|
||||
<string name="calculate_osmand_route_without_internet">Разлічыць адрэзак маршруту OsmAnd без Інтэрнэту</string>
|
||||
<string name="gpx_option_calculate_first_last_segment">Разлічыць маршрут OsmAnd для першага і апошняга ўчастка маршруту</string>
|
||||
<string name="use_displayed_track_for_navigation">Ці хочаце вы выкарыстоўваць адлюстраваны сьлед для навігацыі?</string>
|
||||
<string name="route_info">Інфармацыя пра маршрут</string>
|
||||
<string name="routing_attr_prefer_motorway_name">Аддаваць перавагу аўтамагістралям</string>
|
||||
|
@ -1289,7 +1289,7 @@
|
|||
<string name="voice_pref_title">Голас</string>
|
||||
<string name="misc_pref_title">Рознае</string>
|
||||
<string name="localization_pref_title">Лякалізацыя</string>
|
||||
<string name="interrupt_music">Перапыненьне музыкі</string>
|
||||
<string name="interrupt_music">Прыпыніць музыку</string>
|
||||
<string name="osmo_settings_uuid">Унікальны ідэнтыфікатар прылады</string>
|
||||
<string name="osmo_settings_descr">Глянуць унікальны рэгістрацыйны ключ прыстасаваньня і наладзіць асабісты канал адсочваньня</string>
|
||||
<string name="osmo_plugin_description">Гэты модуль дае некаторыя функцыянальныя магчымасці для маніторынгу OpenStreetMap гл. https://osmo.mobi
|
||||
|
@ -1605,7 +1605,7 @@
|
|||
<string name="rendering_attr_shareTaxiRoutes_name">Маршрутныя таксі</string>
|
||||
<string name="rendering_attr_tramTrainRoutes_name">Маршруты трамваяў і цягнікоў</string>
|
||||
|
||||
<string name="impassable_road">Пазьбягаць дарогі…</string>
|
||||
<string name="impassable_road">Пазбягаць дарог…</string>
|
||||
<string name="rendering_category_hide">Схаваць</string>
|
||||
<string name="wake_on_voice">Уключыць экран</string>
|
||||
<string name="wake_on_voice_descr">Уключаць экран прыстасаваньня пры набліжэньні да павароту</string>
|
||||
|
@ -2170,7 +2170,7 @@
|
|||
<string name="live_updates">Аўтаматычныя абнаўленні</string>
|
||||
<string name="select_voice_provider">Выберыце галасавыя ўказаньні</string>
|
||||
<string name="select_voice_provider_descr">Выберыце ці сьцягніце галасавыя ўказаньні для вашай мовы</string>
|
||||
<string name="impassable_road_desc">Выберыце дарогі, якія вы хочаце пазьбягаць падчас навігацыі</string>
|
||||
<string name="impassable_road_desc">Абярыце дарогі, якія вы хочаце пазбягаць падчас навігацыі</string>
|
||||
|
||||
<string name="update_time">Час абнаўленьня</string>
|
||||
<string name="updates_size">Абнаўленьні: %s</string>
|
||||
|
|
|
@ -621,7 +621,7 @@ Biltegiratzean {1} MB erabiliko dira.
|
|||
<string name="select_search_position">Jatorria:</string>
|
||||
<string name="context_menu_item_search">Bilatu honen inguruan</string>
|
||||
|
||||
<string name="shared_string_save_as_gpx">Gorde GPX lorratz gisa</string>
|
||||
<string name="shared_string_save_as_gpx">Gorde GPX lorratz berri gisa</string>
|
||||
<string name="route_successfully_saved_at">Ibilbidea \'%1$s\' bezala ongi gorde da.</string>
|
||||
<string name="filename_input">Fitxategi-izena:</string>
|
||||
<string name="file_with_name_already_exist">Izen berdineko beste fitxategi bat dago dagoeneko.</string>
|
||||
|
@ -2594,7 +2594,7 @@ Area honi dagokio: %1$s x %2$s</string>
|
|||
<string name="do_not_send_anonymous_app_usage">Ez bidali aplikazioaren erabilera estatistika anonimoak</string>
|
||||
<string name="do_not_send_anonymous_app_usage_desc">OsmAndek aplikazioan irekitzen dituzun atalei buruzko informazioa jasotzen du. Zure kokalekua ez da inoiz bidaltzen, ezta aplikazioan idazten duzun ezer edo ikusi, bilatu edo deskargatzen dituzun zonaldeei buruzko ezer ere.</string>
|
||||
<string name="do_not_show_startup_messages">Ez erakutsi mezuak hasieran</string>
|
||||
<string name="do_not_show_startup_messages_desc">Aplikazioen deskontuak eta tokiko gertaeren inguruko mezuak bistaratzen ditu</string>
|
||||
<string name="do_not_show_startup_messages_desc">Aplikazioen deskontuak eta tokiko gertaera berezien mezuak ezkutatzen ditu</string>
|
||||
<string name="parking_options">Aparkatzeko aukerak</string>
|
||||
<string name="full_version_thanks">Eskerrik asko OsmAnd aplikazioaren bertsio osoa erosteagatik!</string>
|
||||
<string name="routing_attr_relief_smoothness_factor_hills_name">Menditsua</string>
|
||||
|
@ -2780,5 +2780,17 @@ Area honi dagokio: %1$s x %2$s</string>
|
|||
<string name="do_not_use_animations_descr">Aplikazioaren animazioak desgaitzen ditu</string>
|
||||
<string name="keep_showing_on_map">Jarraitu mapan erakusten</string>
|
||||
<string name="exit_without_saving">Irten gorde gabe?</string>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Puntuak puntu ala lerro gisa gorde ditakezu</string>
|
||||
</resources>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Puntuak puntu ala lerro gisa gorde ditzakezu.</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAndek puntuak hautatutako profilaren ibilbideekin lotuko ditu.</string>
|
||||
<string name="choose_navigation_type">Hautatu nabigazio profila</string>
|
||||
<string name="add_route_points">Gehitu ibilbide-puntuak</string>
|
||||
<string name="add_line">Gehitu lerroa</string>
|
||||
<string name="empty_state_my_tracks">Gehitu eta grabatu lorratzak</string>
|
||||
<string name="empty_state_my_tracks_desc">Grabatu edo inportatu lorratzak ikusteko</string>
|
||||
<string name="empty_state_favourites">Gehitu gogokoak</string>
|
||||
<string name="empty_state_favourites_desc">Gehitu gogokoak mapan edo inportatu hauek fitxategi sistematik</string>
|
||||
<string name="import_track">Inportatu lorratza</string>
|
||||
<string name="import_track_desc">%1$s fitxategiak ez du bide-punturik, inportatu lorratz gisa?</string>
|
||||
<string name="move_point">Mugitu puntua</string>
|
||||
<string name="add_segment_to_the_track">Gehitu GPX lorratzera</string>
|
||||
</resources>
|
||||
|
|
|
@ -2634,12 +2634,12 @@
|
|||
<string name="poi_historic_period_old_kingdom">Période historique : Ancien Empire (2686 – 2181 av. J.C.)</string>
|
||||
<string name="poi_historic_period_first_intermediate_period">Période historique : Première Période intermédiaire (2181 – 2055 av. J.C.)</string>
|
||||
<string name="poi_historic_period_second_intermediate_period">Période historique : Deuxième Période intermédiaire (1650 – 1550 av. J.C.)</string>
|
||||
<string name="poi_historic_period_third_intermediate_period">"Période historique : Troisième Période intermédiaire (1069 – 664 av. J.C.) "</string>
|
||||
<string name="poi_historic_period_third_intermediate_period">Période historique : Troisième Période intermédiaire (1069 – 664 av. J.C.)</string>
|
||||
<string name="poi_historic_period_greek_dark_ages">Période historique : siècles obscurs grecques (1100 – 800 av. J.C.)</string>
|
||||
<string name="poi_historic_period_roman_greece">Période historique : Grèce romaine (146 av. J.C. – 330 ap. J.C.)</string>
|
||||
<string name="poi_historic_period_roman_kingdom">Période historique : Royauté romaine (753 av. J.C. – 509 av. J.C.)</string>
|
||||
<string name="poi_historic_period_dominate">Période historique : dominat (285 ap. J.C. – 476 ap. J.C.)</string>
|
||||
<string name="poi_historic_era_paleolithic">Période historique : paléolithique (2,6 millions d\'années – 10000 AP)</string>
|
||||
<string name="poi_historic_era_paleolithic">Période historique : paléolithique (2,6 millions d\'années – 10000 avant le présent)</string>
|
||||
<string name="poi_historic_era_mesolithic">Période historique : mésolithique</string>
|
||||
<string name="poi_historic_era_neolithic">Période historique : néolithique</string>
|
||||
<string name="poi_historic_era_chalcolithic">Période historique : chalcolithique (4ème–3ème millénaire av. J.C.)</string>
|
||||
|
@ -3072,4 +3072,18 @@
|
|||
<string name="poi_social_facility_for_diseased">Malade</string>
|
||||
<string name="poi_tomb_rock_cut">Type: coupe de roche</string>
|
||||
<string name="poi_historic_civilization_ancient_roman">Civilisation: ancien romain \'753 av. JC. - 284 ap. JC.)</string>
|
||||
<string name="poi_historic_period_early_dynastic_period">Période historique: période dynastique antérieure (3100 - 2686 av. J.-C.)</string>
|
||||
<string name="poi_historic_period_first_persian_period">Période historique: première période perse</string>
|
||||
<string name="poi_historic_period_late_period">Période historique: période tardive (664 - 332 av. J.-C.)</string>
|
||||
<string name="poi_historic_period_second_persian_period">Période historique: deuxième période perse</string>
|
||||
<string name="poi_historic_period_ptolemaic_egypt">Période historique: egypte ptolemaïque (305 av. J.-C. - 30 av. J.-C.)</string>
|
||||
<string name="poi_historic_period_christian_egypt">Période historique: Egypte chrétienne</string>
|
||||
<string name="poi_historic_period_byzantine_egypt">Période historique: Egypte chrétienne</string>
|
||||
<string name="poi_historic_period_persian_occupation">Période historique: occupation persane</string>
|
||||
<string name="poi_historic_period_villager">Période historique: villageois (époque I, II, 1580 avant JC - 133 après JC)</string>
|
||||
<string name="poi_historic_period_urban">Période historique: urbaine (époque III, 133 AD - 374 après JC)</string>
|
||||
<string name="poi_historic_period_classical">Période historique: classique (époque IV, 374 ap. JC - 900 ap. JC)</string>
|
||||
<string name="poi_historic_period_imperial">Période historique: impériale (époque V, 900 ap. JC - 1200 ap. JC)</string>
|
||||
|
||||
<string name="poi_stone_type_conciliation_cross">Type: croix de conciliation</string>
|
||||
</resources>
|
||||
|
|
|
@ -910,24 +910,13 @@ Mémoire proportionnelle %4$s Mo (limite Android %5$s Mo, Dalvik %6$s Mo).</stri
|
|||
<string name="snap_to_road_descr">Déplacer la position sur la route pendant la navigation</string>
|
||||
<string name="snap_to_road">Déplacer sur la route</string>
|
||||
<string name="osmand_long_description_1000_chars">OsmAnd (OSM Automated Navigation Directions) OsmAnd est un logiciel libre de navigation exploitant une grande variété de données issues OpenStreetMap (OSM). Toutes les données (cartes vectorielles ou à base de tuiles) peuvent être stockées dans la mémoire du téléphone pour un usage hors-ligne. OsmAnd permet également le routage en ligne et hors-ligne avec des instructions vocales pas à pas. Fonctionnalités principales : - Fonctionne complètement hors-ligne (stockage des cartes téléchargées au format vectoriel ou tuile dans le périphérique de stockage) - Cartes hors-lignes compactes disponibles pour le monde entier - Téléchargement des cartes pour un pays ou une région directement depuis l\'application - Possibilité de superposer plusieurs couches, telles que des traces GPX ou de navigation, des points d\'intérêt (PI), des favoris, des courbes de niveau, les arrêts de transport public, et bien d\'autres cartes avec une transparence personnalisable - Recherche hors-ligne d\'adresses et de lieux (PI) - Navigation hors-ligne pour distances moyennes - Mode voiture, vélo et piéton avec : - Option de vue jour/nuit automatique - Option de zoom automatique lors des déplacements - Orientation automatique de la carte (fixe, boussole, cap) Limitations de la version gratuite de OsmAnd : - Nombre de téléchargement de cartes limité - Pas d\'accès aux points d\'intérêt Wikipédia hors-ligne. OsmAnd est activement développé et notre projet et ses progrès futurs dépendent des contributions financières pour financer le développement et le test de nouvelles fonctionnalités. Veuillez considérer l\'achat d\'OsmAnd+, le financement d\'une fonctionnalité spécifique ou une donation sur osmand.net.</string>
|
||||
<string name="osmand_plus_long_description_1000_chars">"
|
||||
OsmAnd+ (OSM Automated Navigation Directions)
|
||||
|
||||
OsmAnd+ est un logiciel libre de navigation donnant accès à un grand nombre de données OpenStreetMap (OSM). Toutes les données (cartes vectorielles ou à base de tuiles) peuvent être stockées sur l\'appareil pour un usage hors-ligne. En plus de la consultation des cartes, OsmAnd permet également la navigation hors-ligne comme en ligne avec des instructions de guidage vocal.
|
||||
|
||||
OsmAnd+ est la version payante de l\'application, en l\'achetant vous supportez le projet, financez le développement de nouvelles fonctionnalités, et recevez les dernières mises à jour.
|
||||
|
||||
Fonctionnalités principales :
|
||||
- Fonctionne complètement hors-ligne (après téléchargement des cartes)
|
||||
- Cartes compactes disponibles pour le monde entier
|
||||
- Téléchargement illimité des cartes pour un pays ou une région directement depuis l\'application
|
||||
- Points d\'intérêt Wikipédia hors-ligne, idéal pour les voyages touristiques
|
||||
- Possibilité de superposer plusieurs couches, telles que des traces, des points d\'intérêt, des favoris, des courbes de niveau, les transports public et bien d\'autres cartes (pistes de ski, chemin de randonnées, circuit à vélo, balisage maritime ...) avec une transparence personnalisable
|
||||
- Recherche hors-ligne d\'adresses et de points d\'intérêt
|
||||
- Navigation hors-ligne sur des itinéraires de moyenne distance
|
||||
- Modes : voiture, cycliste et piéton
|
||||
- Options : vue jour/nuit automatique, zoom automatique en fonction de la vitesse, plusieurs modes d\'orientation automatique de la carte (fixe, boussole, direction), affichage des limitations de vitesse, guidage vocal par voix enregistrées ou par synthèse vocale.
|
||||
"</string>
|
||||
<string name="osmand_plus_long_description_1000_chars">OsmAnd+ (OSM Automated Navigation Directions)
|
||||
\n
|
||||
\nOsmAnd+ est un logiciel libre de navigation donnant accès à un grand nombre de données OpenStreetMap (OSM). Toutes les données (cartes vectorielles ou à base de tuiles) peuvent être stockées sur l\'appareil pour un usage hors-ligne. En plus de la consultation des cartes, OsmAnd permet également la navigation hors-ligne comme en ligne avec des instructions de guidage vocal.
|
||||
\n
|
||||
\nOsmAnd+ est la version payante de l\'application, en l\'achetant vous supportez le projet, financez le développement de nouvelles fonctionnalités, et recevez les dernières mises à jour.
|
||||
\n
|
||||
\nFonctionnalités principales : - Fonctionne complètement hors-ligne (après téléchargement des cartes) - Cartes compactes disponibles pour le monde entier - Téléchargement illimité des cartes pour un pays ou une région directement depuis l\'application - Points d\'intérêt Wikipédia hors-ligne, idéal pour les voyages touristiques - Possibilité de superposer plusieurs couches, telles que des traces, des points d\'intérêt, des favoris, des courbes de niveau, les transports public et bien d\'autres cartes (pistes de ski, chemin de randonnées, circuit à vélo, balisage maritime ...) avec une transparence personnalisable - Recherche hors-ligne d\'adresses et de points d\'intérêt - Navigation hors-ligne sur des itinéraires de moyenne distance - Modes : voiture, cycliste et piéton - Options : vue jour/nuit automatique, zoom automatique en fonction de la vitesse, plusieurs modes d\'orientation automatique de la carte (fixe, boussole, direction), affichage des limitations de vitesse, guidage vocal par voix enregistrées ou par synthèse vocale</string>
|
||||
|
||||
|
||||
<string name="avoid_motorway">Éviter les autoroutes</string>
|
||||
|
@ -2671,22 +2660,18 @@ représentant la zone : %1$s x %2$s</string>
|
|||
\n • Partage de votre position afin qu\'on puisse vous rejoindre rapidement</string>
|
||||
<string name="restore_purchases">Restaurer vos achats</string>
|
||||
<string name="shared_string_visible">Visible</string>
|
||||
<string name="osmand_plus_extended_description_part7">"
|
||||
Améliorez OSM
|
||||
• Signalez des erreurs sur les données
|
||||
• Envoyez des traces GPX directement depuis l\'application
|
||||
• Ajoutez des points d\'intérêt
|
||||
• Enregistrez vos itinéraires en arrière-plan (pendant que votre appareil est en veille)
|
||||
OsmAnd est une application open source très active. Toutes les contributions sont bienvenues que ce soit en signalant des bugs, en participant à la traduction ou en développant de nouvelles fonctionnalités. Grâce aux interactions entre les utilisateurs et les développeurs l\'application est en évolution permanente. Le projet est bien sûr ouvert à toute contribution financière pour accélérer encore son développement.
|
||||
"</string>
|
||||
<string name="osmand_plus_extended_description_part7">Améliorez OSM
|
||||
\n • Signalez des erreurs sur les données
|
||||
\n • Envoyez des traces GPX directement depuis l\'application
|
||||
\n • Ajoutez des points d\'intérêt et envoyez les directement sur OSM (ou plus tard si hors-ligne)
|
||||
\n • Enregistrez vos itinéraires en arrière-plan (pendant que votre appareil est en veille)
|
||||
\n OsmAnd est une application open source très active. Toutes les contributions sont bienvenues que ce soit en signalant des bugs, en participant à la traduction ou en développant de nouvelles fonctionnalités. Grâce aux interactions entre les utilisateurs et les développeurs l\'application est en évolution permanente. Le projet est bien sûr ouvert à toute contribution financière pour accélérer encore son développement.</string>
|
||||
<string name="analyze_on_map">Analyser sur la carte</string>
|
||||
<string name="osmand_plus_extended_description_part1">"
|
||||
OsmAnd+ (OSM Automated Navigation Directions) est une application de visualisation de cartes et de navigation utilisant les données gratuites couvrant le monde entier du projet OpenStreetMap (OSM). Profitez d\'un guidage vocal comme visuel; Découvrez des points d\'intérêt; Créez et gérez des traces GPX; Installez des greffons pour visualiser l\'altitude et les courbes de niveaux; Utilisez les modes Conduite, Piéton, Cycliste; Contribuez à l\'amélioration des cartes OSM et bien plus encore !
|
||||
|
||||
OsmAnd+ est la version payante de l\'application, en l\'achetant vous supportez le projet, financez le développement de nouvelles fonctionnalités, et recevez les dernières mises à jour.
|
||||
|
||||
Fonctionnalités principales :
|
||||
"</string>
|
||||
<string name="osmand_plus_extended_description_part1">OsmAnd+ (OSM Automated Navigation Directions) est une application de visualisation de cartes et de navigation utilisant les données gratuites couvrant le monde entier du projet OpenStreetMap (OSM). Profitez d\'un guidage vocal comme visuel; Découvrez des points d\'intérêt; Créez et gérez des traces GPX; Installez des greffons pour visualiser l\'altitude et les courbes de niveaux; Utilisez les modes Conduite, Piéton, Cycliste; Contribuez à l\'amélioration des cartes OSM et bien plus encore !
|
||||
\n
|
||||
\n OsmAnd+ est la version payante de l\'application, en l\'achetant vous supportez le projet, financez le développement de nouvelles fonctionnalités, et recevez les dernières mises à jour.
|
||||
\n
|
||||
\nFonctionnalités principales :</string>
|
||||
<string name="sea_depth_thanks">Merci d\'avoir acheté le greffon Lignes de sonde marines !</string>
|
||||
<string name="index_item_depth_contours_osmand_ext">Lignes de sonde marines</string>
|
||||
<string name="index_item_depth_points_southern_hemisphere">Lignes de sonde marines pour l\'hémisphère sud</string>
|
||||
|
@ -2863,7 +2848,7 @@ Fonctionnalités principales :
|
|||
<string name="add_point_before">Ajouter un point avant</string>
|
||||
<string name="add_point_after">Ajouter un point après</string>
|
||||
<string name="shared_string_options">Options</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd ajoutera des points supplémentaires adaptés au type de navigation.</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd va connecter les points avec les itinéraires pour le profil sélectionné</string>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Vous pouvez enregistrer les points soit comme points de passage soit comme ligne.</string>
|
||||
<string name="choose_navigation_type">Sélectionnez le type de navigation</string>
|
||||
<string name="add_route_points">Ajouter des points à la route</string>
|
||||
|
@ -2891,4 +2876,8 @@ Fonctionnalités principales :
|
|||
<string name="show_direction">Afficher les indications de direction</string>
|
||||
<string name="sort_by">Trier par</string>
|
||||
<string name="marker_options">Options de la marque</string>
|
||||
<string name="osmand_extended_description_part8">OsmAnd est open-source et en développement actif. Tout le monde peut contribuer à l\'application en signalant des bugs, en améliorant les traductions ou en codant de nouvelles fonctionnalités. Le projet est dans un état d\'amélioration continue par toutes ces formes d\'interaction avec les développeurs et les utilisateurs. Les progrès du projet reposent également sur des contributions financières pour financer le codage et le test de nouvelles fonctionnalités. Couverture et qualité de carte approximative: • Europe de l\'Ouest: **** • Europe de l\'Est: *** • Russie: *** • Amérique du Nord: *** • Amérique du Sud: ** • Asie: ** • Japon et Corée: *** • Moyen-Orient: ** • Afrique: ** • Antarctique: * La plupart des pays du monde sont disponibles en téléchargement! Obtenez un navigateur fiable dans votre pays, qu\'il s\'agisse de la France, de l\'Allemagne, du Mexique, du Royaume-Uni, de l\'Espagne, des Pays-Bas, des États-Unis, de la Russie, du Brésil ou de tout autre pays.</string>
|
||||
<string name="osmand_plus_extended_description_part2">Navigation • Fonctionne en ligne (rapide) ou hors ligne (pas de frais d\'itinérance lorsque vous êtes à l\'étranger) • Guide vocal étape par étape (voix enregistrées et synthétisées) • Guide de voie optionnel, affichage du nom de la rue et heure d\'arrivée estimée • Prise en charge des points intermédiaires sur votre itinéraire • Ré-routage automatique chaque fois que vous vous déviez de l\'itinéraire • Recherchez des lieux par adresse, par type (par exemple: restaurant, hôtel, station-service, musée) ou par coordonnées géographiques</string>
|
||||
<string name="osmand_plus_extended_description_part3">Affichage de la carte • Affichez votre position et votre orientation • En option, alignez l\'image selon la boussole ou votre direction de mouvement • Enregistrez vos endroits les plus importants en tant que favoris • Affichez les POI (point d\'intérêts) autour de vous • Affichez des tuiles spécialisées en ligne, une vue satellite (de Bing ), différentes surcouches, comme les pistes GPX et les couches supplémentaires avec une transparence personnalisable. • Possibilité d\'afficher les noms de lieux en anglais, local ou phonétique</string>
|
||||
<string name="osmand_plus_extended_description_part4">Utilisez les données OSM et Wikipedia • Des informations de haute qualité provenant des meilleurs projets collaboratifs du monde • Données OSM disponibles par pays ou région • POI de Wikipédia, idéal pour les visites • Téléchargements gratuits illimités, directement à partir de l\'application • Des cartes vectorielles compactes et mises à jour au moins une fois par mois • Sélection entre les données régionales complètes et le réseau routier uniquement (Exemple: l\'intégralité du Japon représente 700 Mo ou 200 Mo pour le réseau routier uniquement)</string>
|
||||
</resources>
|
||||
|
|
|
@ -2897,4 +2897,9 @@ Copertura e qualità approssimativamente:
|
|||
<string name="save_route_point">Salva il Punto Percorso</string>
|
||||
<string name="route_point_one">Punto Percorso 1</string>
|
||||
<string name="empty_state_my_tracks">Aggiungi e registra Tracce</string>
|
||||
<string name="move_all_to_history">Sposta tutto nella cronologia</string>
|
||||
<string name="build_route">Costruisci un percorso</string>
|
||||
<string name="show_direction">Mostra la direzione</string>
|
||||
<string name="sort_by">Ordina per</string>
|
||||
<string name="marker_options">Opzioni marcatori</string>
|
||||
</resources>
|
||||
|
|
|
@ -2831,8 +2831,8 @@ Reprezentuje obszar: %1$s x %2$s</string>
|
|||
<string name="import_track_desc">Plik %1$s nie zawiera punktów trasy, czy zaimportować go jako ślad?</string>
|
||||
<string name="move_point">Przesuń punkt</string>
|
||||
<string name="add_segment_to_the_track">Dodaj do śladu GPX</string>
|
||||
<string name="keep_showing_on_map">Wciąż wyświetlaj na mapie</string>
|
||||
<string name="exit_without_saving">Czy wyjść bez zapisywania?</string>
|
||||
<string name="keep_showing_on_map">Wyświetlanie na mapie</string>
|
||||
<string name="exit_without_saving">Zakończyć bez zapisywania?</string>
|
||||
<string name="do_not_use_animations">Wyłącz animacje</string>
|
||||
<string name="do_not_use_animations_descr">Wyłącza animacje w programie</string>
|
||||
<string name="move_all_to_history">Przenieś wszystkie do historii</string>
|
||||
|
|
|
@ -505,7 +505,7 @@
|
|||
<string name="poi_travel_agent">Турагентство</string>
|
||||
<string name="poi_viewpoint">Место с хорошим видом</string>
|
||||
<string name="poi_camp_site">Место для лагеря</string>
|
||||
<string name="poi_caravan_site">Место для ночлега</string>
|
||||
<string name="poi_caravan_site">Ночлег</string>
|
||||
<string name="poi_picnic_site">Место для пикника</string>
|
||||
<string name="poi_spring">Родник</string>
|
||||
<string name="poi_cemetery">Кладбище</string>
|
||||
|
@ -3078,7 +3078,7 @@
|
|||
|
||||
<string name="poi_barometer_yes">Барометр</string>
|
||||
<string name="poi_barometer_no">Барометр: отсутствует</string>
|
||||
<string name="poi_thermometer_yes">Термометр:</string>
|
||||
<string name="poi_thermometer_yes">Термометр</string>
|
||||
<string name="poi_thermometer_no">Термометр: отсутствует</string>
|
||||
<string name="poi_hygrometer_yes">Гигрометр</string>
|
||||
<string name="poi_hygrometer_no">Гигрометр: отсутствует</string>
|
||||
|
|
|
@ -2743,9 +2743,9 @@ Pro praghere iscrie su còdighe intreu</string>
|
|||
<string name="add_point_before">Annanghe unu puntu in antis</string>
|
||||
<string name="add_point_after">Annanghe unu puntu a pustis</string>
|
||||
<string name="shared_string_options">Optziones</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd at a annànghere puntos in prus, a segunda de sa casta de nàvigu.</string>
|
||||
<string name="measurement_tool_snap_to_road_descr">OsmAnd at a connètere sos puntos cun sas àndalas pro su profilu isseberadu.</string>
|
||||
<string name="measurement_tool_save_as_new_track_descr">Podes sarvare sos puntos comente puntos de s\'àndala o comente lìnia.</string>
|
||||
<string name="choose_navigation_type">Issèbera sa casta de nàvigu</string>
|
||||
<string name="choose_navigation_type">Issèbera su profilu de nàvigu</string>
|
||||
<string name="add_route_points">Annanghe puntos a s\'àndala</string>
|
||||
<string name="add_line">Annanghe una lìnia</string>
|
||||
<string name="empty_state_my_tracks">Annanghe e registra rastas</string>
|
||||
|
|
|
@ -494,7 +494,7 @@
|
|||
<string name="menu_mute_off">Zvuk zapnutý</string>
|
||||
<string name="menu_mute_on">Zvuk vypnutý</string>
|
||||
<string name="voice_provider_descr">Výber hlasových údajov pre navigáciu</string>
|
||||
<string name="voice_provider">Hlasové údaje</string>
|
||||
<string name="voice_provider">Hlasové pokyny</string>
|
||||
<string name="voice_data_initializing">Inicializácia hlasových údajov…</string>
|
||||
<string name="voice_data_not_supported">Nepodporovaná verzia hlasových údajov</string>
|
||||
<string name="voice_data_corrupted">Vybrané hlasové údaje sú poškodené</string>
|
||||
|
@ -2857,4 +2857,9 @@ Zodpovedá oblasti: %1$s x %2$s</string>
|
|||
<string name="do_not_use_animations_descr">Vypne animácie v aplikácii</string>
|
||||
<string name="keep_showing_on_map">Zobrazovať ďalej na mape</string>
|
||||
<string name="exit_without_saving">Ukončiť bez uloženia?</string>
|
||||
<string name="move_all_to_history">Presunúť všetko do histórie</string>
|
||||
<string name="build_route">Zostaviť trasu</string>
|
||||
<string name="show_direction">Zobraziť smer</string>
|
||||
<string name="sort_by">Zotriediť podľa</string>
|
||||
<string name="marker_options">Možnosti značiek</string>
|
||||
</resources>
|
||||
|
|
|
@ -365,20 +365,24 @@
|
|||
<style name="Widget.Styled.ActionBarLight" parent="Widget.AppCompat.Light.ActionBar.Solid">
|
||||
<item name="background">@color/actionbar_light_color</item>
|
||||
<item name="android:background">@color/actionbar_light_color</item>
|
||||
<item name="titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
|
||||
<item name="subtitleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
|
||||
<item name="titleTextStyle">@style/Widget.Styled.LightActionBarTitle</item>
|
||||
<item name="subtitleTextStyle">@style/Widget.Styled.LightActionBarSubtitle</item>
|
||||
<item name="actionBarWidgetTheme">@style/Theme.AppCompat</item>
|
||||
|
||||
<item name="android:titleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
|
||||
<item name="android:subtitleTextStyle">@style/Widget.Styled.LightActionBarHeader</item>
|
||||
<item name="android:titleTextStyle">@style/Widget.Styled.LightActionBarTitle</item>
|
||||
<item name="android:subtitleTextStyle">@style/Widget.Styled.LightActionBarSubtitle</item>
|
||||
<item name="android:actionBarWidgetTheme">@style/Theme.AppCompat</item>
|
||||
<item name="elevation">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Styled.LightActionBarHeader" parent="@android:style/TextAppearance">
|
||||
<style name="Widget.Styled.LightActionBarTitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Title">
|
||||
<item name="android:textColor">@color/color_white</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Styled.LightActionBarSubtitle" parent="TextAppearance.AppCompat.Widget.ActionBar.Subtitle">
|
||||
<item name="android:textColor">@color/white_80_transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="WhiteActionMode" parent="@style/Widget.AppCompat.ActionMode">
|
||||
<item name="titleTextStyle">@style/WhiteActionModeTitleTextStyle</item>
|
||||
<item name="android:titleTextStyle">@style/WhiteActionModeTitleTextStyle</item>
|
||||
|
|
|
@ -25,7 +25,7 @@ public class OsmandBackupAgent extends BackupAgentHelper {
|
|||
SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, prefs);
|
||||
addHelper("osmand.settings", helper);
|
||||
|
||||
FileBackupHelper fileBackupHelper = new FileBackupHelper(this, FavouritesDbHelper.FAVOURITE_DB_NAME);
|
||||
addHelper("osmand.favorites", fileBackupHelper);
|
||||
FileBackupHelper fileBackupHelper = new FileBackupHelper(this, FavouritesDbHelper.FILE_TO_BACKUP);
|
||||
addHelper(FavouritesDbHelper.FILE_TO_BACKUP, fileBackupHelper);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.osmand.plus.OsmandSettings;
|
|||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.measurementtool.NewGpxData;
|
||||
import net.osmand.plus.myplaces.FavoritesActivity;
|
||||
import net.osmand.plus.myplaces.SplitSegmentFragment;
|
||||
import net.osmand.plus.myplaces.SplitSegmentDialogFragment;
|
||||
import net.osmand.plus.myplaces.TrackPointFragment;
|
||||
import net.osmand.plus.myplaces.TrackSegmentFragment;
|
||||
import net.osmand.plus.views.AddGpxPointBottomSheetHelper.NewGpxPoint;
|
||||
|
@ -61,10 +61,6 @@ public class TrackActivity extends TabActivity {
|
|||
private boolean openPointsTab = false;
|
||||
private boolean openTracksList = false;
|
||||
|
||||
public PagerSlidingTabStrip getSlidingTabLayout() {
|
||||
return slidingTabLayout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle icicle) {
|
||||
this.app = getMyApplication();
|
||||
|
@ -294,8 +290,8 @@ public class TrackActivity extends TabActivity {
|
|||
Fragment frag = f.get();
|
||||
if (frag instanceof TrackSegmentFragment) {
|
||||
((TrackSegmentFragment) frag).updateContent();
|
||||
} else if (frag instanceof SplitSegmentFragment) {
|
||||
((SplitSegmentFragment) frag).reloadSplitFragment();
|
||||
} else if (frag instanceof SplitSegmentDialogFragment) {
|
||||
((SplitSegmentDialogFragment) frag).updateContent();
|
||||
} else if (frag instanceof TrackPointFragment) {
|
||||
((TrackPointFragment) frag).setContent();
|
||||
}
|
||||
|
@ -348,23 +344,6 @@ public class TrackActivity extends TabActivity {
|
|||
int itemId = item.getItemId();
|
||||
switch (itemId) {
|
||||
case android.R.id.home:
|
||||
int backStackEntriesCount = getSupportFragmentManager().getBackStackEntryCount();
|
||||
if (backStackEntriesCount > 0) {
|
||||
FragmentManager.BackStackEntry backStackEntry = getSupportFragmentManager().getBackStackEntryAt(getSupportFragmentManager().getBackStackEntryCount() - 1);
|
||||
if (backStackEntry.getName().equals(SplitSegmentFragment.TAG)) {
|
||||
for (WeakReference<Fragment> f : fragList) {
|
||||
Fragment frag = f.get();
|
||||
if (frag instanceof TrackSegmentFragment) {
|
||||
((TrackSegmentFragment) frag).updateSplitView();
|
||||
}
|
||||
}
|
||||
getSupportFragmentManager().popBackStack();
|
||||
if (isHavingWayPoints() || isHavingRoutePoints()) {
|
||||
getSlidingTabLayout().setVisibility(View.VISIBLE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (getIntent().hasExtra(MapActivity.INTENT_KEY_PARENT_MAP_ACTIVITY) || openTracksList) {
|
||||
OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
|
||||
final Intent favorites = new Intent(this, appCustomization.getFavoritesActivity());
|
||||
|
@ -379,25 +358,17 @@ public class TrackActivity extends TabActivity {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
int backStackEntriesCount = getSupportFragmentManager().getBackStackEntryCount();
|
||||
if (backStackEntriesCount > 0) {
|
||||
FragmentManager.BackStackEntry backStackEntry = getSupportFragmentManager().getBackStackEntryAt(getSupportFragmentManager().getBackStackEntryCount() - 1);
|
||||
if (backStackEntry.getName().equals(SplitSegmentFragment.TAG)) {
|
||||
for (WeakReference<Fragment> f : fragList) {
|
||||
Fragment frag = f.get();
|
||||
if (frag instanceof TrackSegmentFragment) {
|
||||
((TrackSegmentFragment) frag).updateSplitView();
|
||||
}
|
||||
}
|
||||
getSupportFragmentManager().popBackStack();
|
||||
if (isHavingWayPoints() || isHavingRoutePoints()) {
|
||||
getSlidingTabLayout().setVisibility(View.VISIBLE);
|
||||
}
|
||||
return;
|
||||
public void updateSplitView() {
|
||||
for (WeakReference<Fragment> f : fragList) {
|
||||
Fragment frag = f.get();
|
||||
if (frag instanceof TrackSegmentFragment) {
|
||||
((TrackSegmentFragment) frag).updateSplitView();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
if (openTracksList) {
|
||||
OsmAndAppCustomization appCustomization = getMyApplication().getAppCustomization();
|
||||
final Intent favorites = new Intent(this, appCustomization.getFavoritesActivity());
|
||||
|
|
|
@ -2,14 +2,17 @@ package net.osmand.plus.liveupdates;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import net.osmand.AndroidNetworkUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.Version;
|
||||
|
@ -19,12 +22,19 @@ import net.osmand.plus.inapp.InAppHelper;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class OsmLiveActivity extends AbstractDownloadActivity implements DownloadIndexesThread.DownloadEvents {
|
||||
private final static Log LOG = PlatformUtil.getLog(OsmLiveActivity.class);
|
||||
public final static String OPEN_SUBSCRIPTION_INTENT_PARAM = "open_subscription_intent_param";
|
||||
private LiveUpdatesFragmentPagerAdapter pagerAdapter;
|
||||
private InAppHelper inAppHelper;
|
||||
private boolean openSubscription;
|
||||
private static final String URL = "https://osmand.net/api/osmlive_status";
|
||||
|
||||
public InAppHelper getInAppHelper() {
|
||||
return inAppHelper;
|
||||
|
@ -43,6 +53,42 @@ public class OsmLiveActivity extends AbstractDownloadActivity implements Downloa
|
|||
inAppHelper = null;
|
||||
}
|
||||
|
||||
new AsyncTask<Void, Void, String>() {
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... params) {
|
||||
try {
|
||||
return AndroidNetworkUtils.sendRequest(getMyApplication(), URL, null, "Requesting map updates info...", false, false);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Error: " + "Requesting map updates info error", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String response) {
|
||||
if (response != null) {
|
||||
ActionBar actionBar = getSupportActionBar();
|
||||
if (actionBar != null) {
|
||||
SimpleDateFormat source = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
|
||||
source.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
SimpleDateFormat dest = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US);
|
||||
dest.setTimeZone(TimeZone.getDefault());
|
||||
try {
|
||||
Date parsed = source.parse(response);
|
||||
actionBar.setSubtitle(dest.format(parsed));
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
|
||||
Intent intent = getIntent();
|
||||
if (intent != null && intent.getExtras() != null) {
|
||||
openSubscription = intent.getExtras().getBoolean(OPEN_SUBSCRIPTION_INTENT_PARAM, false);
|
||||
|
|
|
@ -0,0 +1,719 @@
|
|||
package net.osmand.plus.myplaces;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.DialogFragment;
|
||||
import android.support.v7.app.ActionBar;
|
||||
import android.support.v7.widget.ListPopupWindow;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.GPXUtilities;
|
||||
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
|
||||
import net.osmand.plus.GpxSelectionHelper;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItemType;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.TrackActivity;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
||||
import static net.osmand.plus.myplaces.TrackSegmentFragment.ARG_TO_FILTER_SHORT_TRACKS;
|
||||
|
||||
public class SplitSegmentDialogFragment extends DialogFragment {
|
||||
|
||||
public final static String TAG = "SPLIT_SEGMENT_DIALOG_FRAGMENT";
|
||||
private OsmandApplication app;
|
||||
|
||||
private SplitSegmentsAdapter adapter;
|
||||
private View headerView;
|
||||
|
||||
private GpxDisplayItemType[] filterTypes = {GpxDisplayItemType.TRACK_SEGMENT};
|
||||
private List<String> options = new ArrayList<>();
|
||||
private List<Double> distanceSplit = new ArrayList<>();
|
||||
private TIntArrayList timeSplit = new TIntArrayList();
|
||||
private int selectedSplitInterval;
|
||||
private IconsCache ic;
|
||||
private int minMaxSpeedLayoutWidth;
|
||||
private Paint minMaxSpeedPaint;
|
||||
private Rect minMaxSpeedTextBounds;
|
||||
private ListView listView;
|
||||
private ProgressBar progressBar;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
app = getMyApplication();
|
||||
ic = app.getIconsCache();
|
||||
boolean isLightTheme = app.getSettings().OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
int themeId = isLightTheme ? R.style.OsmandLightTheme : R.style.OsmandDarkTheme;
|
||||
setStyle(STYLE_NO_FRAME, themeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
listView.setBackgroundColor(getResources().getColor(
|
||||
getMyApplication().getSettings().isLightContent() ? R.color.ctx_menu_info_view_bg_light
|
||||
: R.color.ctx_menu_info_view_bg_dark));
|
||||
getTrackActivity().onAttachFragment(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
minMaxSpeedPaint = new Paint();
|
||||
minMaxSpeedPaint.setTextSize(getResources().getDimension(R.dimen.default_split_segments_data));
|
||||
minMaxSpeedPaint.setTypeface(FontCache.getFont(getContext(), "fonts/Roboto-Medium.ttf"));
|
||||
minMaxSpeedPaint.setStyle(Paint.Style.FILL);
|
||||
minMaxSpeedTextBounds = new Rect();
|
||||
|
||||
final View view = getActivity().getLayoutInflater().inflate(R.layout.split_segments_layout, container, false);
|
||||
|
||||
Toolbar toolbar = (Toolbar) view.findViewById(R.id.split_interval_toolbar);
|
||||
TextView titleTextView = (TextView) toolbar.findViewById(R.id.title);
|
||||
if (app.getSettings().isLightContent()) {
|
||||
titleTextView.setTextAppearance(getContext(), R.style.Widget_Styled_LightActionBarTitle);
|
||||
} else {
|
||||
titleTextView.setTextAppearance(getContext(), R.style.TextAppearance_AppCompat_Widget_ActionBar_Title);
|
||||
}
|
||||
ActionBar trackActivityActionBar = getTrackActivity().getSupportActionBar();
|
||||
if (trackActivityActionBar != null) {
|
||||
titleTextView.setText(trackActivityActionBar.getTitle());
|
||||
}
|
||||
toolbar.setNavigationIcon(getMyApplication().getIconsCache().getIcon(R.drawable.ic_arrow_back));
|
||||
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
progressBar = view.findViewById(R.id.progress_bar);
|
||||
|
||||
listView = (ListView) view.findViewById(R.id.list);
|
||||
listView.setDivider(null);
|
||||
listView.setDividerHeight(0);
|
||||
|
||||
adapter = new SplitSegmentsAdapter(new ArrayList<GpxDisplayItem>());
|
||||
headerView = view.findViewById(R.id.header_layout);
|
||||
((ImageView) headerView.findViewById(R.id.header_split_image)).setImageDrawable(ic.getIcon(R.drawable.ic_action_split_interval, app.getSettings().isLightContent() ? R.color.icon_color : 0));
|
||||
|
||||
listView.addHeaderView(getActivity().getLayoutInflater().inflate(R.layout.gpx_split_segments_empty_header, null, false));
|
||||
listView.addFooterView(getActivity().getLayoutInflater().inflate(R.layout.list_shadow_footer, null, false));
|
||||
|
||||
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
int previousYPos = -1;
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView absListView, int i) {
|
||||
if (i == SCROLL_STATE_IDLE) {
|
||||
previousYPos = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView absListView, int i, int i1, int i2) {
|
||||
View c = absListView.getChildAt(0);
|
||||
if (c != null) {
|
||||
int currentYPos = -c.getTop() + absListView.getFirstVisiblePosition() * c.getHeight();
|
||||
if (previousYPos == -1) {
|
||||
previousYPos = currentYPos;
|
||||
}
|
||||
|
||||
float yTranslationToSet = headerView.getTranslationY() + (previousYPos - currentYPos);
|
||||
if (yTranslationToSet < 0 && yTranslationToSet > -headerView.getHeight()) {
|
||||
headerView.setTranslationY(yTranslationToSet);
|
||||
} else if (yTranslationToSet < -headerView.getHeight()) {
|
||||
headerView.setTranslationY(-headerView.getHeight());
|
||||
} else if (yTranslationToSet > 0) {
|
||||
headerView.setTranslationY(0);
|
||||
}
|
||||
|
||||
previousYPos = currentYPos;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
listView.setAdapter(adapter);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
updateContent();
|
||||
}
|
||||
|
||||
private void updateHeader() {
|
||||
final View splitIntervalView = headerView.findViewById(R.id.split_interval_view);
|
||||
|
||||
if (getGpx() != null && !getGpx().showCurrentTrack && adapter.getCount() > 0) {
|
||||
setupSplitIntervalView(splitIntervalView);
|
||||
if (options.size() == 0) {
|
||||
prepareSplitIntervalAdapterData();
|
||||
}
|
||||
updateSplitIntervalView(splitIntervalView);
|
||||
splitIntervalView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final ListPopupWindow popup = new ListPopupWindow(getActivity());
|
||||
popup.setAnchorView(splitIntervalView);
|
||||
popup.setContentWidth(AndroidUtils.dpToPx(app, 200f));
|
||||
popup.setModal(true);
|
||||
popup.setDropDownGravity(Gravity.RIGHT | Gravity.TOP);
|
||||
popup.setVerticalOffset(AndroidUtils.dpToPx(app, -48f));
|
||||
popup.setHorizontalOffset(AndroidUtils.dpToPx(app, -6f));
|
||||
popup.setAdapter(new ArrayAdapter<>(getTrackActivity(),
|
||||
R.layout.popup_list_text_item, options));
|
||||
popup.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
selectedSplitInterval = position;
|
||||
GpxSelectionHelper.SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), true, false);
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
if (groups.size() > 0) {
|
||||
updateSplit(groups, sf);
|
||||
}
|
||||
popup.dismiss();
|
||||
updateSplitIntervalView(splitIntervalView);
|
||||
}
|
||||
});
|
||||
popup.show();
|
||||
}
|
||||
});
|
||||
splitIntervalView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
splitIntervalView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateContent() {
|
||||
if (getTrackActivity() != null) {
|
||||
adapter.clear();
|
||||
adapter.setNotifyOnChange(false);
|
||||
GpxDisplayItem overviewSegments = getOverviewSegment();
|
||||
adapter.add(overviewSegments);
|
||||
List<GpxDisplayItem> splitSegments = getSplitSegments();
|
||||
adapter.addAll(splitSegments);
|
||||
adapter.notifyDataSetChanged();
|
||||
listView.setSelection(0);
|
||||
headerView.setTranslationY(0);
|
||||
updateHeader();
|
||||
}
|
||||
}
|
||||
|
||||
private void updateSplit(List<GpxDisplayGroup> groups, GpxSelectionHelper.SelectedGpxFile sf) {
|
||||
new SplitTrackAsyncTask(sf, groups).execute((Void) null);
|
||||
}
|
||||
|
||||
private void setupSplitIntervalView(View view) {
|
||||
final TextView title = (TextView) view.findViewById(R.id.split_interval_title);
|
||||
final TextView text = (TextView) view.findViewById(R.id.split_interval_text);
|
||||
final ImageView img = (ImageView) view.findViewById(R.id.split_interval_arrow);
|
||||
int colorId;
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
if (groups.size() > 0) {
|
||||
colorId = app.getSettings().isLightContent() ?
|
||||
R.color.primary_text_light : R.color.primary_text_dark;
|
||||
} else {
|
||||
colorId = app.getSettings().isLightContent() ?
|
||||
R.color.secondary_text_light : R.color.secondary_text_dark;
|
||||
}
|
||||
int color = app.getResources().getColor(colorId);
|
||||
title.setTextColor(color);
|
||||
text.setTextColor(color);
|
||||
img.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_drop_down, colorId));
|
||||
}
|
||||
|
||||
private void updateSplitIntervalView(View view) {
|
||||
final TextView text = (TextView) view.findViewById(R.id.split_interval_text);
|
||||
if (selectedSplitInterval == 0) {
|
||||
text.setText(getString(R.string.shared_string_none));
|
||||
} else {
|
||||
text.setText(options.get(selectedSplitInterval));
|
||||
}
|
||||
}
|
||||
|
||||
private GPXUtilities.GPXFile getGpx() {
|
||||
return getTrackActivity().getGpx();
|
||||
}
|
||||
|
||||
public TrackActivity getTrackActivity() {
|
||||
return (TrackActivity) getActivity();
|
||||
}
|
||||
|
||||
private void prepareSplitIntervalAdapterData() {
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
|
||||
options.add(app.getString(R.string.shared_string_none));
|
||||
distanceSplit.add(-1d);
|
||||
timeSplit.add(-1);
|
||||
addOptionSplit(30, true, groups); // 50 feet, 20 yards, 20
|
||||
// m
|
||||
addOptionSplit(60, true, groups); // 100 feet, 50 yards,
|
||||
// 50 m
|
||||
addOptionSplit(150, true, groups); // 200 feet, 100 yards,
|
||||
// 100 m
|
||||
addOptionSplit(300, true, groups); // 500 feet, 200 yards,
|
||||
// 200 m
|
||||
addOptionSplit(600, true, groups); // 1000 feet, 500 yards,
|
||||
// 500 m
|
||||
addOptionSplit(1500, true, groups); // 2000 feet, 1000 yards, 1 km
|
||||
addOptionSplit(3000, true, groups); // 1 mi, 2 km
|
||||
addOptionSplit(6000, true, groups); // 2 mi, 5 km
|
||||
addOptionSplit(15000, true, groups); // 5 mi, 10 km
|
||||
|
||||
addOptionSplit(15, false, groups);
|
||||
addOptionSplit(30, false, groups);
|
||||
addOptionSplit(60, false, groups);
|
||||
addOptionSplit(120, false, groups);
|
||||
addOptionSplit(150, false, groups);
|
||||
addOptionSplit(300, false, groups);
|
||||
addOptionSplit(600, false, groups);
|
||||
addOptionSplit(900, false, groups);
|
||||
addOptionSplit(1800, false, groups);
|
||||
addOptionSplit(3600, false, groups);
|
||||
}
|
||||
|
||||
private List<GpxDisplayGroup> getDisplayGroups() {
|
||||
return filterGroups(true);
|
||||
}
|
||||
|
||||
private void addOptionSplit(int value, boolean distance, List<GpxDisplayGroup> model) {
|
||||
if (distance) {
|
||||
double dvalue = OsmAndFormatter.calculateRoundedDist(value, app);
|
||||
options.add(OsmAndFormatter.getFormattedDistance((float) dvalue, app));
|
||||
distanceSplit.add(dvalue);
|
||||
timeSplit.add(-1);
|
||||
if (Math.abs(model.get(0).getSplitDistance() - dvalue) < 1) {
|
||||
selectedSplitInterval = distanceSplit.size() - 1;
|
||||
}
|
||||
} else {
|
||||
if (value < 60) {
|
||||
options.add(value + " " + app.getString(R.string.int_seconds));
|
||||
} else if (value % 60 == 0) {
|
||||
options.add((value / 60) + " " + app.getString(R.string.int_min));
|
||||
} else {
|
||||
options.add((value / 60f) + " " + app.getString(R.string.int_min));
|
||||
}
|
||||
distanceSplit.add(-1d);
|
||||
timeSplit.add(value);
|
||||
if (model.get(0).getSplitTime() == value) {
|
||||
selectedSplitInterval = distanceSplit.size() - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<GpxDisplayGroup> filterGroups(boolean useDisplayGroups) {
|
||||
List<GpxDisplayGroup> groups = new ArrayList<>();
|
||||
if (getTrackActivity() != null) {
|
||||
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(useDisplayGroups);
|
||||
for (GpxDisplayGroup group : result) {
|
||||
boolean add = hasFilterType(group.getType());
|
||||
if (isArgumentTrue(ARG_TO_FILTER_SHORT_TRACKS)) {
|
||||
Iterator<GpxDisplayItem> item = group.getModifiableList().iterator();
|
||||
while (item.hasNext()) {
|
||||
GpxDisplayItem it2 = item.next();
|
||||
if (it2.analysis != null && it2.analysis.totalDistance < 100) {
|
||||
item.remove();
|
||||
}
|
||||
}
|
||||
if (group.getModifiableList().isEmpty()) {
|
||||
add = false;
|
||||
}
|
||||
}
|
||||
if (add) {
|
||||
groups.add(group);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
private List<GpxDisplayItem> getSplitSegments() {
|
||||
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(true);
|
||||
List<GpxDisplayItem> splitSegments = new ArrayList<>();
|
||||
if (result != null && result.size() > 0) {
|
||||
if (result.get(0).isSplitDistance() || result.get(0).isSplitTime()) {
|
||||
splitSegments.addAll(result.get(0).getModifiableList());
|
||||
}
|
||||
}
|
||||
return splitSegments;
|
||||
}
|
||||
|
||||
private GpxDisplayItem getOverviewSegment() {
|
||||
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(false);
|
||||
GpxDisplayItem overviewSegment = null;
|
||||
if (result.size() > 0) {
|
||||
overviewSegment = result.get(0).getModifiableList().get(0);
|
||||
}
|
||||
return overviewSegment;
|
||||
}
|
||||
|
||||
private boolean isArgumentTrue(@NonNull String arg) {
|
||||
return getArguments() != null && getArguments().getBoolean(arg);
|
||||
}
|
||||
|
||||
protected boolean hasFilterType(GpxDisplayItemType filterType) {
|
||||
for (GpxDisplayItemType type : filterTypes) {
|
||||
if (type == filterType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
getTrackActivity().updateSplitView();
|
||||
super.dismiss();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
getTrackActivity().updateSplitView();
|
||||
super.onCancel(dialog);
|
||||
}
|
||||
|
||||
private class SplitSegmentsAdapter extends ArrayAdapter<GpxDisplayItem> {
|
||||
|
||||
SplitSegmentsAdapter(List<GpxDisplayItem> items) {
|
||||
super(getActivity(), 0, items);
|
||||
}
|
||||
|
||||
ColorStateList defaultTextColor;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
GpxDisplayItem currentGpxDisplayItem = getItem(position);
|
||||
if (convertView == null) {
|
||||
convertView = getTrackActivity().getLayoutInflater().inflate(R.layout.gpx_split_segment_fragment, parent, false);
|
||||
}
|
||||
convertView.setOnClickListener(null);
|
||||
TextView overviewTextView = (TextView) convertView.findViewById(R.id.overview_text);
|
||||
ImageView overviewImageView = (ImageView) convertView.findViewById(R.id.overview_image);
|
||||
if (position == 0) {
|
||||
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
if (defaultTextColor == null) {
|
||||
defaultTextColor = overviewTextView.getTextColors();
|
||||
}
|
||||
overviewTextView.setTextColor(defaultTextColor);
|
||||
overviewTextView.setText(app.getString(R.string.shared_string_overview));
|
||||
if (currentGpxDisplayItem != null) {
|
||||
((TextView) convertView.findViewById(R.id.fragment_count_text)).setText(app.getString(R.string.shared_string_time_span) + ": " + Algorithms.formatDuration((int) (currentGpxDisplayItem.analysis.timeSpan / 1000), app.accessibilityEnabled()));
|
||||
}
|
||||
} else {
|
||||
if (currentGpxDisplayItem != null && currentGpxDisplayItem.analysis != null) {
|
||||
overviewTextView.setTextColor(app.getSettings().isLightContent() ? app.getResources().getColor(R.color.gpx_split_overview_light) : app.getResources().getColor(R.color.gpx_split_overview_dark));
|
||||
if (currentGpxDisplayItem.group.isSplitDistance()) {
|
||||
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_track_16, app.getSettings().isLightContent() ? R.color.gpx_split_overview_light : R.color.gpx_split_overview_dark));
|
||||
overviewTextView.setText("");
|
||||
double metricStart = currentGpxDisplayItem.analysis.metricEnd - currentGpxDisplayItem.analysis.totalDistance;
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDistance((float) metricStart, app));
|
||||
overviewTextView.append(" - ");
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDistance((float) currentGpxDisplayItem.analysis.metricEnd, app));
|
||||
} else if (currentGpxDisplayItem.group.isSplitTime()) {
|
||||
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_overview_light : R.color.gpx_split_overview_dark));
|
||||
overviewTextView.setText("");
|
||||
double metricStart = currentGpxDisplayItem.analysis.metricEnd - (currentGpxDisplayItem.analysis.timeSpan / 1000);
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDuration((int) metricStart, app));
|
||||
overviewTextView.append(" - ");
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDuration((int) currentGpxDisplayItem.analysis.metricEnd, app));
|
||||
}
|
||||
((TextView) convertView.findViewById(R.id.fragment_count_text)).setText(app.getString(R.string.of, position, adapter.getCount() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
((ImageView) convertView.findViewById(R.id.start_time_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_start_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.end_time_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_end_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.average_altitude_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_altitude_average_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.altitude_range_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_altitude_range_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.ascent_descent_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_altitude_descent_ascent_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.moving_time_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_moving_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.average_speed_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_speed_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.max_speed_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_max_speed_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
|
||||
if (currentGpxDisplayItem != null) {
|
||||
GPXTrackAnalysis analysis = currentGpxDisplayItem.analysis;
|
||||
if (analysis != null) {
|
||||
ImageView distanceOrTimeSpanImageView = ((ImageView) convertView.findViewById(R.id.distance_or_timespan_image));
|
||||
TextView distanceOrTimeSpanValue = (TextView) convertView.findViewById(R.id.distance_or_time_span_value);
|
||||
TextView distanceOrTimeSpanText = (TextView) convertView.findViewById(R.id.distance_or_time_span_text);
|
||||
if (position == 0) {
|
||||
distanceOrTimeSpanImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_track_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
distanceOrTimeSpanValue.setText(OsmAndFormatter.getFormattedDistance(analysis.totalDistance, app));
|
||||
distanceOrTimeSpanText.setText(app.getString(R.string.distance));
|
||||
} else {
|
||||
if (currentGpxDisplayItem.group.isSplitDistance()) {
|
||||
distanceOrTimeSpanImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
if (analysis.timeSpan > 0) {
|
||||
distanceOrTimeSpanValue.setText(Algorithms.formatDuration((int) (analysis.timeSpan / 1000), app.accessibilityEnabled()));
|
||||
} else {
|
||||
distanceOrTimeSpanValue.setText("-");
|
||||
}
|
||||
distanceOrTimeSpanText.setText(app.getString(R.string.shared_string_time_span));
|
||||
} else if (currentGpxDisplayItem.group.isSplitTime()) {
|
||||
distanceOrTimeSpanImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_track_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
distanceOrTimeSpanValue.setText(OsmAndFormatter.getFormattedDistance(analysis.totalDistance, app));
|
||||
distanceOrTimeSpanText.setText(app.getString(R.string.distance));
|
||||
}
|
||||
}
|
||||
|
||||
TextView startTimeValue = (TextView) convertView.findViewById(R.id.start_time_value);
|
||||
TextView startDateValue = (TextView) convertView.findViewById(R.id.start_date_value);
|
||||
TextView endTimeValue = (TextView) convertView.findViewById(R.id.end_time_value);
|
||||
TextView endDateValue = (TextView) convertView.findViewById(R.id.end_date_value);
|
||||
if (analysis.timeSpan > 0) {
|
||||
DateFormat tf = SimpleDateFormat.getTimeInstance(DateFormat.SHORT);
|
||||
DateFormat df = SimpleDateFormat.getDateInstance(DateFormat.MEDIUM);
|
||||
|
||||
Date start = new Date(analysis.startTime);
|
||||
startTimeValue.setText(tf.format(start));
|
||||
startDateValue.setText(df.format(start));
|
||||
|
||||
Date end = new Date(analysis.endTime);
|
||||
endTimeValue.setText(tf.format(end));
|
||||
endDateValue.setText(df.format(end));
|
||||
} else {
|
||||
startTimeValue.setText("-");
|
||||
startDateValue.setText("-");
|
||||
endTimeValue.setText("-");
|
||||
endDateValue.setText("-");
|
||||
}
|
||||
|
||||
View elevationDivider = convertView.findViewById(R.id.elevation_divider);
|
||||
View elevationSection = convertView.findViewById(R.id.elevation_layout);
|
||||
if (analysis.hasElevationData) {
|
||||
elevationDivider.setVisibility(View.VISIBLE);
|
||||
elevationSection.setVisibility(View.VISIBLE);
|
||||
|
||||
((TextView) convertView.findViewById(R.id.average_altitude_value))
|
||||
.setText(OsmAndFormatter.getFormattedAlt(analysis.avgElevation, app));
|
||||
|
||||
String min = OsmAndFormatter.getFormattedAlt(analysis.minElevation, app);
|
||||
String max = OsmAndFormatter.getFormattedAlt(analysis.maxElevation, app);
|
||||
String min_max_elevation = min.substring(0, min.indexOf(" ")).concat("/").concat(max);
|
||||
if (min_max_elevation.length() > 9) {
|
||||
(convertView.findViewById(R.id.min_altitude_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
(convertView.findViewById(R.id.max_altitude_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.min_altitude_value))
|
||||
.setText(min);
|
||||
((TextView) convertView.findViewById(R.id.max_altitude_value))
|
||||
.setText(max);
|
||||
(convertView.findViewById(R.id.min_max_altitude_value))
|
||||
.setVisibility(View.GONE);
|
||||
} else {
|
||||
(convertView.findViewById(R.id.min_max_altitude_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.min_max_altitude_value))
|
||||
.setText(min_max_elevation);
|
||||
(convertView.findViewById(R.id.min_altitude_value))
|
||||
.setVisibility(View.GONE);
|
||||
(convertView.findViewById(R.id.max_altitude_value))
|
||||
.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
TextView ascentValue = (TextView) convertView.findViewById(R.id.ascent_value);
|
||||
TextView descentValue = (TextView) convertView.findViewById(R.id.descent_value);
|
||||
TextView ascentDescentValue = (TextView) convertView.findViewById(R.id.ascent_descent_value);
|
||||
|
||||
String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app);
|
||||
String desc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationDown, app);
|
||||
String asc_desc = asc.substring(0, asc.indexOf(" ")).concat("/").concat(desc);
|
||||
if (asc_desc.length() > 9) {
|
||||
ascentValue.setVisibility(View.VISIBLE);
|
||||
descentValue.setVisibility(View.VISIBLE);
|
||||
ascentValue.setText(asc);
|
||||
descentValue.setText(desc);
|
||||
ascentDescentValue.setVisibility(View.GONE);
|
||||
} else {
|
||||
ascentDescentValue.setVisibility(View.VISIBLE);
|
||||
ascentDescentValue.setText(asc_desc);
|
||||
ascentValue.setVisibility(View.GONE);
|
||||
descentValue.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
} else {
|
||||
elevationDivider.setVisibility(View.GONE);
|
||||
elevationSection.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
View speedDivider = convertView.findViewById(R.id.speed_divider);
|
||||
View speedSection = convertView.findViewById(R.id.speed_layout);
|
||||
if (analysis.hasSpeedData) {
|
||||
speedDivider.setVisibility(View.VISIBLE);
|
||||
speedSection.setVisibility(View.VISIBLE);
|
||||
|
||||
((TextView) convertView.findViewById(R.id.moving_time_value))
|
||||
.setText(Algorithms.formatDuration((int) (analysis.timeMoving / 1000), app.accessibilityEnabled()));
|
||||
((TextView) convertView.findViewById(R.id.average_speed_value))
|
||||
.setText(OsmAndFormatter.getFormattedSpeed(analysis.avgSpeed, app));
|
||||
|
||||
String maxSpeed = OsmAndFormatter.getFormattedSpeed(analysis.maxSpeed, app);
|
||||
String minSpeed = OsmAndFormatter.getFormattedSpeed(analysis.minSpeed, app);
|
||||
String maxMinSpeed;
|
||||
if (maxSpeed.contains(" ")) {
|
||||
maxMinSpeed = maxSpeed.substring(0, maxSpeed.indexOf(" ")).concat("/").concat(minSpeed);
|
||||
} else {
|
||||
maxMinSpeed = maxSpeed.substring(0, maxSpeed.indexOf("-")).concat("/").concat(minSpeed);
|
||||
}
|
||||
|
||||
if (minMaxSpeedLayoutWidth == 0) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
int screenWidth = metrics.widthPixels;
|
||||
int widthWithoutSidePadding = screenWidth - AndroidUtils.dpToPx(getActivity(), 32);
|
||||
int singleLayoutWidth = widthWithoutSidePadding / 3;
|
||||
int twoLayouts = 2 * (singleLayoutWidth + AndroidUtils.dpToPx(getActivity(), 3));
|
||||
minMaxSpeedLayoutWidth = widthWithoutSidePadding - twoLayouts - AndroidUtils.dpToPx(getActivity(), 28);
|
||||
}
|
||||
|
||||
minMaxSpeedPaint.getTextBounds(maxMinSpeed, 0, maxMinSpeed.length(), minMaxSpeedTextBounds);
|
||||
int minMaxStringWidth = minMaxSpeedTextBounds.width();
|
||||
|
||||
if (analysis.minSpeed == 0) {
|
||||
(convertView.findViewById(R.id.max_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
(convertView.findViewById(R.id.min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_speed_value))
|
||||
.setText(maxSpeed);
|
||||
(convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_text))
|
||||
.setText(app.getString(R.string.shared_string_max));
|
||||
} else if (minMaxStringWidth > minMaxSpeedLayoutWidth) {
|
||||
(convertView.findViewById(R.id.max_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
(convertView.findViewById(R.id.min_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.max_speed_value))
|
||||
.setText(maxSpeed);
|
||||
((TextView) convertView.findViewById(R.id.min_speed_value))
|
||||
.setText(minSpeed);
|
||||
(convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_text))
|
||||
.setText(app.getString(R.string.max_min));
|
||||
} else {
|
||||
(convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setText(maxMinSpeed);
|
||||
(convertView.findViewById(R.id.max_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
(convertView.findViewById(R.id.min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_text))
|
||||
.setText(app.getString(R.string.max_min));
|
||||
}
|
||||
} else {
|
||||
speedDivider.setVisibility(View.GONE);
|
||||
speedSection.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
private class SplitTrackAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
@Nullable
|
||||
private final GpxSelectionHelper.SelectedGpxFile mSelectedGpxFile;
|
||||
|
||||
private final List<GpxDisplayGroup> groups;
|
||||
|
||||
SplitTrackAsyncTask(@Nullable GpxSelectionHelper.SelectedGpxFile selectedGpxFile, List<GpxDisplayGroup> groups) {
|
||||
mSelectedGpxFile = selectedGpxFile;
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
protected void onPreExecute() {
|
||||
progressBar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
protected void onPostExecute(Void result) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
if (mSelectedGpxFile != null) {
|
||||
List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
mSelectedGpxFile.setDisplayGroups(groups);
|
||||
}
|
||||
updateContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
for (GpxDisplayGroup model : groups) {
|
||||
if (selectedSplitInterval == 0) {
|
||||
model.noSplit(app);
|
||||
} else if (distanceSplit.get(selectedSplitInterval) > 0) {
|
||||
model.splitByDistance(app, distanceSplit.get(selectedSplitInterval));
|
||||
} else if (timeSplit.get(selectedSplitInterval) > 0) {
|
||||
model.splitByTime(app, timeSplit.get(selectedSplitInterval));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private OsmandApplication getMyApplication() {
|
||||
return (OsmandApplication) getActivity().getApplication();
|
||||
}
|
||||
|
||||
public static boolean showInstance(TrackActivity trackActivity) {
|
||||
try {
|
||||
SplitSegmentDialogFragment fragment = new SplitSegmentDialogFragment();
|
||||
fragment.show(trackActivity.getSupportFragmentManager(), TAG);
|
||||
return true;
|
||||
} catch (RuntimeException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,690 +0,0 @@
|
|||
package net.osmand.plus.myplaces;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.ListPopupWindow;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.GPXUtilities;
|
||||
import net.osmand.plus.GPXUtilities.GPXTrackAnalysis;
|
||||
import net.osmand.plus.GpxSelectionHelper;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItemType;
|
||||
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
|
||||
import net.osmand.plus.IconsCache;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.TrackActivity;
|
||||
import net.osmand.plus.base.OsmAndListFragment;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
|
||||
import static net.osmand.plus.myplaces.TrackSegmentFragment.ARG_TO_FILTER_SHORT_TRACKS;
|
||||
|
||||
public class SplitSegmentFragment extends OsmAndListFragment {
|
||||
|
||||
public final static String TAG = "SPLIT_SEGMENT_FRAGMENT";
|
||||
private OsmandApplication app;
|
||||
|
||||
private SplitSegmentsAdapter adapter;
|
||||
private View headerView;
|
||||
|
||||
private GpxDisplayItemType[] filterTypes = { GpxDisplayItemType.TRACK_SEGMENT };
|
||||
private List<String> options = new ArrayList<>();
|
||||
private List<Double> distanceSplit = new ArrayList<>();
|
||||
private TIntArrayList timeSplit = new TIntArrayList();
|
||||
private int selectedSplitInterval;
|
||||
private IconsCache ic;
|
||||
private int minMaxSpeedLayoutWidth;
|
||||
private Paint minMaxSpeedPaint;
|
||||
private Rect minMaxSpeedTextBounds;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
app = getMyApplication();
|
||||
ic = app.getIconsCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
updateContent();
|
||||
// Obsolete: updateHeader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
getListView().setBackgroundColor(getResources().getColor(
|
||||
getMyApplication().getSettings().isLightContent() ? R.color.ctx_menu_info_view_bg_light
|
||||
: R.color.ctx_menu_info_view_bg_dark));
|
||||
getTrackActivity().onAttachFragment(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
||||
menu.clear();
|
||||
getTrackActivity().getClearToolbar(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayAdapter<?> getAdapter() {
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
setHasOptionsMenu(true);
|
||||
|
||||
minMaxSpeedPaint = new Paint();
|
||||
minMaxSpeedPaint.setTextSize(getResources().getDimension(R.dimen.default_split_segments_data));
|
||||
minMaxSpeedPaint.setTypeface(FontCache.getFont(getContext(), "fonts/Roboto-Medium.ttf"));
|
||||
minMaxSpeedPaint.setStyle(Paint.Style.FILL);
|
||||
minMaxSpeedTextBounds = new Rect();
|
||||
|
||||
final View view = getActivity().getLayoutInflater().inflate(R.layout.split_segments_layout, container, false);
|
||||
|
||||
final ListView listView = (ListView) view.findViewById(android.R.id.list);
|
||||
listView.setDivider(null);
|
||||
listView.setDividerHeight(0);
|
||||
|
||||
adapter = new SplitSegmentsAdapter(new ArrayList<GpxDisplayItem>());
|
||||
headerView = view.findViewById(R.id.header_layout);
|
||||
((ImageView) headerView.findViewById(R.id.header_split_image)).setImageDrawable(ic.getIcon(R.drawable.ic_action_split_interval, app.getSettings().isLightContent() ? R.color.icon_color : 0));
|
||||
|
||||
listView.addHeaderView(getActivity().getLayoutInflater().inflate(R.layout.gpx_split_segments_empty_header, null, false));
|
||||
listView.addFooterView(getActivity().getLayoutInflater().inflate(R.layout.list_shadow_footer, null, false));
|
||||
|
||||
setListAdapter(adapter);
|
||||
|
||||
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
int previousYPos = -1;
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView absListView, int i) {
|
||||
if (i == SCROLL_STATE_IDLE) {
|
||||
previousYPos = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView absListView, int i, int i1, int i2) {
|
||||
View c = absListView.getChildAt(0);
|
||||
if (c != null) {
|
||||
int currentYPos = -c.getTop() + absListView.getFirstVisiblePosition() * c.getHeight();
|
||||
if (previousYPos == -1) {
|
||||
previousYPos = currentYPos;
|
||||
}
|
||||
|
||||
float yTranslationToSet = headerView.getTranslationY() + (previousYPos - currentYPos);
|
||||
if (yTranslationToSet < 0 && yTranslationToSet > -headerView.getHeight()) {
|
||||
headerView.setTranslationY(yTranslationToSet);
|
||||
} else if (yTranslationToSet < -headerView.getHeight()) {
|
||||
headerView.setTranslationY(-headerView.getHeight());
|
||||
} else if (yTranslationToSet > 0) {
|
||||
headerView.setTranslationY(0);
|
||||
}
|
||||
|
||||
previousYPos = currentYPos;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private void updateHeader() {
|
||||
final View splitIntervalView = headerView.findViewById(R.id.split_interval_view);
|
||||
|
||||
if (getGpx() != null && !getGpx().showCurrentTrack && adapter.getCount() > 0) {
|
||||
setupSplitIntervalView(splitIntervalView);
|
||||
if (options.size() == 0) {
|
||||
prepareSplitIntervalAdapterData();
|
||||
}
|
||||
updateSplitIntervalView(splitIntervalView);
|
||||
splitIntervalView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final ListPopupWindow popup = new ListPopupWindow(getActivity());
|
||||
popup.setAnchorView(splitIntervalView);
|
||||
popup.setContentWidth(AndroidUtils.dpToPx(app, 200f));
|
||||
popup.setModal(true);
|
||||
popup.setDropDownGravity(Gravity.RIGHT | Gravity.TOP);
|
||||
popup.setVerticalOffset(AndroidUtils.dpToPx(app, -48f));
|
||||
popup.setHorizontalOffset(AndroidUtils.dpToPx(app, -6f));
|
||||
popup.setAdapter(new ArrayAdapter<>(getTrackActivity(),
|
||||
R.layout.popup_list_text_item, options));
|
||||
popup.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
selectedSplitInterval = position;
|
||||
GpxSelectionHelper.SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), true, false);
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
if (groups.size() > 0) {
|
||||
updateSplit(groups, sf);
|
||||
}
|
||||
popup.dismiss();
|
||||
updateSplitIntervalView(splitIntervalView);
|
||||
}
|
||||
});
|
||||
popup.show();
|
||||
}
|
||||
});
|
||||
splitIntervalView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
splitIntervalView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateContent() {
|
||||
adapter.clear();
|
||||
adapter.setNotifyOnChange(false);
|
||||
GpxDisplayItem overviewSegments = getOverviewSegment();
|
||||
adapter.add(overviewSegments);
|
||||
List<GpxDisplayItem> splitSegments = getSplitSegments();
|
||||
adapter.addAll(splitSegments);
|
||||
// Obsolete: adapter.setNotifyOnChange(true);
|
||||
adapter.notifyDataSetChanged();
|
||||
getListView().setSelection(0);
|
||||
headerView.setTranslationY(0);
|
||||
updateHeader();
|
||||
}
|
||||
|
||||
private void updateSplit(List<GpxDisplayGroup> groups, GpxSelectionHelper.SelectedGpxFile sf) {
|
||||
new SplitTrackAsyncTask(sf, groups).execute((Void) null);
|
||||
}
|
||||
|
||||
private void setupSplitIntervalView(View view) {
|
||||
final TextView title = (TextView) view.findViewById(R.id.split_interval_title);
|
||||
final TextView text = (TextView) view.findViewById(R.id.split_interval_text);
|
||||
final ImageView img = (ImageView) view.findViewById(R.id.split_interval_arrow);
|
||||
int colorId;
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
if (groups.size() > 0) {
|
||||
colorId = app.getSettings().isLightContent() ?
|
||||
R.color.primary_text_light : R.color.primary_text_dark;
|
||||
} else {
|
||||
colorId = app.getSettings().isLightContent() ?
|
||||
R.color.secondary_text_light : R.color.secondary_text_dark;
|
||||
}
|
||||
int color = app.getResources().getColor(colorId);
|
||||
title.setTextColor(color);
|
||||
text.setTextColor(color);
|
||||
img.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_drop_down, colorId));
|
||||
}
|
||||
|
||||
private void updateSplitIntervalView(View view) {
|
||||
final TextView text = (TextView) view.findViewById(R.id.split_interval_text);
|
||||
if (selectedSplitInterval == 0) {
|
||||
text.setText(getString(R.string.shared_string_none));
|
||||
} else {
|
||||
text.setText(options.get(selectedSplitInterval));
|
||||
}
|
||||
}
|
||||
|
||||
private GPXUtilities.GPXFile getGpx() {
|
||||
return getTrackActivity().getGpx();
|
||||
}
|
||||
|
||||
public TrackActivity getTrackActivity() {
|
||||
return (TrackActivity) getActivity();
|
||||
}
|
||||
|
||||
private void prepareSplitIntervalAdapterData() {
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
|
||||
options.add(app.getString(R.string.shared_string_none));
|
||||
distanceSplit.add(-1d);
|
||||
timeSplit.add(-1);
|
||||
addOptionSplit(30, true, groups); // 50 feet, 20 yards, 20
|
||||
// m
|
||||
addOptionSplit(60, true, groups); // 100 feet, 50 yards,
|
||||
// 50 m
|
||||
addOptionSplit(150, true, groups); // 200 feet, 100 yards,
|
||||
// 100 m
|
||||
addOptionSplit(300, true, groups); // 500 feet, 200 yards,
|
||||
// 200 m
|
||||
addOptionSplit(600, true, groups); // 1000 feet, 500 yards,
|
||||
// 500 m
|
||||
addOptionSplit(1500, true, groups); // 2000 feet, 1000 yards, 1 km
|
||||
addOptionSplit(3000, true, groups); // 1 mi, 2 km
|
||||
addOptionSplit(6000, true, groups); // 2 mi, 5 km
|
||||
addOptionSplit(15000, true, groups); // 5 mi, 10 km
|
||||
|
||||
addOptionSplit(15, false, groups);
|
||||
addOptionSplit(30, false, groups);
|
||||
addOptionSplit(60, false, groups);
|
||||
addOptionSplit(120, false, groups);
|
||||
addOptionSplit(150, false, groups);
|
||||
addOptionSplit(300, false, groups);
|
||||
addOptionSplit(600, false, groups);
|
||||
addOptionSplit(900, false, groups);
|
||||
addOptionSplit(1800, false, groups);
|
||||
addOptionSplit(3600, false, groups);
|
||||
}
|
||||
|
||||
private List<GpxDisplayGroup> getDisplayGroups() {
|
||||
return filterGroups(true);
|
||||
}
|
||||
|
||||
private void addOptionSplit(int value, boolean distance, List<GpxDisplayGroup> model) {
|
||||
if (distance) {
|
||||
double dvalue = OsmAndFormatter.calculateRoundedDist(value, app);
|
||||
options.add(OsmAndFormatter.getFormattedDistance((float) dvalue, app));
|
||||
distanceSplit.add(dvalue);
|
||||
timeSplit.add(-1);
|
||||
if (Math.abs(model.get(0).getSplitDistance() - dvalue) < 1) {
|
||||
selectedSplitInterval = distanceSplit.size() - 1;
|
||||
}
|
||||
} else {
|
||||
if (value < 60) {
|
||||
options.add(value + " " + app.getString(R.string.int_seconds));
|
||||
} else if (value % 60 == 0) {
|
||||
options.add((value / 60) + " " + app.getString(R.string.int_min));
|
||||
} else {
|
||||
options.add((value / 60f) + " " + app.getString(R.string.int_min));
|
||||
}
|
||||
distanceSplit.add(-1d);
|
||||
timeSplit.add(value);
|
||||
if (model.get(0).getSplitTime() == value) {
|
||||
selectedSplitInterval = distanceSplit.size() - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<GpxDisplayGroup> filterGroups(boolean useDisplayGroups) {
|
||||
List<GpxDisplayGroup> groups = new ArrayList<>();
|
||||
if (getTrackActivity() != null) {
|
||||
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(useDisplayGroups);
|
||||
for (GpxDisplayGroup group : result) {
|
||||
boolean add = hasFilterType(group.getType());
|
||||
if (isArgumentTrue(ARG_TO_FILTER_SHORT_TRACKS)) {
|
||||
Iterator<GpxDisplayItem> item = group.getModifiableList().iterator();
|
||||
while (item.hasNext()) {
|
||||
GpxDisplayItem it2 = item.next();
|
||||
if (it2.analysis != null && it2.analysis.totalDistance < 100) {
|
||||
item.remove();
|
||||
}
|
||||
}
|
||||
if (group.getModifiableList().isEmpty()) {
|
||||
add = false;
|
||||
}
|
||||
}
|
||||
if (add) {
|
||||
groups.add(group);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return groups;
|
||||
}
|
||||
|
||||
private List<GpxDisplayItem> getSplitSegments() {
|
||||
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(true);
|
||||
List<GpxDisplayItem> splitSegments = new ArrayList<>();
|
||||
if (result != null && result.size() > 0) {
|
||||
if (result.get(0).isSplitDistance() || result.get(0).isSplitTime()) {
|
||||
splitSegments.addAll(result.get(0).getModifiableList());
|
||||
}
|
||||
}
|
||||
return splitSegments;
|
||||
}
|
||||
|
||||
private GpxDisplayItem getOverviewSegment() {
|
||||
List<GpxDisplayGroup> result = getTrackActivity().getGpxFile(false);
|
||||
GpxDisplayItem overviewSegment = null;
|
||||
if (result.size() > 0) {
|
||||
overviewSegment = result.get(0).getModifiableList().get(0);
|
||||
}
|
||||
return overviewSegment;
|
||||
}
|
||||
|
||||
private boolean isArgumentTrue(@NonNull String arg) {
|
||||
return getArguments() != null && getArguments().getBoolean(arg);
|
||||
}
|
||||
|
||||
protected boolean hasFilterType(GpxDisplayItemType filterType) {
|
||||
for (GpxDisplayItemType type : filterTypes) {
|
||||
if (type == filterType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void reloadSplitFragment() {
|
||||
getFragmentManager()
|
||||
.beginTransaction()
|
||||
.detach(this)
|
||||
.attach(this)
|
||||
.commit();
|
||||
}
|
||||
|
||||
private class SplitSegmentsAdapter extends ArrayAdapter<GpxDisplayItem> {
|
||||
|
||||
SplitSegmentsAdapter(List<GpxDisplayItem> items) {
|
||||
super(getActivity(), 0, items);
|
||||
}
|
||||
|
||||
ColorStateList defaultTextColor;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||
GpxDisplayItem currentGpxDisplayItem = getItem(position);
|
||||
if (convertView == null) {
|
||||
convertView = getTrackActivity().getLayoutInflater().inflate(R.layout.gpx_split_segment_fragment, parent, false);
|
||||
}
|
||||
convertView.setOnClickListener(null);
|
||||
TextView overviewTextView = (TextView) convertView.findViewById(R.id.overview_text);
|
||||
ImageView overviewImageView = (ImageView) convertView.findViewById(R.id.overview_image);
|
||||
if (position == 0) {
|
||||
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
if (defaultTextColor == null) {
|
||||
defaultTextColor = overviewTextView.getTextColors();
|
||||
}
|
||||
overviewTextView.setTextColor(defaultTextColor);
|
||||
overviewTextView.setText(app.getString(R.string.shared_string_overview));
|
||||
if (currentGpxDisplayItem != null) {
|
||||
((TextView) convertView.findViewById(R.id.fragment_count_text)).setText(app.getString(R.string.shared_string_time_span) + ": " + Algorithms.formatDuration((int) (currentGpxDisplayItem.analysis.timeSpan / 1000), app.accessibilityEnabled()));
|
||||
}
|
||||
} else {
|
||||
if (currentGpxDisplayItem != null && currentGpxDisplayItem.analysis != null) {
|
||||
overviewTextView.setTextColor(app.getSettings().isLightContent() ? app.getResources().getColor(R.color.gpx_split_overview_light) : app.getResources().getColor(R.color.gpx_split_overview_dark));
|
||||
if (currentGpxDisplayItem.group.isSplitDistance()) {
|
||||
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_track_16, app.getSettings().isLightContent() ? R.color.gpx_split_overview_light : R.color.gpx_split_overview_dark));
|
||||
overviewTextView.setText("");
|
||||
double metricStart = currentGpxDisplayItem.analysis.metricEnd - currentGpxDisplayItem.analysis.totalDistance;
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDistance((float) metricStart, app));
|
||||
overviewTextView.append(" - ");
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDistance((float) currentGpxDisplayItem.analysis.metricEnd, app));
|
||||
} else if (currentGpxDisplayItem.group.isSplitTime()) {
|
||||
overviewImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_overview_light : R.color.gpx_split_overview_dark));
|
||||
overviewTextView.setText("");
|
||||
double metricStart = currentGpxDisplayItem.analysis.metricEnd - (currentGpxDisplayItem.analysis.timeSpan / 1000);
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDuration((int) metricStart, app));
|
||||
overviewTextView.append(" - ");
|
||||
overviewTextView.append(OsmAndFormatter.getFormattedDuration((int) currentGpxDisplayItem.analysis.metricEnd, app));
|
||||
}
|
||||
((TextView) convertView.findViewById(R.id.fragment_count_text)).setText(app.getString(R.string.of, position, adapter.getCount() - 1));
|
||||
}
|
||||
}
|
||||
|
||||
((ImageView) convertView.findViewById(R.id.start_time_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_start_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.end_time_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_end_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.average_altitude_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_altitude_average_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.altitude_range_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_altitude_range_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.ascent_descent_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_altitude_descent_ascent_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.moving_time_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_moving_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.average_speed_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_speed_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
((ImageView) convertView.findViewById(R.id.max_speed_image))
|
||||
.setImageDrawable(ic.getIcon(R.drawable.ic_action_max_speed_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
|
||||
if (currentGpxDisplayItem != null) {
|
||||
GPXTrackAnalysis analysis = currentGpxDisplayItem.analysis;
|
||||
if (analysis != null) {
|
||||
ImageView distanceOrTimeSpanImageView = ((ImageView) convertView.findViewById(R.id.distance_or_timespan_image));
|
||||
TextView distanceOrTimeSpanValue = (TextView) convertView.findViewById(R.id.distance_or_time_span_value);
|
||||
TextView distanceOrTimeSpanText = (TextView) convertView.findViewById(R.id.distance_or_time_span_text);
|
||||
if (position == 0) {
|
||||
distanceOrTimeSpanImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_track_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
distanceOrTimeSpanValue.setText(OsmAndFormatter.getFormattedDistance(analysis.totalDistance, app));
|
||||
distanceOrTimeSpanText.setText(app.getString(R.string.distance));
|
||||
} else {
|
||||
if (currentGpxDisplayItem.group.isSplitDistance()) {
|
||||
distanceOrTimeSpanImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_time_span_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
if (analysis.timeSpan > 0) {
|
||||
distanceOrTimeSpanValue.setText(Algorithms.formatDuration((int) (analysis.timeSpan / 1000), app.accessibilityEnabled()));
|
||||
} else {
|
||||
distanceOrTimeSpanValue.setText("-");
|
||||
}
|
||||
distanceOrTimeSpanText.setText(app.getString(R.string.shared_string_time_span));
|
||||
} else if (currentGpxDisplayItem.group.isSplitTime()) {
|
||||
distanceOrTimeSpanImageView.setImageDrawable(ic.getIcon(R.drawable.ic_action_track_16, app.getSettings().isLightContent() ? R.color.gpx_split_segment_icon_color : 0));
|
||||
distanceOrTimeSpanValue.setText(OsmAndFormatter.getFormattedDistance(analysis.totalDistance, app));
|
||||
distanceOrTimeSpanText.setText(app.getString(R.string.distance));
|
||||
}
|
||||
}
|
||||
|
||||
TextView startTimeValue = (TextView) convertView.findViewById(R.id.start_time_value);
|
||||
TextView startDateValue = (TextView) convertView.findViewById(R.id.start_date_value);
|
||||
TextView endTimeValue = (TextView) convertView.findViewById(R.id.end_time_value);
|
||||
TextView endDateValue = (TextView) convertView.findViewById(R.id.end_date_value);
|
||||
if (analysis.timeSpan > 0) {
|
||||
DateFormat tf = SimpleDateFormat.getTimeInstance(DateFormat.SHORT);
|
||||
DateFormat df = SimpleDateFormat.getDateInstance(DateFormat.MEDIUM);
|
||||
|
||||
Date start = new Date(analysis.startTime);
|
||||
startTimeValue.setText(tf.format(start));
|
||||
startDateValue.setText(df.format(start));
|
||||
|
||||
Date end = new Date(analysis.endTime);
|
||||
endTimeValue.setText(tf.format(end));
|
||||
endDateValue.setText(df.format(end));
|
||||
} else {
|
||||
startTimeValue.setText("-");
|
||||
startDateValue.setText("-");
|
||||
endTimeValue.setText("-");
|
||||
endDateValue.setText("-");
|
||||
}
|
||||
|
||||
View elevationDivider = convertView.findViewById(R.id.elevation_divider);
|
||||
View elevationSection = convertView.findViewById(R.id.elevation_layout);
|
||||
if (analysis.hasElevationData) {
|
||||
elevationDivider.setVisibility(View.VISIBLE);
|
||||
elevationSection.setVisibility(View.VISIBLE);
|
||||
|
||||
((TextView) convertView.findViewById(R.id.average_altitude_value))
|
||||
.setText(OsmAndFormatter.getFormattedAlt(analysis.avgElevation, app));
|
||||
|
||||
String min = OsmAndFormatter.getFormattedAlt(analysis.minElevation, app);
|
||||
String max = OsmAndFormatter.getFormattedAlt(analysis.maxElevation, app);
|
||||
String min_max_elevation = min.substring(0, min.indexOf(" ")).concat("/").concat(max);
|
||||
if (min_max_elevation.length() > 9) {
|
||||
(convertView.findViewById(R.id.min_altitude_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
(convertView.findViewById(R.id.max_altitude_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.min_altitude_value))
|
||||
.setText(min);
|
||||
((TextView) convertView.findViewById(R.id.max_altitude_value))
|
||||
.setText(max);
|
||||
(convertView.findViewById(R.id.min_max_altitude_value))
|
||||
.setVisibility(View.GONE);
|
||||
} else {
|
||||
(convertView.findViewById(R.id.min_max_altitude_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.min_max_altitude_value))
|
||||
.setText(min_max_elevation);
|
||||
(convertView.findViewById(R.id.min_altitude_value))
|
||||
.setVisibility(View.GONE);
|
||||
(convertView.findViewById(R.id.max_altitude_value))
|
||||
.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
TextView ascentValue = (TextView) convertView.findViewById(R.id.ascent_value);
|
||||
TextView descentValue = (TextView) convertView.findViewById(R.id.descent_value);
|
||||
TextView ascentDescentValue = (TextView) convertView.findViewById(R.id.ascent_descent_value);
|
||||
|
||||
String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app);
|
||||
String desc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationDown, app);
|
||||
String asc_desc = asc.substring(0, asc.indexOf(" ")).concat("/").concat(desc);
|
||||
if (asc_desc.length() > 9) {
|
||||
ascentValue.setVisibility(View.VISIBLE);
|
||||
descentValue.setVisibility(View.VISIBLE);
|
||||
ascentValue.setText(asc);
|
||||
descentValue.setText(desc);
|
||||
ascentDescentValue.setVisibility(View.GONE);
|
||||
} else {
|
||||
ascentDescentValue.setVisibility(View.VISIBLE);
|
||||
ascentDescentValue.setText(asc_desc);
|
||||
ascentValue.setVisibility(View.GONE);
|
||||
descentValue.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
} else {
|
||||
elevationDivider.setVisibility(View.GONE);
|
||||
elevationSection.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
View speedDivider = convertView.findViewById(R.id.speed_divider);
|
||||
View speedSection = convertView.findViewById(R.id.speed_layout);
|
||||
if (analysis.hasSpeedData) {
|
||||
speedDivider.setVisibility(View.VISIBLE);
|
||||
speedSection.setVisibility(View.VISIBLE);
|
||||
|
||||
((TextView) convertView.findViewById(R.id.moving_time_value))
|
||||
.setText(Algorithms.formatDuration((int) (analysis.timeMoving / 1000), app.accessibilityEnabled()));
|
||||
((TextView) convertView.findViewById(R.id.average_speed_value))
|
||||
.setText(OsmAndFormatter.getFormattedSpeed(analysis.avgSpeed, app));
|
||||
|
||||
String maxSpeed = OsmAndFormatter.getFormattedSpeed(analysis.maxSpeed, app);
|
||||
String minSpeed = OsmAndFormatter.getFormattedSpeed(analysis.minSpeed, app);
|
||||
String maxMinSpeed;
|
||||
if (maxSpeed.contains(" ")) {
|
||||
maxMinSpeed = maxSpeed.substring(0, maxSpeed.indexOf(" ")).concat("/").concat(minSpeed);
|
||||
} else {
|
||||
maxMinSpeed = maxSpeed.substring(0, maxSpeed.indexOf("-")).concat("/").concat(minSpeed);
|
||||
}
|
||||
|
||||
if (minMaxSpeedLayoutWidth == 0) {
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
int screenWidth = metrics.widthPixels;
|
||||
int widthWithoutSidePadding = screenWidth - AndroidUtils.dpToPx(getActivity(), 32);
|
||||
int singleLayoutWidth = widthWithoutSidePadding / 3;
|
||||
int twoLayouts = 2 * (singleLayoutWidth + AndroidUtils.dpToPx(getActivity(), 3));
|
||||
minMaxSpeedLayoutWidth = widthWithoutSidePadding - twoLayouts - AndroidUtils.dpToPx(getActivity(), 28);
|
||||
}
|
||||
|
||||
minMaxSpeedPaint.getTextBounds(maxMinSpeed, 0, maxMinSpeed.length(), minMaxSpeedTextBounds);
|
||||
int minMaxStringWidth = minMaxSpeedTextBounds.width();
|
||||
|
||||
if (analysis.minSpeed == 0) {
|
||||
(convertView.findViewById(R.id.max_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
(convertView.findViewById(R.id.min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_speed_value))
|
||||
.setText(maxSpeed);
|
||||
(convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_text))
|
||||
.setText(app.getString(R.string.shared_string_max));
|
||||
} else if (minMaxStringWidth > minMaxSpeedLayoutWidth) {
|
||||
(convertView.findViewById(R.id.max_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
(convertView.findViewById(R.id.min_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.max_speed_value))
|
||||
.setText(maxSpeed);
|
||||
((TextView) convertView.findViewById(R.id.min_speed_value))
|
||||
.setText(minSpeed);
|
||||
(convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_text))
|
||||
.setText(app.getString(R.string.max_min));
|
||||
} else {
|
||||
(convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setVisibility(View.VISIBLE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_value))
|
||||
.setText(maxMinSpeed);
|
||||
(convertView.findViewById(R.id.max_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
(convertView.findViewById(R.id.min_speed_value))
|
||||
.setVisibility(View.GONE);
|
||||
((TextView) convertView.findViewById(R.id.max_min_speed_text))
|
||||
.setText(app.getString(R.string.max_min));
|
||||
}
|
||||
} else {
|
||||
speedDivider.setVisibility(View.GONE);
|
||||
speedSection.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return convertView;
|
||||
}
|
||||
}
|
||||
|
||||
private class SplitTrackAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
@Nullable
|
||||
private final GpxSelectionHelper.SelectedGpxFile mSelectedGpxFile;
|
||||
@NonNull private final TrackActivity mActivity;
|
||||
|
||||
private final List<GpxDisplayGroup> groups;
|
||||
|
||||
SplitTrackAsyncTask(@Nullable GpxSelectionHelper.SelectedGpxFile selectedGpxFile, List<GpxDisplayGroup> groups) {
|
||||
mSelectedGpxFile = selectedGpxFile;
|
||||
mActivity = getTrackActivity();
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
protected void onPostExecute(Void result) {
|
||||
if (!mActivity.isFinishing()) {
|
||||
mActivity.setSupportProgressBarIndeterminateVisibility(false);
|
||||
}
|
||||
if (mSelectedGpxFile != null) {
|
||||
List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
mSelectedGpxFile.setDisplayGroups(groups);
|
||||
}
|
||||
updateContent();
|
||||
}
|
||||
|
||||
protected void onPreExecute() {
|
||||
mActivity.setSupportProgressBarIndeterminateVisibility(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Void doInBackground(Void... params) {
|
||||
for (GpxDisplayGroup model : groups) {
|
||||
OsmandApplication application = mActivity.getMyApplication();
|
||||
if (selectedSplitInterval == 0) {
|
||||
model.noSplit(application);
|
||||
} else if (distanceSplit.get(selectedSplitInterval) > 0) {
|
||||
model.splitByDistance(application, distanceSplit.get(selectedSplitInterval));
|
||||
} else if (timeSplit.get(selectedSplitInterval) > 0) {
|
||||
model.splitByTime(application, timeSplit.get(selectedSplitInterval));
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -124,7 +124,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
private OsmandApplication app;
|
||||
private SegmentGPXAdapter adapter;
|
||||
|
||||
private GpxDisplayItemType[] filterTypes = { GpxSelectionHelper.GpxDisplayItemType.TRACK_SEGMENT };
|
||||
private GpxDisplayItemType[] filterTypes = {GpxSelectionHelper.GpxDisplayItemType.TRACK_SEGMENT};
|
||||
private List<String> options = new ArrayList<>();
|
||||
private List<Double> distanceSplit = new ArrayList<>();
|
||||
private TIntArrayList timeSplit = new TIntArrayList();
|
||||
|
@ -638,10 +638,10 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
|
||||
public void updateSplitView() {
|
||||
if (getGpx() != null) {
|
||||
SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), ((SwitchCompat)headerView.findViewById(R.id.showOnMapToggle)).isChecked(), false);
|
||||
SelectedGpxFile sf = app.getSelectedGpxHelper().selectGpxFile(getGpx(), ((SwitchCompat) headerView.findViewById(R.id.showOnMapToggle)).isChecked(), false);
|
||||
final List<GpxDisplayGroup> groups = getDisplayGroups();
|
||||
if (groups.size() > 0) {
|
||||
updateSplit(groups, ((SwitchCompat)headerView.findViewById(R.id.showOnMapToggle)).isChecked() ? sf : null);
|
||||
updateSplit(groups, ((SwitchCompat) headerView.findViewById(R.id.showOnMapToggle)).isChecked() ? sf : null);
|
||||
if (getGpxDataItem() != null) {
|
||||
updateSplitInDatabase();
|
||||
}
|
||||
|
@ -840,7 +840,6 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
for (GpxDisplayItem i : flatten(groups)) {
|
||||
adapter.add(i);
|
||||
}
|
||||
// Obsolete: adapter.setNotifyOnChange(true);
|
||||
adapter.notifyDataSetChanged();
|
||||
if (getActivity() != null) {
|
||||
updateHeader();
|
||||
|
@ -849,7 +848,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
|
||||
protected List<GpxDisplayItem> flatten(List<GpxDisplayGroup> groups) {
|
||||
ArrayList<GpxDisplayItem> list = new ArrayList<>();
|
||||
for(GpxDisplayGroup g : groups) {
|
||||
for (GpxDisplayGroup g : groups) {
|
||||
list.addAll(g.getModifiableList());
|
||||
}
|
||||
return list;
|
||||
|
@ -1645,7 +1644,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
|
||||
@Override
|
||||
public void select(View tab) {
|
||||
GPXTabItemType tabType = GPXTabItemType.valueOf((String)tab.getTag());
|
||||
GPXTabItemType tabType = GPXTabItemType.valueOf((String) tab.getTag());
|
||||
ImageView img = (ImageView) tab.findViewById(R.id.tab_image);
|
||||
int imageId = getImageId(tabType);
|
||||
switch (tabs.getTabSelectionType()) {
|
||||
|
@ -1660,7 +1659,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
|
||||
@Override
|
||||
public void deselect(View tab) {
|
||||
GPXTabItemType tabType = GPXTabItemType.valueOf((String)tab.getTag());
|
||||
GPXTabItemType tabType = GPXTabItemType.valueOf((String) tab.getTag());
|
||||
ImageView img = (ImageView) tab.findViewById(R.id.tab_image);
|
||||
int imageId = getImageId(tabType);
|
||||
switch (tabs.getTabSelectionType()) {
|
||||
|
@ -1773,12 +1772,7 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
}
|
||||
|
||||
void openSplitIntervalScreen() {
|
||||
getTrackActivity().getSupportFragmentManager()
|
||||
.beginTransaction()
|
||||
.replace(R.id.track_activity_layout, new SplitSegmentFragment())
|
||||
.addToBackStack(SplitSegmentFragment.TAG)
|
||||
.commit();
|
||||
getTrackActivity().getSlidingTabLayout().setVisibility(View.GONE);
|
||||
SplitSegmentDialogFragment.showInstance(getTrackActivity());
|
||||
}
|
||||
|
||||
private class SaveGpxAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
|
@ -1820,8 +1814,10 @@ public class TrackSegmentFragment extends OsmAndListFragment {
|
|||
private class SplitTrackAsyncTask extends AsyncTask<Void, Void, Void> {
|
||||
@Nullable
|
||||
private final SelectedGpxFile mSelectedGpxFile;
|
||||
@NonNull private final TrackSegmentFragment mFragment;
|
||||
@NonNull private final TrackActivity mActivity;
|
||||
@NonNull
|
||||
private final TrackSegmentFragment mFragment;
|
||||
@NonNull
|
||||
private final TrackActivity mActivity;
|
||||
|
||||
private final List<GpxDisplayGroup> groups;
|
||||
|
||||
|
|
Loading…
Reference in a new issue