Merge branch 'master' into trip_recording_starting_setting_show_dialog

This commit is contained in:
Skalii 2021-03-22 22:01:05 +02:00
commit 1c140011ab
36 changed files with 502 additions and 323 deletions

View file

@ -1117,8 +1117,8 @@ public class RouteResultPreparation {
if (UNMATCHED_HIGHWAY_TYPE.equals(rr.getObject().getHighway())) {
bearingDist = RouteSegmentResult.DIST_BEARING_DETECT_UNMATCHED;
}
double mpi = MapUtils.degreesDiff(prev.getBearingEnd(prev.getEndPointIndex(), bearingDist),
rr.getBearingBegin(rr.getStartPointIndex(), bearingDist));
double mpi = MapUtils.degreesDiff(prev.getBearingEnd(prev.getEndPointIndex(), Math.min(prev.getDistance(), bearingDist)),
rr.getBearingBegin(rr.getStartPointIndex(), Math.min(rr.getDistance(), bearingDist)));
if (mpi >= TURN_DEGREE_MIN) {
if (mpi < TURN_DEGREE_MIN) {
// Slight turn detection here causes many false positives where drivers would expect a "normal" TL. Best use limit-angle=TURN_DEGREE_MIN, this reduces TSL to the turn-lanes cases.

View file

@ -457,7 +457,7 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
}
public float getBearingBegin() {
return getBearingBegin(startPointIndex, DIST_BEARING_DETECT);
return getBearingBegin(startPointIndex, distance > 0 && distance < DIST_BEARING_DETECT ? distance : DIST_BEARING_DETECT);
}
public float getBearingBegin(int point, float dist) {
@ -465,7 +465,7 @@ public class RouteSegmentResult implements StringExternalizable<RouteDataBundle>
}
public float getBearingEnd() {
return getBearingEnd(endPointIndex, DIST_BEARING_DETECT);
return getBearingEnd(endPointIndex, distance > 0 && distance < DIST_BEARING_DETECT ? distance : DIST_BEARING_DETECT);
}
public float getBearingEnd(int point, float dist) {

View file

@ -39,7 +39,7 @@
<string name="shared_string_share">Κοινοποίηση</string>
<string name="shared_string_back">Προηγούμενο</string>
<string name="shared_string_continue">Συνέχεια</string>
<string name="shared_string_cancel">Ακύρωση</string>
<string name="shared_string_cancel">Άκυρο</string>
<string name="shared_string_settings">Επιλογές</string>
<string name="shared_string_enabled">Ενεργοποιημένο</string>
<string name="units_and_formats">Μονάδες μέτρησης &amp; φορμά</string>

View file

@ -213,7 +213,7 @@
<string name="by_group">Par groupe</string>
<string name="by_distance">Par distance</string>
<string name="logout_from_osmand_telegram">Se déconnecter d\'OsmAnd Tracker \?</string>
<string name="logout_from_osmand_telegram_descr">Êtes-vous sûr·e de vouloir vous déconnecter d\'OsmAnd Tracker ; vous ne pourrez pas partager votre position ni vous la position des autres \?</string>
<string name="logout_from_osmand_telegram_descr">Êtes-vous certain de vouloir vous déconnecter d\'OsmAnd Tracker \? Vous ne pourrez pas partager votre position ni voir la position des autres.</string>
<string name="live_now_description">Contacts et groupes partageant leur position avec vous.</string>
<string name="share_location_as">Partager la position comme</string>
<string name="add_device">Ajouter un périphérique</string>

View file

@ -20,9 +20,9 @@
android:layout_marginRight="@dimen/content_padding_half"
android:layout_weight="1"
android:gravity="center_vertical"
app:cardBackgroundColor="?attr/switch_button_active"
app:cardCornerRadius="4dp"
app:cardElevation="0dp">
app:cardElevation="0dp"
tools:cardBackgroundColor="?attr/switch_button_active">
<LinearLayout
android:layout_width="match_parent"

View file

@ -52,7 +52,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/average_range"
android:id="@+id/top_line_blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@ -171,7 +171,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/ascent_descent"
android:id="@+id/bottom_line_blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"

View file

@ -52,7 +52,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/distance_time_span"
android:id="@+id/top_line_blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@ -171,7 +171,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/start_end_time"
android:id="@+id/bottom_line_blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"

View file

@ -52,7 +52,7 @@
</LinearLayout>
<LinearLayout
android:id="@+id/average_max"
android:id="@+id/top_line_blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@ -172,7 +172,7 @@
<LinearLayout
android:id="@+id/time_distance"
android:id="@+id/bottom_line_blocks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"

View file

@ -15,19 +15,17 @@
layout="@layout/preference_button_with_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.1"
android:minWidth="@dimen/context_menu_top_right_button_min_width"
android:minHeight="@dimen/setting_list_item_large_height" />
<include
android:id="@+id/button_center"
layout="@layout/preference_button_with_icon"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="@dimen/content_padding_half"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_weight="0.8"
android:minWidth="@dimen/button_triple_center_width"
android:layout_weight="1"
android:minHeight="@dimen/setting_list_item_large_height" />
<include
@ -37,7 +35,6 @@
android:layout_height="match_parent"
android:layout_marginStart="@dimen/content_padding_half"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_weight="0.1"
android:minWidth="@dimen/context_menu_top_right_button_min_width"
android:minHeight="@dimen/setting_list_item_large_height" />

View file

@ -1873,7 +1873,6 @@
<string name="total_distance">Συνολική απόσταση</string>
<string name="routing_attr_relief_smoothness_factor_name">Επιλέξτε διακύμανση ανύψωσης</string>
<string name="routing_attr_height_obstacles_name">Χρήση υψομετρικών δεδομένων</string>
<string name="rendering_attr_depthContours_description">Εμφάνιση ισοβαθών καμπυλών και σημείων.</string>
<string name="rendering_attr_depthContours_name">Ναυτικές ισοβαθείς καμπύλες</string>
<string name="auto_split_recording_title">Αυτόματος διαχωρισμός καταγραφών μετά από κενό</string>
@ -2516,7 +2515,7 @@
<string name="commit_poi">Υποβολή ΣΕ</string>
<string name="tab_title_basic">Βασικό</string>
<string name="tab_title_advanced">Προχωρημένο</string>
<string name="building_number">Αριθμός κτιρίου</string>
<string name="building_number">Αριθμός κτηρίου</string>
<string name="next_proceed">Επόμενο</string>
<string name="opening_at">Άνοιγμα στις</string>
<string name="closing_at">Κλείσιμο στις</string>

View file

@ -1449,4 +1449,7 @@
<string name="poi_protected_area">منطقهٔ حفاظت‌شده</string>
<string name="poi_badminton">بدمینتون</string>
<string name="poi_service_car">خدمات خودرو; مکانیکی</string>
<string name="poi_substation_type">نوع</string>
<string name="poi_mini_roundabout">فلکهٔ کوچک</string>
<string name="poi_square">میدان</string>
</resources>

View file

@ -3886,4 +3886,10 @@
<string name="poi_piste_status_open">Statut de la piste : ouvert</string>
<string name="poi_piste_name">Nom de la piste</string>
<string name="poi_piste_ski_jump">Saut à ski</string>
<string name="poi_summit_register_no">Livre d\'or au sommet : non</string>
<string name="poi_summit_register_yes">Livre d\'or au sommet : oui</string>
<string name="poi_patrolled_no">Surveillé : non</string>
<string name="poi_patrolled_yes">Surveillé : oui</string>
<string name="poi_local_ref">Référence locale</string>
<string name="poi_geodesist">Géodésien</string>
</resources>

View file

@ -4033,4 +4033,6 @@
<string name="select_segments_description">%1$s contient plus d\'un segment, vous devez sélectionner le tronçon nécessaire à la navigation.</string>
<string name="routing_attr_driving_style_description">Sélectionnez le mode de conduite pour avoir l\'itinéraire le plus court, le plus rapide, ou le plus sûr</string>
<string name="quick_action_coordinates_widget_descr">Appuyer pour afficher ou cacher le widget Coordonnées sur la carte.</string>
<string name="snap_to_road_descr">Licône de localisation va se déplacer sur le trajet en cours.</string>
<string name="select_another_colorization">Veuillez sélectionner un autre type de colorisation.</string>
</resources>

View file

@ -2084,7 +2084,6 @@ POIの更新は利用できません</string>
<string name="shared_string_time">時間</string>
<string name="total_distance">総走行距離</string>
<string name="routing_attr_height_obstacles_name">標高データを使用</string>
<string name="rendering_attr_hideWaterPolygons_description">水域</string>
<string name="rendering_attr_hideWaterPolygons_name">水域ポリゴン</string>
<string name="wiki_around">近隣のWikipedia記事</string>
@ -2133,14 +2132,14 @@ POIの更新は利用できません</string>
<string name="quick_action_take_photo_note_descr">画面中央に写真メモを追加するボタンです。</string>
<string name="quick_action_add_osm_bug_descr">画面中央にOSMメモを追加するボタンです。</string>
<string name="quick_action_add_poi_descr">画面中央にPOIを追加できるボタンです。</string>
<string name="quick_action_navigation_voice_descr">ナビゲーション中の案内音声の有効無効を切り替えることが出来ます。</string>
<string name="quick_action_navigation_voice_descr">ナビゲーション中の案内音声の有効/無効を切り替えます。</string>
<string name="quick_action_add_parking_descr">画面中央に駐車場所を追加するボタンです。</string>
<string name="quick_action_interim_dialog">実行時に入力画面を表示</string>
<string name="favorite_empty_place_name">場所</string>
<string name="quick_action_duplicates">重複を避けるためにクイックアクション名は[%1$s]に変更されました。</string>
<string name="quick_action_duplicate">クイックアクション名の重複</string>
<string name="quick_action_showhide_favorites_descr">マップ画面でのお気に入り地点の表示/非表示の切替が出来ます。</string>
<string name="quick_action_showhide_poi_descr">マップ画面でのPOIの表示/非表示の切替が出来ます。</string>
<string name="quick_action_showhide_favorites_descr">マップ画面でのお気に入り地点の表示/非表示を切り替えます。</string>
<string name="quick_action_showhide_poi_descr">マップ画面でのPOIの表示/非表示を切り替えます。</string>
<string name="quick_action_poi_show">%1$sを表示</string>
<string name="quick_action_poi_hide">%1$sを非表示</string>
<string name="quick_action_add_category">カテゴリーを追加</string>
@ -2546,7 +2545,7 @@ POIの更新は利用できません</string>
<string name="by_type">種類別</string>
<string name="digits_quantity">小数点以下の桁数</string>
<string name="go_to_next_field">次の入力項目へ移動</string>
<string name="tap_on_map_to_hide_interface_descr">マップ画面のタップで操作ボタンやウィジェットの表示と交互に切り替えます。</string>
<string name="tap_on_map_to_hide_interface_descr">マップ画面のタップで操作ボタンやウィジェットの表示切り替えます。</string>
<string name="tap_on_map_to_hide_interface">フルスクリーンモード</string>
<string name="live_monitoring_max_interval_to_send">オンライン追跡用のバッファ指定</string>
<string name="live_monitoring_max_interval_to_send_desrc">送信用現在地データをネット接続せずにどのくらいの時間記録するか、バッファを指定します</string>
@ -2829,7 +2828,7 @@ POIの更新は利用できません</string>
<string name="osm_recipient_stat">編集 %1$s, 合計 %2$s mBTC</string>
<string name="shared_string_launch">起動</string>
<string name="lang_gn_py">グアラニー語</string>
<string name="quick_action_switch_day_night_descr">OsmAndマップ表示の昼/夜モードを切り替えることが出来ます。</string>
<string name="quick_action_switch_day_night_descr">OsmAndマップ表示の昼/夜モードを切り替えます。</string>
<string name="quick_action_switch_day_mode">昼モード</string>
<string name="quick_action_switch_night_mode">夜モード</string>
<string name="quick_action_day_night_switch_mode">昼/夜モードの切り替え</string>
@ -3715,7 +3714,7 @@ POIの更新は利用できません</string>
<string name="vessel_height_warning">低い橋を避けるために船の高さを調整できます。橋が可動式の場合は、開いた状態の高さが参照されます。</string>
<string name="vessel_height_limit_description">低い橋を避けるために船の高さを設定します。注:橋が可動式の場合は、開いた状態の高さが参照されます。</string>
<string name="vessel_width_limit_description">狭い橋を避けるために船の幅を設定します</string>
<string name="quick_action_showhide_mapillary_descr">マップ上のMapillaryレイヤーの表示/非表示を切り替えるトグルボタンです。</string>
<string name="quick_action_showhide_mapillary_descr">マップ上のMapillaryレイヤーの表示/非表示を切り替えす。</string>
<string name="routing_attr_length_description">ルート検索時に指定した車両の長さを考慮します。</string>
<string name="routing_attr_length_name">長さ制限</string>
<string name="shared_string_bearing">ベアリング</string>
@ -3849,4 +3848,106 @@ POIの更新は利用できません</string>
\nグラフは再計算後に利用できるようになります。</string>
<string name="use_dev_url_descr">OSM通知/ POI / GPXのアップロードをテストする場合、openstreetmap.orgではなくdev.openstreetmap.orgを使用するよう切り替えます。</string>
<string name="use_dev_url">dev.openstreetmap.orgを使用</string>
<string name="announcement_time_prepare">次々回案内(中距離)</string>
<string name="announcement_time_prepare_long">次回案内(長距離)</string>
<string name="shared_string_sec"></string>
<string name="announcement_time_passing">通過する</string>
<string name="announcement_time_approach">目標に接近</string>
<string name="shared_string_turn">方向転換</string>
<string name="announcement_time_off_route">ルートからの逸脱</string>
<string name="announcement_time_arrive">目的地に到着</string>
<string name="announcement_time_intervals">タイミングと距離の間隔</string>
<string name="announcement_time_title">案内タイミング</string>
<string name="announcement_time_descr">音声による案内タイミングは、音声形式、現在のナビゲーション速度、および標準のナビゲーション速度によって異なります。</string>
<string name="start_recording">記録の開始</string>
<string name="show_track_on_map">マップ上に経路を表示</string>
<string name="routing_engine_vehicle_type_wheelchair">車椅子</string>
<string name="routing_engine_vehicle_type_hiking">ハイキング</string>
<string name="routing_engine_vehicle_type_walking">徒歩</string>
<string name="routing_engine_vehicle_type_cycling_electric">電動自転車</string>
<string name="routing_engine_vehicle_type_cycling_mountain">山岳(MTB)サイクリング</string>
<string name="routing_engine_vehicle_type_cycling_road">ロードサイクリング</string>
<string name="routing_engine_vehicle_type_cycling_regular">一般的なサイクリング</string>
<string name="routing_engine_vehicle_type_hgv">重量物運搬車</string>
<string name="routing_engine_vehicle_type_small_truck">小型トラック</string>
<string name="routing_engine_vehicle_type_truck">トラック</string>
<string name="routing_engine_vehicle_type_scooter">スクーター</string>
<string name="routing_engine_vehicle_type_racingbike">レーシングバイク</string>
<string name="routing_engine_vehicle_type_mtb">マウンテンバイク</string>
<string name="message_server_error">サーバーエラー: %1$s</string>
<string name="message_name_is_already_exists">この名前はすでに存在します</string>
<string name="delete_online_routing_engine">このオンラインルーティングエンジンを削除しますか?</string>
<string name="context_menu_read_full">全文を読む</string>
<string name="context_menu_edit_descr">説明の編集</string>
<string name="delete_waypoints">経由地点を削除</string>
<string name="copy_to_map_markers">マップマーカーにコピー</string>
<string name="copy_to_map_favorites">お気に入りにコピー</string>
<string name="upload_photo">アップロード中</string>
<string name="upload_photo_completed">アップロードが完了しました</string>
<string name="uploading_count">%2$d個中%1$d個をアップロード中</string>
<string name="select_segments">セグメントの選択</string>
<string name="select_segments_description">%1$sには複数のセグメントが含まれているため、ナビゲーションに必要な部分を選択する必要があります。</string>
<string name="segments_count">%1$dセグメント</string>
<string name="uploaded_count">%2$d個中%1$d個をアップロードしました</string>
<string name="toast_select_edits_for_upload">アップロードする編集を選択</string>
<string name="hillshade_slope_contour_lines">陰影起伏図 / 勾配 / 等高線</string>
<string name="open_place_reviews_plugin_description">OpenPlaceReviewsは、レストラン、ホテル、美術館、中途経由地点などの公共の場所に関するコミュニティが運営するプロジェクトです。写真、レビュー、他のシステムへのリンク、OpenStreetMap、Wikipediaへのリンクなど、それらに関するすべての公開情報を収集しています。
\n
\nOpenPlaceReviewデータは全て公開されており、誰でもアクセス可能です。http://openplacereviews.org/data
\n
\n詳細については下記サイトをご覧ください。http://openplacereviews.org</string>
<string name="open_place_reviews">OpenPlaceReviews</string>
<string name="opr_use_dev_url">test.openplacereviews.orgを使用</string>
<string name="login_open_place_reviews">OpenPlaceReviewsにログイン</string>
<string name="activity_type_water_name"></string>
<string name="activity_type_winter_name"></string>
<string name="activity_type_snowmobile_name">スノーモービル</string>
<string name="activity_type_riding_name">乗馬</string>
<string name="activity_type_racing_name">レーシング</string>
<string name="activity_type_mountainbike_name">マウンテンバイク</string>
<string name="activity_type_cycling_name">自転車</string>
<string name="activity_type_hiking_name">ハイキング</string>
<string name="activity_type_running_name">ランニング</string>
<string name="activity_type_walking_name">徒歩</string>
<string name="activity_type_offroad_name">未舗装道路</string>
<string name="activity_type_motorbike_name">オートバイ</string>
<string name="routing_attr_short_way_description">最適化されたなるべく短いルート (省エネ)</string>
<string name="activity_type_car_name"></string>
<string name="temporary_conditional_routing_descr">マップ上で現在有効になっている道路の制限を使用します</string>
<string name="routing_attr_driving_style_description">運転の目的を選択することで、より短くより速くより安全なルートを取得します</string>
<string name="snap_to_road_descr">現在地アイコンが現在のナビゲーションルートに保持されます</string>
<string name="map_orientation_threshold_descr">速度がしきい値未満の場合は、マップビューを回転させないでください</string>
<string name="restart">再起動</string>
<string name="shared_strings_all_regions">すべての地域</string>
<string name="delete_number_files_question">%1$d個のファイルを削除しますか</string>
<string name="track_recording_stop_without_saving">保存せずに終了</string>
<string name="track_recording_description">記録を停止してもよろしいですか?
\n保存しない場合データはすべて失われます。</string>
<string name="track_recording_save_and_stop">記録を保存して終了</string>
<string name="track_recording_title">記録を停止しました</string>
<string name="on_pause">一時停止中</string>
<string name="app_restart_required">一部の設定を適用するには、アプリケーションの再起動が必要です。</string>
<string name="routing_attr_height_obstacles_description">ルート検索時になるべく急な上り坂を回避するようにします。</string>
<string name="quick_action_coordinates_widget_descr">マップ上で座標ウィジェットの表示/非表示を切り替えます。</string>
<string name="map_widget_distance_by_tap">タップで距離</string>
<string name="latest_openstreetmap_update">利用可能な最新OpenStreetMapの更新:</string>
<string name="updated">更新: %s</string>
<string name="last_time_checked">最後にチェック時間: %s</string>
<string name="update_frequency">更新間隔</string>
<string name="live_update_frequency_week_variant">マップの更新は毎週チェックされます。次回は%2$sの%1$sです。</string>
<string name="live_update_frequency_day_variant">マップの更新は毎日チェックされます。次回は%2$sの%1$sです。</string>
<string name="live_update_frequency_hour_variant">マップの更新は1時間ごとにチェックされます。次回は%2$sの%1$sです。</string>
<string name="delete_updates">更新の削除</string>
<string name="live_update_delete_updates_msg">%sのライブアップデートをすべて削除してもよろしいですか</string>
<string name="purchases">購入</string>
<string name="select_category_descr">カテゴリを選択するか、新しいカテゴリを追加します</string>
<string name="track_recording_will_be_continued">記録を継続します。</string>
<string name="copy_poi_name">POI名をコピー</string>
<string name="quick_action_show_hide_title">表示/非表示</string>
<string name="shared_string_interval">間隔</string>
<string name="rendering_attr_noNatureReserveBoundaries_description">自然保護区、保護地域、国立公園の境界を非表示にします</string>
<string name="rendering_attr_noNatureReserveBoundaries_name">自然保護区の境界</string>
<string name="track_has_no_altitude">経路には標高データは含まれていません。</string>
<string name="track_has_no_speed">経路には速度データは含まれていません。</string>
<string name="select_another_colorization">別タイプのカラーを選択してください。</string>
</resources>

View file

@ -1626,7 +1626,7 @@
<string name="poi_historic_civilization_ancient_egyptian">Sivilisasjon: Det gamle Egypt (inntil 332 f.Kr.)</string>
<string name="poi_historic_civilization_imperial_chinese">Sivilisasjon: Det kinesiske keiserriket (221 f.Kr. 1911 e.Kr.)</string>
<string name="poi_historic_stone">Historisk stein</string>
<string name="poi_historic_era_neolithic">Historisk periode: neolittisk tid</string>
<string name="poi_historic_era_neolithic">Historisk periode: neolittisk tid (yngre steinalder)</string>
<string name="poi_historic_era_mesolithic">Historisk periode: mesolittisk tid</string>
<string name="poi_historic_era_paleolithic">Historisk periode: paleolittisk tid (2,6 millioner 10000 år før nåtid)</string>
<string name="poi_historic_period_ptolemaic_egypt">Historisk periode: Det ptolemeiske Egypt (305 f.Kr. 30 f.Kr.)</string>
@ -1647,4 +1647,42 @@
<string name="poi_historic_civilization_prehistoric">Sivilisasjon: forhistorisk tid</string>
<string name="poi_historic_manor">Historisk herregård</string>
<string name="poi_historic_yes">Historisk objekt</string>
<string name="poi_material_limestone">Materiale: kalkstein</string>
<string name="poi_material_granite_stone">Materiale: granittstein</string>
<string name="poi_material_sandstone">Materiale: sandstein</string>
<string name="poi_material_stone">Materiale: stein</string>
<string name="poi_social_facility_shelter">Husly</string>
<string name="poi_route_subway_ref">T-bane</string>
<string name="poi_route_ferry_ref">Ferge</string>
<string name="poi_route_bus_ref">Buss</string>
<string name="poi_surface_snow">Overflate: snø</string>
<string name="poi_surface_salt">Overflate: salt</string>
<string name="poi_surface_ice">Overflate: is</string>
<string name="poi_surface_mud">Overflate: gjørme</string>
<string name="poi_surface_dirt">Overflate: jord</string>
<string name="poi_surface_ground">Overflate: jord</string>
<string name="poi_surface_grass">Overflate: gress</string>
<string name="poi_surface_sand">Overflate: sand</string>
<string name="poi_surface_compacted">Overflate: komprimert</string>
<string name="poi_surface_fine_gravel">Overflate: fin grus</string>
<string name="poi_surface_gravel">Overflate: grus</string>
<string name="poi_surface_wood">Overflate: tre</string>
<string name="poi_surface_metal">Overflate: metall</string>
<string name="poi_surface_stone">Overflate: stein</string>
<string name="poi_surface_pebblestone">Overflate: rullestein (liten)</string>
<string name="poi_surface_paving_stones">Overflate: belegningsstein</string>
<string name="poi_surface_cobblestone">Overflate: kuppelstein</string>
<string name="poi_surface_sett">Overflate: brostein</string>
<string name="poi_surface_concrete">Overflate: betong</string>
<string name="poi_surface_asphalt">Overflate: asfalt</string>
<string name="poi_surface_paved">Overflate: fast dekke</string>
<string name="poi_surface_unpaved">Overflate: uten fast dekke</string>
<string name="poi_shelter_type_lean_to">Gapahuk</string>
<string name="poi_resource_stone">Stein</string>
<string name="poi_resource_sandstone">Sandstein</string>
<string name="poi_resource_limestone">Kalkstein</string>
<string name="poi_memorial_stone">Stein</string>
<string name="poi_barrier_entrance">Passasje i en mur eller et gjerde</string>
<string name="poi_shelter">Ly</string>
<string name="poi_boundary_stone">Grensestein</string>
</resources>

View file

@ -167,7 +167,7 @@
<string name="use_fluorescent_overlays">Fluorescerende overlegg</string>
<string name="use_fluorescent_overlays_descr">Bruk fluorescerende farger til å vise spor og ruter.</string>
<string name="offline_edition">Frakoblet redigering</string>
<string name="offline_edition_descr">Bruk alltid frakoblet redigering.</string>
<string name="offline_edition_descr">Hvis redigering uten nett er aktivert, lagres endringer lokalt først og lastes opp på forespørsel, ellers vil endringer bli lastet opp umiddelbart.</string>
<string name="free_version_message">Du kan laste ned eller oppdatere %1$s kart.</string>
<string name="free_version_title">Gratisversjon</string>
<string name="poi_context_menu_showdescription">Vis interessepunkt-beskrivelse.</string>
@ -401,7 +401,7 @@
<string name="search_offline_address">Offline-søk</string>
<string name="search_online_address">Nettbasert søk</string>
<string name="max_level_download_tile">Maks. nettbasert zoom</string>
<string name="max_level_download_tile_descr">Ikke bla gjennom nettbaserte kartfliser for zoomnivåer utover dette.</string>
<string name="max_level_download_tile_descr">Ikke bla gjennom nettbaserte kart for zoomnivåer utover dette.</string>
<string name="route_general_information">Total distanse %1$s, reisetid %2$d t %3$d min.</string>
<string name="router_service_descr">Nettbasert eller frakoblet navigeringstjeneste.</string>
<string name="router_service">Navigeringstjeneste</string>
@ -1492,7 +1492,7 @@
<string name="wait_current_task_finished">Vent til gjeldende oppgave er ferdig</string>
<string name="recording_delete_confirm">Slett dette elementet\?</string>
<string name="osmand_parking_delete">Slett parkeringsplassmarkør</string>
<string name="local_openstreetmap_delete">Slett endring</string>
<string name="local_openstreetmap_delete">Slett redigering</string>
<string name="poi_dialog_reopen">Gjenåpne</string>
<string name="do_you_like_osmand">Liker du OsmAnd\?</string>
<string name="building_number">Bygningsnummer</string>
@ -1520,7 +1520,7 @@
<string name="lang_kn">Kannada</string>
<string name="app_mode_bus">Buss</string>
<string name="app_mode_train">Tog</string>
<string name="voice_data_unavailable">Valgte taledata er ikke tilgjengelig</string>
<string name="voice_data_unavailable">Valgte talemeldingspakke er ikke tilgjengelig</string>
<string name="voice_data_corrupted">Spesifisert taledata er ødelagt</string>
<string name="voice_data_not_supported">Taledataversjon som ikke støttes</string>
<string name="background_router_service_descr">Sporer posisjonen din mens skjermen er slått av.</string>
@ -2173,7 +2173,7 @@
<string name="validate_gpx_upload_name_pwd">Angi ditt OSM-brukernavn og passord for å laste opp GPX-filer.</string>
<string name="support_new_features_descr">Doner for å se nye funksjoner implementert i programmet.</string>
<string name="local_openstreetmap_uploadall">Last opp alle</string>
<string name="local_openstreetmap_upload">Last opp endring til OSM</string>
<string name="local_openstreetmap_upload">Last opp redigering til OSM</string>
<string name="local_openstreetmap_descr_title">Asynkron OSM-redigering:</string>
<string name="live_monitoring_interval_descr">Oppgi det nettbaserte sporingsintervallet.</string>
<string name="live_monitoring_interval">Nettbasert sporingsintervall</string>
@ -2239,7 +2239,7 @@
<string name="quick_action_add_parking">Legg til parkeringsplass</string>
<string name="quick_action_edit_action">Rediger handling</string>
<string name="quick_actions_delete">Slett handling</string>
<string name="quick_favorites_name_preset">Navneforvalg</string>
<string name="quick_favorites_name_preset">Forhåndsinnstilt navn</string>
<string name="quick_action_add_marker_descr">En knapp for å legge til en kartmarkør i skjermsenteret.</string>
<string name="quick_action_add_gpx_descr">En knapp for å legge til et GPX-rutepunkt i midten av skjermen.</string>
<string name="quick_action_take_audio_note_descr">En knapp for å legge til et lydnotat i midten av skjermen.</string>
@ -2829,7 +2829,7 @@
<string name="routeInfo_roadClass_name">Veitype</string>
<string name="routeInfo_surface_name">Overflate</string>
<string name="routeInfo_smoothness_name">Jevnhet</string>
<string name="routeInfo_steepness_name">Stigning</string>
<string name="routeInfo_steepness_name">Bratthet</string>
<string name="add_home">Legg til bosted</string>
<string name="add_work">Legg til arbeidssted</string>
<string name="work_button">Arbeid</string>
@ -2865,9 +2865,9 @@
<string name="rendering_attr_surface_paved_name">Fast dekke</string>
<string name="rendering_attr_surface_concrete_name">Betong</string>
<string name="rendering_attr_surface_sett_name">Brostein</string>
<string name="rendering_attr_surface_cobblestone_name">Naturlig brostein</string>
<string name="rendering_attr_surface_paving_stones_name">Steinbelagt</string>
<string name="rendering_attr_surface_pebblestone_name">Rullestein</string>
<string name="rendering_attr_surface_cobblestone_name">Kuppelstein</string>
<string name="rendering_attr_surface_paving_stones_name">Belegningsstein</string>
<string name="rendering_attr_surface_pebblestone_name">Rullestein (liten)</string>
<string name="rendering_attr_surface_stone_name">Stein</string>
<string name="rendering_attr_surface_metal_name">Metall</string>
<string name="rendering_attr_surface_wood_name">Tre</string>
@ -2907,8 +2907,8 @@
<string name="shared_string_milliradians">Milliradianer</string>
<string name="angular_measeurement">Vinkel-måleenheter</string>
<string name="angular_measeurement_descr">Endre hva asimut måles i.</string>
<string name="routing_attr_avoid_sett_name">Ingen rustikk brostein eller brostein</string>
<string name="routing_attr_avoid_sett_description">Unngår rustikk brostein og brostein</string>
<string name="routing_attr_avoid_sett_name">Ingen kuppelstein eller brostein</string>
<string name="routing_attr_avoid_sett_description">Unngår kuppelstein og brostein</string>
<string name="routing_attr_avoid_tram_name">Ingen trikk</string>
<string name="routing_attr_avoid_tram_description">Unngår trikk</string>
<string name="routing_attr_avoid_bus_name">Ingen buss</string>
@ -3145,7 +3145,8 @@
<string name="shared_string_other">Annet</string>
<string name="shared_preference">Delt</string>
<string name="layer_osm_edits">OSM-redigeringer</string>
<string name="new_route_calculated_dist_dbg">Rute: Distanse %1$s, rutingstid %2$s \nUtregning: %3$.1f sec, %4$d veier, %5$d flis)</string>
<string name="new_route_calculated_dist_dbg">Rute: Distanse %1$s, rutetid %2$s
\nBeregning: %3$.1f sek., %4$d veier, %5$d fliser)</string>
<string name="contour_lines_and_hillshade">Koter og relieffskygge</string>
<string name="update_all_maps">Oppdater alle kart</string>
<string name="update_all_maps_q">Er du sikker på at du vil oppdatere alle (%1$d) kart\?</string>

View file

@ -3748,7 +3748,7 @@
\n
\n</string>
<string name="what_is_new">Wat is er nieuw</string>
<string name="snowmobile_render_descr">Voor sneeuwscooter, rijden met speciale wegen en tracks.</string>
<string name="snowmobile_render_descr">Voor sneeuwscooter, rijden op speciale wegen en tracks.</string>
<string name="set_working_days_to_continue">Stel werkdagen in om door te gaan</string>
<string name="gpx_split_interval_descr">Selecteer het interval waarmee markeringen met afstand of tijd op de track worden weergegeven.</string>
<string name="gpx_split_interval_none_descr">Selecteer de gewenste splitsingsoptie: op tijd of op afstand.</string>

View file

@ -4037,9 +4037,9 @@
<string name="copy_poi_name">Копировать имя POI</string>
<string name="shared_string_interval">Интервал</string>
<string name="rendering_attr_noNatureReserveBoundaries_description">Скрыть природный заповедник, особо охраняемые природные территории и границы национального парка</string>
<string name="gpx_upload_trackable_visibility_descr">«Отслеживаемый» означает, что трек не будет виден в любых общедоступных списках, но обработанные точки из него будут доступны через public GPS API c временными отметками. Другие пользователи смогут лишь загружать обработанные точки из вашего трека. При этом трек не будет ассоциирован с вами.</string>
<string name="gpx_upload_identifiable_visibility_descr">«Идентифицируемый» означает, что трек будет виден всем в разделе треки пользователя, загрузившего трек и в общем списке треков, доступным на закладке GPS-треки. Другие пользователи смогут загрузить данные трека и в свойствах трека будет указано имя пользователя, загрузившего трек. Отметки времени точек трека доступны через public GPS API.</string>
<string name="gpx_upload_public_visibility_descr">«Общедоступный» означает, что трек будет виден всем в разделе треки пользователя, загрузившего трек и в общем списке треков, доступным на закладке GPS-треки. Отметки времени точек трека не доступны через public GPS API. Однако, другие пользователи по-прежнему могут загрузить файл трека из общего списка треков и данные трека будут иметь все отметки времени.</string>
<string name="gpx_upload_trackable_visibility_descr">«Отслеживаемый» означает, что трек не будет виден в любых общедоступных списках, но обработанные точки c отметками времени из него будут доступны через public GPS API (при этом трек не будет ассоциирован с вами). Другие пользователи смогут лишь загружать обработанные точки из вашего трека.</string>
<string name="gpx_upload_identifiable_visibility_descr">«Идентифицируемый» означает, что трек будет виден всем в разделе треки пользователя, загрузившего трек и в общем списке треков, доступном на странице GPS-треки. Другие пользователи смогут загрузить данные трека и в свойствах трека будет указано имя пользователя, загрузившего трек. Отметки времени точек трека доступны через public GPS API будут ссылаться на страницу с вашим оригинальным треком.</string>
<string name="gpx_upload_public_visibility_descr">«Общедоступный» означает, что трек будет виден всем в разделе треки пользователя, загрузившего трек и в общем списке треков, доступном на странице GPS-треки. Отметки времени точек трека не доступны через public GPS API. Однако, другие пользователи по-прежнему могут загрузить файл трека из общего списка треков и данные трека будут иметь все отметки времени.</string>
<string name="gpx_upload_private_visibility_descr">«Частный» означает, что трек не будет виден в любых общедоступных списках, но точки из него будут доступны через public GPS API без отметок времени.</string>
<string name="routing_attr_driving_style_description">Выберите цель, чтобы проложить к ней короткий, быстрый или безопасный маршрут</string>
<string name="delete_number_files_question">Удалить %1$d файлов\?</string>

View file

@ -3253,4 +3253,80 @@
<string name="poi_climbing_crag_filter">Klättring</string>
<string name="poi_rtsa_scale_filter">Svårighetskategori</string>
<string name="poi_park_ride">Parkera och åk</string>
<string name="poi_socket_tesla_roadster_output">Uttag: Tesla Roadster: utgående</string>
<string name="poi_socket_tesla_roadster_current">Uttag: Tesla Roadster: ström</string>
<string name="poi_socket_tesla_roadster">Uttag: Tesla Roadster</string>
<string name="poi_socket_tesla_supercharger">Uttag: Tesla Supercharger</string>
<string name="poi_socket_tesla_supercharger_output">Uttag: Tesla Supercharger: utgående</string>
<string name="poi_socket_tesla_supercharger_current">Uttag: Tesla Supercharger: ström</string>
<string name="poi_socket_tesla_standard_output">Uttag: Tesla standard: utgående</string>
<string name="poi_socket_tesla_standard_current">Uttag: Tesla standard: ström</string>
<string name="poi_socket_tesla_standard">Uttag: Tesla standard</string>
<string name="poi_socket_chademo_output">Uttag: CHAdeMO: utgående</string>
<string name="poi_socket_chademo_current">Uttag: CHAdeMO: ström</string>
<string name="poi_socket_chademo">Uttag: CHAdeMO</string>
<string name="poi_socket_type3_output">Uttag: Typ 3: utgeånde</string>
<string name="poi_socket_type3_current">Uttag: Typ 3: ström</string>
<string name="poi_socket_type3">Uttag: Typ 3</string>
<string name="poi_socket_type2_combo_output">Uttag: Typ 2: utgeånde</string>
<string name="poi_socket_type2_combo_current">Uttag: Typ 2 kombo: ström</string>
<string name="poi_socket_type2_combo">Uttag: Typ 2 kombo</string>
<string name="poi_socket_type2_output">Uttag: Typ 2: utgående</string>
<string name="poi_socket_type2_current">Uttag: Typ 2: ström</string>
<string name="poi_socket_type2">Uttag: Typ 2</string>
<string name="poi_socket_type1_combo_current">Uttag: Typ 1 kombo: ström</string>
<string name="poi_socket_type1_combo">Uttag: Typ 1 kombo</string>
<string name="poi_socket_type1_output">Uttag: Typ 1: utgående</string>
<string name="poi_socket_type1_current">Uttag: Typ 1: ström</string>
<string name="poi_socket_type1">Uttag: Typ 1</string>
<string name="poi_socket_type1_combo_output">Uttag: Typ 1 kombo: utgående</string>
<string name="poi_socket_cee_red_125a_output">Uttag: CEE röd 125A: utgående</string>
<string name="poi_socket_cee_red_125a_current">Uttag: CEE röd 125A: ström</string>
<string name="poi_socket_cee_red_125a">Uttag: CEE röd 125A</string>
<string name="poi_socket_cee_red_64a_output">Uttag: CEE röd 64A: utgående</string>
<string name="poi_socket_cee_red_64a_current">Uttag: CEE röd 64A: ström</string>
<string name="poi_socket_cee_red_64a">Uttag: CEE röd 64A</string>
<string name="poi_socket_cee_red_32a_output">Uttag: CEE röd 32A: utgående</string>
<string name="poi_socket_cee_red_32a_current">Uttag: CEE röd 32A: ström</string>
<string name="poi_socket_cee_red_32a">Uttag: CEE röd 32A</string>
<string name="poi_socket_cee_red_16a_output">Uttag: CEE röd 16A: utgående</string>
<string name="poi_socket_cee_red_16a_current">Uttag: CEE röd 16A: ström</string>
<string name="poi_socket_cee_red_16a">Uttag: CEE röd 16A</string>
<string name="poi_socket_cee_blue_output">Uttag: CEE blå: utgående</string>
<string name="poi_socket_cee_blue_current">Uttag: CEE blå: ström</string>
<string name="poi_socket_cee_blue">Uttag: CEE blå</string>
<string name="poi_water_place_access_multifamilies">Multi familj</string>
<string name="poi_water_place_access_family">Familj</string>
<string name="poi_water_place_access_community">Gemenskap</string>
<string name="poi_water_supply_bottled_water">Flaskvatten</string>
<string name="poi_water_supply_water_tank">Vattentank</string>
<string name="poi_water_supply_water_trucking">Vattentransporter</string>
<string name="poi_water_supply_borehole">Borrhål</string>
<string name="poi_water_supply_pump">Pump</string>
<string name="poi_water_supply_running_water">Rinnande vatten</string>
<string name="poi_water_supply_pipeline">Rörledning</string>
<string name="poi_water_supply_water_well">Vattenbrunn</string>
<string name="poi_water_purification_aquatabs">Aquatabs</string>
<string name="poi_water_purification_reverse_osmosis">Omvänd osmos</string>
<string name="poi_water_purification_chlorine">Klor</string>
<string name="poi_water_purification_none">Ingen</string>
<string name="poi_water_place_durability_emergency">Hållbarhet på vattenplats: kritiskt</string>
<string name="poi_water_place_durability_durable">Hållbarhet på vattenplats: hållbar</string>
<string name="poi_operational_status_needs_maintenance">Behöver underhåll</string>
<string name="poi_operational_status_broken">Trasig</string>
<string name="poi_operational_status_restricted">Begränsad</string>
<string name="poi_operational_status_closed">Stängd</string>
<string name="poi_operational_status_open">Öppen</string>
<string name="poi_visibility_area">Plats: area</string>
<string name="poi_visibility_street">Plats: väg</string>
<string name="poi_visibility_house">Plats: hus</string>
<string name="poi_location_entrance">Plats: entre</string>
<string name="poi_location_wall">Plats: vägg</string>
<string name="poi_location_bridge">Plats: bro</string>
<string name="poi_location_kiosk">Plats: kiosk</string>
<string name="poi_location_platform">Plats: plattform</string>
<string name="poi_location_indoor">Plats: inne</string>
<string name="poi_location_outdoor">Plats: ute</string>
<string name="poi_location_rooftop">Plats: tak</string>
<string name="poi_location_roof">Plats: tak</string>
</resources>

View file

@ -769,4 +769,6 @@
<string name="poi_charging_station">充电站</string>
<string name="poi_takeaway_no">无外卖</string>
<string name="poi_takeaway_only">仅限外卖</string>
<string name="poi_pharmacy_dispensing">配药</string>
<string name="poi_automated">自动化</string>
</resources>

View file

@ -418,5 +418,4 @@
<dimen name="descriptionLineSpacingExtra">3sp</dimen>
<dimen name="list_item_triple_row_height">80dp</dimen>
<dimen name="button_triple_center_width">160dp</dimen>
</resources>

View file

@ -139,7 +139,7 @@ public class PluginInfoFragment extends BaseOsmAndFragment implements PluginStat
if (settingsScreenType != null) {
Bundle args = new Bundle();
args.putBoolean(PLUGIN_INFO, true);
BaseSettingsFragment.showInstance(activity, settingsScreenType, null, args);
BaseSettingsFragment.showInstance(activity, settingsScreenType, null, args, null);
}
}
}

View file

@ -9,25 +9,27 @@ import android.text.SpannableStringBuilder;
import android.view.LayoutInflater;
import android.view.View;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.preference.Preference;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.backend.OsmAndAppCustomization;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.settings.backend.CommonPreference;
import net.osmand.plus.settings.backend.OsmandPreference;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
import net.osmand.plus.settings.fragments.BaseSettingsFragment;
import net.osmand.plus.settings.backend.ApplicationMode;
import net.osmand.plus.settings.backend.CommonPreference;
import net.osmand.plus.settings.backend.OsmAndAppCustomization;
import net.osmand.plus.settings.backend.OsmandPreference;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener;
import net.osmand.plus.settings.bottomsheets.SingleSelectPreferenceBottomSheet;
import net.osmand.plus.settings.fragments.BaseSettingsFragment;
import net.osmand.plus.settings.preferences.ListPreferenceEx;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.plus.widgets.style.CustomTypefaceSpan;
@ -36,11 +38,11 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import static net.osmand.plus.activities.PluginInfoFragment.PLUGIN_INFO;
import static net.osmand.plus.settings.backend.OsmandSettings.MONTHLY_DIRECTORY;
import static net.osmand.plus.settings.backend.OsmandSettings.REC_DIRECTORY;
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS;
import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID;
import static net.osmand.plus.settings.backend.OsmandSettings.MONTHLY_DIRECTORY;
import static net.osmand.plus.settings.backend.OsmandSettings.REC_DIRECTORY;
public class MonitoringSettingsFragment extends BaseSettingsFragment
implements CopyAppModePrefsListener, ResetAppModePrefsListener {
@ -293,6 +295,18 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment
resetToDefault.setIcon(getActiveIcon(R.drawable.ic_action_reset_to_default_dark));
}
@Override
public void onDestroy() {
FragmentActivity activity = getActivity();
if (activity != null && !activity.isChangingConfigurations()) {
Fragment target = getTargetFragment();
if (target instanceof TripRecordingStartingBottomFragment) {
((TripRecordingStartingBottomFragment) target).show();
}
}
super.onDestroy();
}
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();

View file

@ -25,6 +25,7 @@ import com.google.android.material.slider.Slider;
import net.osmand.AndroidUtils;
import net.osmand.Location;
import net.osmand.PlatformUtil;
import net.osmand.ValueHolder;
import net.osmand.plus.GpxSelectionHelper.SelectedGpxFile;
import net.osmand.plus.NavigationService;
@ -48,6 +49,8 @@ import net.osmand.plus.views.layers.MapInfoLayer;
import net.osmand.plus.views.mapwidgets.widgets.TextInfoWidget;
import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
import java.io.File;
import java.lang.ref.WeakReference;
import java.util.Collections;
@ -57,6 +60,7 @@ import static net.osmand.plus.UiUtilities.CompoundButtonType.PROFILE_DEPENDENT;
public class OsmandMonitoringPlugin extends OsmandPlugin {
private static final Log LOG = PlatformUtil.getLog(OsmandMonitoringPlugin.class);
public static final String ID = "osmand.monitoring";
public final static String OSMAND_SAVE_SERVICE_ACTION = "OSMAND_SAVE_SERVICE_ACTION";
public static final int REQUEST_LOCATION_PERMISSION_FOR_GPX_RECORDING = 208;
@ -471,12 +475,10 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
try {
SavingTrackHelper helper = app.getSavingTrackHelper();
SaveGpxResult result = helper.saveDataToGpx(app.getAppCustomization().getTracksDir());
if (stopRecording) {
helper.close();
}
helper.close();
return result;
} catch (Exception e) {
e.printStackTrace();
LOG.error(e.getMessage(), e);
}
return null;
}

View file

@ -26,6 +26,7 @@ import androidx.cardview.widget.CardView;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.RecyclerView;
@ -41,6 +42,7 @@ import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
import net.osmand.plus.helpers.AndroidUiHelper;
@ -75,12 +77,14 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
public static final String TAG = TripRecordingBottomFragment.class.getSimpleName();
private static final Log LOG = PlatformUtil.getLog(TripRecordingBottomFragment.class);
private static final String SAVE_CURRENT_GPX_FILE = "save_current_gpx_file";
public static final String UPDATE_TRACK_ICON = "update_track_icon";
private static final int GPS_UPDATE_INTERVAL = 1000;
private static final String[] INIT_BLOCKS_KEYS =
new String[]{INIT_BLOCKS_GENERAL, INIT_BLOCKS_ALTITUDE, INIT_BLOCKS_SPEED};
private OsmandApplication app;
private OsmandSettings settings;
private SavingTrackHelper helper;
private OsmandMonitoringPlugin plugin;
private View statusContainer;
@ -105,7 +109,7 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
}
private boolean hasDataToSave() {
return app.getSavingTrackHelper().hasDataToSave();
return helper.hasDataToSave();
}
private boolean searchingGPS() {
@ -128,17 +132,12 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
public void createMenuItems(Bundle savedInstanceState) {
app = requiredMyApplication();
settings = app.getSettings();
helper = app.getSavingTrackHelper();
plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
selectedGpxFile = helper.getCurrentTrack();
LayoutInflater inflater = UiUtilities.getInflater(getContext(), nightMode);
final FragmentManager fragmentManager = getFragmentManager();
if (savedInstanceState != null) {
if (savedInstanceState.containsKey(SAVE_CURRENT_GPX_FILE)
&& savedInstanceState.getBoolean(SAVE_CURRENT_GPX_FILE)) {
selectedGpxFile = app.getSavingTrackHelper().getCurrentTrack();
}
}
View itemView = inflater.inflate(R.layout.trip_recording_fragment, null, false);
items.add(new BaseBottomSheetItem.Builder()
.setCustomView(itemView)
@ -149,8 +148,8 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
LinearLayout showTrackContainer = itemView.findViewById(R.id.show_track_on_map);
trackAppearanceIcon = showTrackContainer.findViewById(R.id.additional_button_icon);
createShowTrackItem(app, getMapActivity(), nightMode, showTrackContainer, trackAppearanceIcon,
ItemType.SHOW_TRACK.getTitleId(), TripRecordingBottomFragment.this, new Runnable() {
createShowTrackItem(showTrackContainer, trackAppearanceIcon, ItemType.SHOW_TRACK.getTitleId(),
TripRecordingBottomFragment.this, nightMode, new Runnable() {
@Override
public void run() {
hide();
@ -200,7 +199,7 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
@Override
public void onClick(View v) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null && plugin != null && app.getSavingTrackHelper().hasDataToSave()) {
if (mapActivity != null && plugin != null && hasDataToSave()) {
plugin.saveCurrentTrack(null, mapActivity);
app.getNotificationHelper().refreshNotifications();
dismiss();
@ -214,16 +213,11 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
@Override
public void onClick(View v) {
if (fragmentManager != null) {
TripRecordingOptionsBottomFragment.showInstance(fragmentManager, TripRecordingBottomFragment.this, selectedGpxFile);
TripRecordingOptionsBottomFragment.showInstance(fragmentManager, TripRecordingBottomFragment.this);
}
}
});
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(SAVE_CURRENT_GPX_FILE, true);
}
@Override
@ -231,6 +225,10 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
super.onResume();
blockStatisticsBuilder.runUpdatingStatBlocksIfNeeded();
runUpdatingGPS();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
mapActivity.getMapLayers().getGpxLayer().setTrackChartPoints(trackChartPoints);
}
}
@Override
@ -238,6 +236,10 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
super.onPause();
blockStatisticsBuilder.stopUpdatingStatBlocks();
stopUpdatingGPS();
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
mapActivity.getMapLayers().getGpxLayer().setTrackChartPoints(null);
}
}
public void show() {
@ -303,16 +305,15 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
AndroidUiHelper.setVisibility(View.GONE, segmentView.findViewById(R.id.list_item_divider));
WrapContentHeightViewPager pager = segmentView.findViewById(R.id.pager);
PagerSlidingTabStrip tabLayout = segmentView.findViewById(R.id.sliding_tabs);
final String[] initBlocksKeys = new String[]{INIT_BLOCKS_GENERAL, INIT_BLOCKS_ALTITUDE, INIT_BLOCKS_SPEED};
tabLayout.setOnTabReselectedListener(new PagerSlidingTabStrip.OnTabReselectedListener() {
@Override
public void onTabSelected(int position) {
recreateStatBlocks(initBlocksKeys[position]);
recreateStatBlocks(INIT_BLOCKS_KEYS[position]);
}
@Override
public void onTabReselected(int position) {
recreateStatBlocks(initBlocksKeys[position]);
recreateStatBlocks(INIT_BLOCKS_KEYS[position]);
}
});
@ -357,10 +358,15 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
}
}
public static void createShowTrackItem(final OsmandApplication app, final MapActivity mapActivity,
final boolean nightMode, LinearLayout showTrackContainer,
AppCompatImageView trackAppearanceIcon, Integer showTrackId,
final Fragment target, final Runnable hideOnClickButtonAppearance) {
public static void createShowTrackItem(LinearLayout showTrackContainer, AppCompatImageView trackAppearanceIcon,
Integer showTrackId, final Fragment target,
final boolean nightMode, final Runnable hideOnClickButtonAppearance) {
FragmentActivity activity = target.getActivity();
if (!(activity instanceof MapActivity)) {
return;
}
final MapActivity mapActivity = (MapActivity) activity;
final OsmandApplication app = mapActivity.getMyApplication();
final CardView buttonShowTrack = showTrackContainer.findViewById(R.id.compound_container);
final CardView buttonAppearance = showTrackContainer.findViewById(R.id.additional_button_container);
@ -390,19 +396,18 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
@Override
public void onClick(View v) {
if (showTrackCompound.isChecked()) {
if (mapActivity != null) {
hideOnClickButtonAppearance.run();
SelectedGpxFile selectedGpxFile = app.getSavingTrackHelper().getCurrentTrack();
TrackAppearanceFragment.showInstance(mapActivity, selectedGpxFile, target);
}
hideOnClickButtonAppearance.run();
SelectedGpxFile selectedGpxFile = app.getSavingTrackHelper().getCurrentTrack();
TrackAppearanceFragment.showInstance(mapActivity, selectedGpxFile, target);
}
}
});
}
protected static void setShowTrackItemBackground(View view, boolean checked, boolean nightMode) {
int background = checked ? getActiveTransparentBackgroundId(nightMode) : getInactiveStrokedBackgroundId(nightMode);
view.setBackgroundResource(background);
public static void setShowTrackItemBackground(View view, boolean checked, boolean nightMode) {
Drawable background = AppCompatResources.getDrawable(view.getContext(),
checked ? getActiveTransparentBackgroundId(nightMode) : getInactiveStrokedBackgroundId(nightMode));
view.setBackgroundDrawable(background);
}
private void createItem(View view, ItemType type) {
@ -454,18 +459,18 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
}
public static void setItemBackground(Context context, boolean nightMode, View view, boolean enabled) {
Drawable background = AppCompatResources.getDrawable(context, R.drawable.btn_background_inactive_light);
if (view instanceof CardView) {
int colorId = enabled ? getActiveTransparentColorId(nightMode) : getInactiveButtonColorId(nightMode);
((CardView) view).setCardBackgroundColor(AndroidUtils.createPressedColorStateList(
context, colorId, getActiveTextColorId(nightMode)
));
return;
}
Drawable background = AppCompatResources.getDrawable(context, getInactiveButtonBackgroundId(nightMode));
if (background != null && enabled) {
int normalColorId = view instanceof CardView
? getActiveTransparentColorId(nightMode) : getInactiveButtonColorId(nightMode);
ColorStateList iconColorStateList = AndroidUtils.createPressedColorStateList(
context, normalColorId, getActiveTextColorId(nightMode)
);
if (view instanceof CardView) {
((CardView) view).setCardBackgroundColor(iconColorStateList);
return;
}
DrawableCompat.setTintList(background, iconColorStateList);
DrawableCompat.setTintList(background, AndroidUtils.createPressedColorStateList(
context, getInactiveButtonColorId(nightMode), getActiveTextColorId(nightMode)
));
} else {
UiUtilities.tintDrawable(background, ContextCompat.getColor(context, getInactiveButtonColorId(nightMode)));
}
@ -590,6 +595,10 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
public void openAnalyzeOnMap(GpxDisplayItem gpxItem) {
}
public interface DismissTargetFragment {
void dismissTarget();
}
@ColorRes
public static int getActiveTextColorId(boolean nightMode) {
return nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
@ -620,7 +629,7 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
return nightMode ? R.color.icon_color_osmand_dark : R.color.icon_color_osmand_light;
}
@DrawableRes
@ColorRes
public static int getActiveTransparentColorId(boolean nightMode) {
return nightMode ? R.color.switch_button_active_dark : R.color.switch_button_active_light;
}
@ -640,6 +649,11 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
return nightMode ? R.drawable.btn_background_stroked_inactive_dark : R.drawable.btn_background_stroked_inactive_light;
}
@DrawableRes
public static int getInactiveButtonBackgroundId(boolean nightMode) {
return nightMode ? R.drawable.btn_background_inactive_dark : R.drawable.btn_background_inactive_light;
}
@Override
protected boolean hideButtonsContainer() {
return true;
@ -653,5 +667,4 @@ public class TripRecordingBottomFragment extends MenuBottomSheetDialogFragment i
}
return null;
}
}

View file

@ -18,9 +18,8 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import static net.osmand.AndroidUtils.getPrimaryTextColorId;
import static net.osmand.plus.monitoring.TripRecordingOptionsBottomFragment.*;
public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogFragment {
public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomFragment.DismissTargetFragment {
public static final String TAG = TripRecordingClearDataBottomFragment.class.getSimpleName();
@ -41,7 +40,7 @@ public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogF
int verticalBig = getResources().getDimensionPixelSize(R.dimen.dialog_content_margin);
int verticalNormal = getResources().getDimensionPixelSize(R.dimen.content_padding);
String description = getString(R.string.clear_recorded_data_warning)
.concat(getString(R.string.lost_data_warning));
.concat("\n").concat(getString(R.string.lost_data_warning));
final View buttonClear = createItem(inflater, ItemType.CLEAR_DATA);
final View buttonCancel = createItem(inflater, ItemType.CANCEL);
@ -61,7 +60,7 @@ public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogF
public void onClick(View v) {
app.getSavingTrackHelper().clearRecordedData(true);
dismiss();
dismissTargetDialog(TripRecordingClearDataBottomFragment.this, TripRecordingOptionsBottomFragment.class);
dismissTarget();
}
})
.create());
@ -108,4 +107,11 @@ public class TripRecordingClearDataBottomFragment extends MenuBottomSheetDialogF
return true;
}
@Override
public void dismissTarget() {
Fragment target = getTargetFragment();
if (target instanceof TripRecordingOptionsBottomFragment) {
((TripRecordingOptionsBottomFragment) target).dismiss();
}
}
}

View file

@ -19,10 +19,9 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import static net.osmand.AndroidUtils.getPrimaryTextColorId;
import static net.osmand.plus.monitoring.TripRecordingOptionsBottomFragment.ACTION_STOP_AND_DISCARD;
import static net.osmand.plus.monitoring.TripRecordingOptionsBottomFragment.dismissTargetDialog;
import static net.osmand.plus.monitoring.TripRecordingOptionsBottomFragment.ACTION_STOP_AND_DISMISS;
public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFragment {
public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomFragment.DismissTargetFragment {
public static final String TAG = TripRecordingDiscardBottomFragment.class.getSimpleName();
@ -43,13 +42,11 @@ public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFra
LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);
int verticalBig = getResources().getDimensionPixelSize(R.dimen.dialog_content_margin);
int verticalNormal = getResources().getDimensionPixelSize(R.dimen.content_padding);
String description = getString(R.string.track_recording_description)
.concat(getString(R.string.lost_data_warning));
final View buttonDiscard = createItem(inflater, ItemType.STOP_AND_DISCARD);
final View buttonCancel = createItem(inflater, ItemType.CANCEL);
items.add(new BottomSheetItemWithDescription.Builder()
.setDescription(description)
.setDescription(getString(R.string.track_recording_description))
.setDescriptionColorId(getPrimaryTextColorId(nightMode))
.setTitle(app.getString(R.string.track_recording_title))
.setLayoutId(R.layout.bottom_sheet_item_title_with_description)
@ -68,8 +65,14 @@ public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFra
}
app.getSavingTrackHelper().clearRecordedData(true);
dismiss();
dismissTargetDialog(TripRecordingDiscardBottomFragment.this,
TripRecordingOptionsBottomFragment.class, ACTION_STOP_AND_DISCARD, true);
Fragment target = getTargetFragment();
if (target != null) {
Bundle args = new Bundle();
args.putBoolean(ACTION_STOP_AND_DISMISS, true);
target.setArguments(args);
}
dismissTarget();
}
})
.create());
@ -111,6 +114,14 @@ public class TripRecordingDiscardBottomFragment extends MenuBottomSheetDialogFra
}
}
@Override
public void dismissTarget() {
Fragment target = getTargetFragment();
if (target instanceof TripRecordingOptionsBottomFragment) {
((TripRecordingOptionsBottomFragment) target).dismiss();
}
}
@Override
protected boolean hideButtonsContainer() {
return true;

View file

@ -11,7 +11,6 @@ import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@ -36,11 +35,10 @@ import net.osmand.util.Algorithms;
import static net.osmand.AndroidUtils.getPrimaryTextColorId;
public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFragment {
public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFragment implements TripRecordingBottomFragment.DismissTargetFragment {
public static final String TAG = TripRecordingOptionsBottomFragment.class.getSimpleName();
public static final String ACTION_STOP_AND_DISCARD = "action_stop_and_discard";
private static final String SAVE_CURRENT_GPX_FILE = "save_current_gpx_file";
public static final String ACTION_STOP_AND_DISMISS = "action_stop_and_discard";
private static final int SAVE_UPDATE_INTERVAL = 1000;
private OsmandApplication app;
@ -72,11 +70,10 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
return settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
}
public static void showInstance(@NonNull FragmentManager fragmentManager, @NonNull Fragment target, SelectedGpxFile selectedGpxFile) {
public static void showInstance(@NonNull FragmentManager fragmentManager, @NonNull Fragment target) {
if (!fragmentManager.isStateSaved()) {
TripRecordingOptionsBottomFragment fragment = new TripRecordingOptionsBottomFragment();
fragment.setTargetFragment(target, 0);
fragment.setSelectedGpxFile(selectedGpxFile);
fragment.show(fragmentManager, TAG);
}
}
@ -86,18 +83,12 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
app = requiredMyApplication();
settings = app.getSettings();
helper = app.getSavingTrackHelper();
selectedGpxFile = helper.getCurrentTrack();
LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);
final FragmentManager fragmentManager = getFragmentManager();
int dp16 = getResources().getDimensionPixelSize(R.dimen.content_padding);
int dp36 = getResources().getDimensionPixelSize(R.dimen.context_menu_controller_height);
if (savedInstanceState != null) {
if (savedInstanceState.containsKey(SAVE_CURRENT_GPX_FILE)
&& savedInstanceState.getBoolean(SAVE_CURRENT_GPX_FILE)) {
selectedGpxFile = app.getSavingTrackHelper().getCurrentTrack();
}
}
buttonClear = createItem(inflater, ItemType.CLEAR_DATA, hasDataToSave());
final View buttonDiscard = createItem(inflater, ItemType.STOP_AND_DISCARD);
final View buttonOnline = createItem(inflater, ItemType.STOP_ONLINE, hasDataToSave());
@ -193,12 +184,6 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
}
@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(SAVE_CURRENT_GPX_FILE, true);
}
@Override
public void onResume() {
super.onResume();
@ -213,14 +198,7 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
public void onPause() {
super.onPause();
stopUpdatingTimeTrackSaved();
Fragment target = getTargetFragment();
if (target instanceof TripRecordingBottomFragment) {
if (isDiscard()) {
((TripRecordingBottomFragment) target).dismiss();
} else {
((TripRecordingBottomFragment) target).show();
}
}
dismissTarget();
}
public void show() {
@ -237,32 +215,6 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
}
}
private boolean isDiscard() {
Bundle args = getArguments();
if (args != null) {
return args.getBoolean(ACTION_STOP_AND_DISCARD);
}
return false;
}
protected static void dismissTargetDialog(Fragment current, Class<?> targetClass) {
dismissTargetDialog(current, targetClass, null, null);
}
protected static void dismissTargetDialog(Fragment current, Class<?> targetClass, String booleanKey, Boolean value) {
if (targetClass.isInstance(current.getTargetFragment())) {
Fragment target = current.getTargetFragment();
if (booleanKey != null && value != null) {
Bundle args = new Bundle();
args.putBoolean(booleanKey, value);
target.setArguments(args);
}
if (target instanceof DialogFragment) {
((DialogFragment) target).dismiss();
}
}
}
public void stopUpdatingTimeTrackSaved() {
handler.removeCallbacks(updatingTimeTrackSaved);
}
@ -312,17 +264,37 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
if (mapActivity != null && plugin != null) {
stopUpdatingTimeTrackSaved();
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(false);
plugin.saveCurrentTrack(null, mapActivity, false, true);
Bundle args = new Bundle();
args.putBoolean(ACTION_STOP_AND_DISMISS, true);
setArguments(args);
dismiss();
dismissTargetDialog(TripRecordingOptionsBottomFragment.this, TripRecordingBottomFragment.class);
settings.SAVE_GLOBAL_TRACK_TO_GPX.set(true);
runUpdatingTimeTrackSaved();
dismissTarget();
}
}
};
}
private boolean isDiscard() {
Bundle args = getArguments();
if (args != null) {
return args.getBoolean(ACTION_STOP_AND_DISMISS);
}
return false;
}
@Override
public void dismissTarget() {
Fragment target = getTargetFragment();
if (target instanceof TripRecordingBottomFragment) {
if (isDiscard()) {
((TripRecordingBottomFragment) target).dismiss();
} else {
((TripRecordingBottomFragment) target).show();
}
}
}
@Nullable
public MapActivity getMapActivity() {
Activity activity = getActivity();
@ -346,5 +318,4 @@ public class TripRecordingOptionsBottomFragment extends MenuBottomSheetDialogFra
protected boolean useVerticalButtons() {
return true;
}
}

View file

@ -106,8 +106,8 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
LinearLayout showTrackContainer = itemView.findViewById(R.id.show_track_on_map);
trackAppearanceIcon = showTrackContainer.findViewById(R.id.additional_button_icon);
createShowTrackItem(app, getMapActivity(), nightMode, showTrackContainer, trackAppearanceIcon,
R.string.shared_string_show_on_map, TripRecordingStartingBottomFragment.this, new Runnable() {
createShowTrackItem(showTrackContainer, trackAppearanceIcon, R.string.shared_string_show_on_map,
TripRecordingStartingBottomFragment.this, nightMode, new Runnable() {
@Override
public void run() {
hide();
@ -117,7 +117,6 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
updateUpDownBtn();
CardView cardLeft = itemView.findViewById(R.id.button_left);
createItem(app, nightMode, cardLeft, ItemType.CANCEL, true, null);
cardLeft.setOnClickListener(new View.OnClickListener() {
@Override
@ -127,7 +126,6 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
});
CardView cardCenter = itemView.findViewById(R.id.button_center);
createItem(app, nightMode, cardCenter, ItemType.START_RECORDING, true, null);
cardCenter.setOnClickListener(new View.OnClickListener() {
@Override
@ -137,7 +135,6 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
});
CardView cardRight = itemView.findViewById(R.id.button_right);
createItem(app, nightMode, cardRight, ItemType.SETTINGS, true, null);
cardRight.setOnClickListener(new View.OnClickListener() {
@Override
@ -145,7 +142,8 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
hide();
BaseSettingsFragment.showInstance(mapActivity, SettingsScreenType.MONITORING_SETTINGS, TripRecordingStartingBottomFragment.this);
BaseSettingsFragment.showInstance(mapActivity, SettingsScreenType.MONITORING_SETTINGS,
null, new Bundle(), TripRecordingStartingBottomFragment.this);
}
}
});
@ -241,19 +239,13 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
dismiss();
}
public void show(String... keys) {
public void show() {
Dialog dialog = getDialog();
if (dialog != null) {
dialog.show();
for (String key : keys) {
if (key.equals(UPDATE_TRACK_ICON)) {
updateTrackIcon(app, trackAppearanceIcon);
}
if (key.equals(UPDATE_LOGGING_INTERVAL)) {
updateIntervalValue();
AndroidUiHelper.updateVisibility(intervalContainer, infoExpanded);
}
}
updateTrackIcon(app, trackAppearanceIcon);
updateIntervalValue();
AndroidUiHelper.updateVisibility(intervalContainer, infoExpanded);
}
}
@ -277,5 +269,4 @@ public class TripRecordingStartingBottomFragment extends MenuBottomSheetDialogFr
protected boolean hideButtonsContainer() {
return true;
}
}

View file

@ -61,6 +61,8 @@ import java.util.Map;
import static net.osmand.plus.helpers.GpxUiHelper.LineGraphType.ALTITUDE;
import static net.osmand.plus.helpers.GpxUiHelper.LineGraphType.SLOPE;
import static net.osmand.plus.helpers.GpxUiHelper.LineGraphType.SPEED;
import static net.osmand.plus.myplaces.GPXTabItemType.GPX_TAB_ITEM_ALTITUDE;
import static net.osmand.plus.myplaces.GPXTabItemType.GPX_TAB_ITEM_SPEED;
public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvider, ViewAtPositionInterface {
@ -81,14 +83,6 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
private boolean nightMode;
private boolean onlyGraphs;
public GPXItemPagerAdapter(@NonNull OsmandApplication app,
@NonNull GpxDisplayItem gpxItem,
@NonNull TrackDisplayHelper displayHelper,
boolean nightMode,
@NonNull SegmentActionsListener actionsListener) {
this(app, gpxItem, displayHelper, nightMode, actionsListener, false);
}
public GPXItemPagerAdapter(@NonNull OsmandApplication app,
@NonNull GpxDisplayItem gpxItem,
@NonNull TrackDisplayHelper displayHelper,
@ -111,10 +105,10 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
tabTypeList.add(GPXTabItemType.GPX_TAB_ITEM_GENERAL);
if (gpxItem != null && gpxItem.analysis != null) {
if (gpxItem.analysis.hasElevationData) {
tabTypeList.add(GPXTabItemType.GPX_TAB_ITEM_ALTITUDE);
tabTypeList.add(GPX_TAB_ITEM_ALTITUDE);
}
if (gpxItem.analysis.isSpeedSpecified()) {
tabTypeList.add(GPXTabItemType.GPX_TAB_ITEM_SPEED);
tabTypeList.add(GPX_TAB_ITEM_SPEED);
}
}
tabTypes = tabTypeList.toArray(new GPXTabItemType[0]);
@ -228,41 +222,21 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
private View getViewForTab(@NonNull ViewGroup container, @NonNull GPXTabItemType tabType) {
LayoutInflater inflater = LayoutInflater.from(container.getContext());
View view;
switch (tabType) {
case GPX_TAB_ITEM_ALTITUDE:
view = inflater.inflate(R.layout.gpx_item_altitude, container, false);
if (onlyGraphs) {
AndroidUiHelper.setVisibility(View.GONE,
view.findViewById(R.id.average_range),
view.findViewById(R.id.ascent_descent)
);
}
break;
case GPX_TAB_ITEM_SPEED:
view = inflater.inflate(R.layout.gpx_item_speed, container, false);
if (onlyGraphs) {
AndroidUiHelper.setVisibility(View.GONE,
view.findViewById(R.id.average_max),
view.findViewById(R.id.time_distance)
);
}
break;
case GPX_TAB_ITEM_GENERAL:
default:
view = inflater.inflate(R.layout.gpx_item_general, container, false);
if (onlyGraphs) {
AndroidUiHelper.setVisibility(View.GONE,
view.findViewById(R.id.distance_time_span),
view.findViewById(R.id.start_end_time)
);
}
break;
int layoutResId;
if (tabType == GPX_TAB_ITEM_ALTITUDE) {
layoutResId = R.layout.gpx_item_altitude;
} else if (tabType == GPX_TAB_ITEM_SPEED) {
layoutResId = R.layout.gpx_item_speed;
} else {
layoutResId = R.layout.gpx_item_general;
}
View view = inflater.inflate(layoutResId, container, false);
if (onlyGraphs) {
AndroidUiHelper.setVisibility(View.GONE,
view.findViewById(R.id.gpx_join_gaps_container),
view.findViewById(R.id.top_line_blocks),
view.findViewById(R.id.list_divider),
view.findViewById(R.id.bottom_line_blocks),
view.findViewById(R.id.details_divider),
view.findViewById(R.id.details_view)
);
@ -274,7 +248,7 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
if (analysis != null && analysis.isSpeedSpecified()) {
if (analysis.hasSpeedData) {
GpxUiHelper.setupGPXChart(app, chart, 4);
chart.setData(new LineData(getDataSets(chart, GPXTabItemType.GPX_TAB_ITEM_SPEED, SPEED, null)));
chart.setData(new LineData(getDataSets(chart, GPX_TAB_ITEM_SPEED, SPEED, null)));
updateChart(chart);
chart.setVisibility(View.VISIBLE);
} else {
@ -311,16 +285,16 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
}
} else {
chart.setVisibility(View.GONE);
view.findViewById(R.id.average_max).setVisibility(View.GONE);
view.findViewById(R.id.top_line_blocks).setVisibility(View.GONE);
view.findViewById(R.id.list_divider).setVisibility(View.GONE);
view.findViewById(R.id.time_distance).setVisibility(View.GONE);
view.findViewById(R.id.bottom_line_blocks).setVisibility(View.GONE);
}
if (!onlyGraphs) {
updateJoinGapsInfo(view, position);
view.findViewById(R.id.analyze_on_map).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openAnalyzeOnMap(GPXTabItemType.GPX_TAB_ITEM_SPEED);
openAnalyzeOnMap(GPX_TAB_ITEM_SPEED);
}
});
TextView overflowMenu = view.findViewById(R.id.overflow_menu);
@ -346,7 +320,7 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
if (analysis != null) {
if (analysis.hasElevationData) {
GpxUiHelper.setupGPXChart(app, chart, 4);
chart.setData(new LineData(getDataSets(chart, GPXTabItemType.GPX_TAB_ITEM_ALTITUDE, ALTITUDE, SLOPE)));
chart.setData(new LineData(getDataSets(chart, GPX_TAB_ITEM_ALTITUDE, ALTITUDE, SLOPE)));
updateChart(chart);
chart.setVisibility(View.VISIBLE);
} else {
@ -388,16 +362,16 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
}
} else {
chart.setVisibility(View.GONE);
view.findViewById(R.id.average_range).setVisibility(View.GONE);
view.findViewById(R.id.top_line_blocks).setVisibility(View.GONE);
view.findViewById(R.id.list_divider).setVisibility(View.GONE);
view.findViewById(R.id.ascent_descent).setVisibility(View.GONE);
view.findViewById(R.id.bottom_line_blocks).setVisibility(View.GONE);
}
if (!onlyGraphs) {
updateJoinGapsInfo(view, position);
view.findViewById(R.id.analyze_on_map).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
openAnalyzeOnMap(GPXTabItemType.GPX_TAB_ITEM_ALTITUDE);
openAnalyzeOnMap(GPX_TAB_ITEM_ALTITUDE);
}
});
TextView overflowMenu = view.findViewById(R.id.overflow_menu);
@ -453,14 +427,14 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
((TextView) view.findViewById(R.id.end_date_text)).setText(df.format(end));
} else {
view.findViewById(R.id.list_divider).setVisibility(View.GONE);
view.findViewById(R.id.start_end_time).setVisibility(View.GONE);
view.findViewById(R.id.bottom_line_blocks).setVisibility(View.GONE);
}
}
} else {
chart.setVisibility(View.GONE);
view.findViewById(R.id.distance_time_span).setVisibility(View.GONE);
view.findViewById(R.id.top_line_blocks).setVisibility(View.GONE);
view.findViewById(R.id.list_divider).setVisibility(View.GONE);
view.findViewById(R.id.start_end_time).setVisibility(View.GONE);
view.findViewById(R.id.bottom_line_blocks).setVisibility(View.GONE);
}
updateJoinGapsInfo(view, position);
if (!onlyGraphs) {
@ -698,7 +672,7 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid
((TextView) view.findViewById(R.id.distance_text)).setText(OsmAndFormatter.getFormattedDistance(totalDistance, app));
((TextView) view.findViewById(R.id.duration_text)).setText(Algorithms.formatDuration((int) (timeSpan / 1000), app.accessibilityEnabled()));
} else if (tabType.equals(GPXTabItemType.GPX_TAB_ITEM_SPEED)) {
} else if (tabType.equals(GPX_TAB_ITEM_SPEED)) {
long timeMoving = !joinSegments && gpxItem.isGeneralTrack() ? analysis.timeMovingWithoutGaps : analysis.timeMoving;
float totalDistanceMoving = !joinSegments && gpxItem.isGeneralTrack() ? analysis.totalDistanceMovingWithoutGaps : analysis.totalDistanceMoving;

View file

@ -55,7 +55,7 @@ public class SegmentGPXAdapter extends ArrayAdapter<GpxDisplayItem> {
WrapContentHeightViewPager pager = row.findViewById(R.id.pager);
PagerSlidingTabStrip tabLayout = row.findViewById(R.id.sliding_tabs);
pager.setAdapter(new GPXItemPagerAdapter(app, item, displayHelper, nightMode, listener));
pager.setAdapter(new GPXItemPagerAdapter(app, item, displayHelper, nightMode, listener, false));
if (create) {
tabLayout.setViewPager(pager);
} else {

View file

@ -12,9 +12,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRes;
import androidx.appcompat.widget.SwitchCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
@ -107,7 +105,7 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
private final Class<? extends LocalRoutingParameter>[] excludeParameters;
@SafeVarargs
DialogMode(Class<? extends LocalRoutingParameter> ... excludeParameters) {
DialogMode(Class<? extends LocalRoutingParameter>... excludeParameters) {
this.excludeParameters = excludeParameters;
}
@ -556,7 +554,7 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
Bundle args = new Bundle();
args.putString(DIALOG_MODE_KEY, dialogMode.name());
BaseSettingsFragment.showInstance(mapActivity,
SettingsScreenType.NAVIGATION, applicationMode, args);
SettingsScreenType.NAVIGATION, applicationMode, args, null);
}
})
.create();
@ -695,9 +693,9 @@ public class RouteOptionsBottomSheet extends MenuBottomSheetDialogFragment {
}
public static void showInstance(MapActivity mapActivity,
Fragment targetFragment,
DialogMode dialogMode,
String appModeKey) {
Fragment targetFragment,
DialogMode dialogMode,
String appModeKey) {
try {
FragmentManager fm = mapActivity.getSupportFragmentManager();
if (!fm.isStateSaved()) {

View file

@ -61,7 +61,6 @@ import net.osmand.plus.activities.OsmandInAppPurchaseActivity;
import net.osmand.plus.audionotes.MultimediaNotesFragment;
import net.osmand.plus.development.DevelopmentSettingsFragment;
import net.osmand.plus.monitoring.MonitoringSettingsFragment;
import net.osmand.plus.monitoring.TripRecordingStartingBottomFragment;
import net.osmand.plus.openplacereviews.OprSettingsFragment;
import net.osmand.plus.osmedit.OsmEditingFragment;
import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment;
@ -86,7 +85,6 @@ import java.io.Serializable;
import java.util.Set;
import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SETTINGS_ID;
import static net.osmand.plus.monitoring.TripRecordingStartingBottomFragment.UPDATE_LOGGING_INTERVAL;
public abstract class BaseSettingsFragment extends PreferenceFragmentCompat implements OnPreferenceChangeListener,
OnPreferenceClickListener, AppModeChangedListener, OnConfirmPreferenceChange {
@ -293,15 +291,6 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
}
}
@Override
public void onDestroyView() {
super.onDestroyView();
Fragment target = getTargetFragment();
if (target instanceof TripRecordingStartingBottomFragment) {
((TripRecordingStartingBottomFragment) target).show(UPDATE_LOGGING_INTERVAL);
}
}
@Override
public void onDetach() {
super.onDetach();
@ -895,24 +884,11 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
}
public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType) {
return showInstance(activity, screenType, (ApplicationMode) null);
}
public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType, Fragment target) {
return showInstance(activity, screenType, null, target);
return showInstance(activity, screenType, null);
}
public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType, @Nullable ApplicationMode appMode) {
return showInstance(activity, screenType, appMode, new Bundle());
}
public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType, @Nullable ApplicationMode appMode, Fragment target) {
return showInstance(activity, screenType, appMode, new Bundle(), target);
}
public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType,
@Nullable ApplicationMode appMode, @NonNull Bundle args) {
return showInstance(activity, screenType, appMode, args, null);
return showInstance(activity, screenType, appMode, new Bundle(), null);
}
public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType,
@ -923,9 +899,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
args.putString(APP_MODE_KEY, appMode.getStringKey());
}
fragment.setArguments(args);
if (target != null) {
fragment.setTargetFragment(target, 0);
}
fragment.setTargetFragment(target, 0);
activity.getSupportFragmentManager().beginTransaction()
.replace(R.id.fragmentContainer, fragment, screenType.fragmentName)
.addToBackStack(DRAWER_SETTINGS_ID + ".new")

View file

@ -152,8 +152,8 @@ public class GpxBlockStatisticsBuilder {
withoutGaps = !selectedGpxFile.isJoinSegments() && gpxDisplayItem.isGeneralTrack();
}
}
items.clear();
if (analysis != null) {
items.clear();
switch (initBlocksKey) {
case INIT_BLOCKS_GENERAL: {
float totalDistance = withoutGaps ? analysis.totalDistanceWithoutGaps : analysis.totalDistance;
@ -283,51 +283,52 @@ public class GpxBlockStatisticsBuilder {
public void prepareData(String title, String value, @DrawableRes int imageResId, @ColorRes int imageColorId,
GPXDataSetType firstType, GPXDataSetType secondType, ItemType itemType) {
if (analysis != null) {
StatBlock statBlock = new StatBlock(title, value, imageResId, imageColorId, firstType, secondType, itemType);
switch (statBlock.itemType) {
case ITEM_DISTANCE: {
if (analysis.totalDistance != 0f) {
items.add(statBlock);
}
break;
if (analysis == null) {
return;
}
StatBlock statBlock = new StatBlock(title, value, imageResId, imageColorId, firstType, secondType, itemType);
switch (statBlock.itemType) {
case ITEM_DISTANCE: {
if (analysis.totalDistance != 0f) {
items.add(statBlock);
}
case ITEM_DISTANCE_MOVING: {
if (analysis.totalDistanceMoving != 0f) {
items.add(statBlock);
}
break;
break;
}
case ITEM_DISTANCE_MOVING: {
if (analysis.totalDistanceMoving != 0f) {
items.add(statBlock);
}
case ITEM_ALTITUDE: {
if (analysis.hasElevationData) {
items.add(statBlock);
}
break;
break;
}
case ITEM_ALTITUDE: {
if (analysis.hasElevationData) {
items.add(statBlock);
}
case ITEM_SPEED: {
if (analysis.isSpeedSpecified()) {
items.add(statBlock);
}
break;
break;
}
case ITEM_SPEED: {
if (analysis.isSpeedSpecified()) {
items.add(statBlock);
}
case ITEM_TIME: {
if (analysis.timeSpan > 0) {
items.add(statBlock);
}
break;
break;
}
case ITEM_TIME: {
if (analysis.timeSpan > 0) {
items.add(statBlock);
}
case ITEM_TIME_SPAN: {
if (analysis.hasSpeedData) {
items.add(statBlock);
}
break;
break;
}
case ITEM_TIME_SPAN: {
if (analysis.hasSpeedData) {
items.add(statBlock);
}
case ITEM_TIME_MOVING: {
if (analysis.isTimeMoving()) {
items.add(statBlock);
}
break;
break;
}
case ITEM_TIME_MOVING: {
if (analysis.isTimeMoving()) {
items.add(statBlock);
}
break;
}
}
}

View file

@ -47,7 +47,7 @@ public class SegmentsCard extends BaseCard {
WrapContentHeightViewPager pager = segmentView.findViewById(R.id.pager);
PagerSlidingTabStrip tabLayout = segmentView.findViewById(R.id.sliding_tabs);
pager.setAdapter(new GPXItemPagerAdapter(app, displayItem, displayHelper, nightMode, listener));
pager.setAdapter(new GPXItemPagerAdapter(app, displayItem, displayHelper, nightMode, listener, false));
tabLayout.setViewPager(pager);
container.addView(segmentView);

View file

@ -399,7 +399,7 @@ public class TrackAppearanceFragment extends ContextMenuScrollFragment implement
public void onContextMenuDismiss(@NonNull ContextMenuFragment fragment) {
Fragment target = getTargetFragment();
if (target instanceof TripRecordingStartingBottomFragment) {
((TripRecordingStartingBottomFragment) target).show(UPDATE_TRACK_ICON);
((TripRecordingStartingBottomFragment) target).show();
} else if (target instanceof TripRecordingBottomFragment) {
((TripRecordingBottomFragment) target).show(UPDATE_TRACK_ICON);
}