Merge branch 'master' into select_gpx_track
# Conflicts: # OsmAnd/res/values/strings.xml
This commit is contained in:
commit
f0fc7e1ac4
40 changed files with 442 additions and 288 deletions
|
@ -144,4 +144,9 @@
|
|||
<string name="si_km_m">Kilomètres/mètres</string>
|
||||
<string name="si_nm">Miles nautiques</string>
|
||||
<string name="si_mi_meters">Miles / Mètres</string>
|
||||
<string name="nm_h">nœuds</string>
|
||||
<string name="shared_string_later">Plus tard</string>
|
||||
<string name="shared_string_password">Mot de passe</string>
|
||||
<string name="shared_string_distance">Distance</string>
|
||||
<string name="si_nm_h">Miles nautiques par heure (nœuds)</string>
|
||||
</resources>
|
|
@ -107,18 +107,6 @@
|
|||
android:drawSelectorOnTop="false"
|
||||
android:layout_gravity="start"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/drawer_footer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="start"
|
||||
android:visibility="gone">
|
||||
|
||||
<include layout="@layout/powered_by_osmand_item"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.drawerlayout.widget.DrawerLayout>
|
|
@ -449,9 +449,9 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:text="@string/update_existing"
|
||||
android:text="@string/replace_point_descr"
|
||||
android:textAppearance="@style/TextAppearance.ContextMenuSubtitle"
|
||||
tools:text="@string/update_existing" />
|
||||
tools:text="@string/replace_point_descr" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/list_item_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:contentDescription="@string/app_name_osmand"
|
||||
android:scaleType="centerInside"
|
||||
android:tint="@color/osmand_orange"
|
||||
android:src="@drawable/ic_action_osmand_logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:drawablePadding="24dp"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/list_item_height"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingLeft="4dp"
|
||||
android:text="@string/powered_by_osmand"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle"
|
||||
android:textStyle="normal" />
|
||||
|
||||
</LinearLayout>
|
|
@ -176,7 +176,8 @@
|
|||
<string name="user_name">El vostre nom d\'usuari d\'OSM</string>
|
||||
<string name="user_password">La vostra contrasenya a OSM</string>
|
||||
<string name="download_files_not_enough_space">No hi ha prou espai lliure per baixar %1$s MB (lliure: %2$s).</string>
|
||||
<string name="download_files_question_space">"Voleu baixar {0} fitxer(s)\? S\'ocuparà {1} MB (de {2} MB)."</string>
|
||||
<string name="download_files_question_space">"Voleu baixar {0} fitxer(s)\?
|
||||
\nS\'ocuparà {1} MB (de {2} MB)."</string>
|
||||
<string name="use_transparent_map_theme">Tema transparent</string>
|
||||
<string name="osmand_parking_event">Traieu el cotxe de l\'aparcament</string>
|
||||
<string name="rendering_attr_appMode_description">Optimitza el mapa per</string>
|
||||
|
@ -1813,8 +1814,8 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="route_distance">Distància:</string>
|
||||
<string name="route_duration">Durada:</string>
|
||||
<string name="missing_write_external_storage_permission">OsmAnd no té autorització per utilitzar la tarja de memòria</string>
|
||||
<string name="no_location_permission">L\'aplicació no tenia autorització per utilitzar les dades d\'ubicació.</string>
|
||||
<string name="no_camera_permission">L\'aplicació no tenia autorització per utilitzar la càmera.</string>
|
||||
<string name="no_location_permission">Autorització per accedir a les dades d\'ubicació.</string>
|
||||
<string name="no_camera_permission">Autorització per utilitzar la càmera.</string>
|
||||
<string name="no_microphone_permission">Autoritzeu accedir al micròfon.</string>
|
||||
<string name="impassable_road_desc">Indiqueu les vies que voleu evitar en la navegació.</string>
|
||||
<string name="shared_string_sound">So</string>
|
||||
|
@ -1881,8 +1882,11 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="osm_live_enter_user_name">Introduïu un nom públic</string>
|
||||
<string name="osm_live_subscription_settings">Configuració de la subscripció</string>
|
||||
<string name="upload_anonymously">Puja anònimament</string>
|
||||
<string name="download_files_error_not_enough_space">No hi ha prou espai! Calen {3} MB temporalment i {1} MB de permanents. (Només es disposa de {2} MB).</string>
|
||||
<string name="download_files_question_space_with_temp">Voleu baixar {0} fitxer(s)\? S\'utilitzen {3} MB temporalment i {1} MB permanentment. (De {2} MB).</string>
|
||||
<string name="download_files_error_not_enough_space">No hi ha prou espai!
|
||||
\nCalen {3} MB temporalment i {1} MB de permanents.
|
||||
\n(Només es disposa de {2} MB).</string>
|
||||
<string name="download_files_question_space_with_temp">Voleu baixar {0} fitxer(s)\?
|
||||
\nS\'utilitzen {3} MB temporalment i {1} MB permanentment. (De {2} MB).</string>
|
||||
<string name="shared_string_move_up">Puja ↑</string>
|
||||
<string name="shared_string_move_down">Baixa ↓</string>
|
||||
<string name="avoid_road">Evita la via</string>
|
||||
|
@ -1896,10 +1900,10 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="rendering_value_bold_name">Negreta</string>
|
||||
<string name="finish_navigation">Atura la navegació</string>
|
||||
<string name="full_report">Informe complert</string>
|
||||
<string name="open_street_map_login_and_pass">Nom d\'usuari i contrasenya d\'OpenStreetMap</string>
|
||||
<string name="open_street_map_login_and_pass">Nom d\'usuari i contrasenya d\'OSM</string>
|
||||
<string name="osm_live_subscribe_btn">Subscriviu</string>
|
||||
<string name="osm_live_subscription">Subscripció a OsmAnd Live</string>
|
||||
<string name="osm_live_email_desc">Cal proporcionar-vos informació respecte les aportacions.</string>
|
||||
<string name="osm_live_email_desc">Cal per atribuir-vos les vostres aportacions.</string>
|
||||
<string name="osm_live_support_region">Zona de suport</string>
|
||||
<string name="osm_live_thanks">Us agraïm el vostre recolçament a OsmAnd
|
||||
\nPer activar totes les noves funcionalitats us caldrà reiniciar OsmAnd.</string>
|
||||
|
@ -1922,7 +1926,9 @@ Per retornar a l\'estil habitual dels mapes d\'OsmAnd, només cal desactivar aqu
|
|||
<string name="map_marker">Marcador de mapa</string>
|
||||
<string name="file_name_containes_illegal_char">El nom de fitxer inclou un caràcter il·legal</string>
|
||||
<string name="no_map_markers_found">Afegiu els marcadors de mapa amb el mapa</string>
|
||||
<string name="osm_live_header">"Aquesta subscripció permet actualitzacions horàries de tots els mapes del món. Part dels ingressos es retornen a la comunitat OSM en retribuir cada contribució OSM. Si aprecieu OsmAnd i OSM i els voleu recolzar mentre l\'utilitzeu, aquesta és la via perfecta per fer-ho."</string>
|
||||
<string name="osm_live_header">"Aquesta subscripció permet actualitzacions horàries de tots els mapes del món.
|
||||
\nPart dels ingressos es retornen a la comunitat OSM en retribuir cada contribució OSM.
|
||||
\nSi aprecieu OsmAnd i OSM i els voleu recolzar mentre l\'utilitzeu, aquesta és la via perfecta per fer-ho."</string>
|
||||
<string name="upload_osm_note_description">Pugeu la vostra nota OSM anònimament o utilitzant el vostre perfil OpenStreetMap.org.</string>
|
||||
<string name="add_time_span">Afegeix un lapse de temps</string>
|
||||
<string name="rec_split">Divisió d\'enregistrament</string>
|
||||
|
@ -2301,13 +2307,13 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="download_depth_countours">Isòbates</string>
|
||||
<string name="nautical_maps">Cartes nàutiques</string>
|
||||
<string name="quick_action_auto_zoom">Escala automàtica del mapa activa/desactiva</string>
|
||||
<string name="quick_action_auto_zoom_desc">Prement aquest botó d\'acció commuteu l\'escala automàtica del mapa segons la vostra velocitat.</string>
|
||||
<string name="quick_action_auto_zoom_desc">Botó per commutar l\'activació del zoom automàtic segons la velocitat.</string>
|
||||
<string name="quick_action_auto_zoom_on">Activa l\'escala automàtica</string>
|
||||
<string name="quick_action_auto_zoom_off">Desactiva l\'escala automàtica</string>
|
||||
<string name="quick_action_add_destination">Establiu destinació</string>
|
||||
<string name="quick_action_replace_destination">Substitueix destinació</string>
|
||||
<string name="quick_action_add_first_intermediate">Afegeix primer intermedi</string>
|
||||
<string name="quick_action_add_destination_desc">Un botó per establir el punt central de la pantalla com la nova destinació i qualsevol destinació anterior esdevé la darrera destinació intermèdia.</string>
|
||||
<string name="quick_action_add_destination_desc">Un botó per establir el punt central de la pantalla com la nova destinació i que la destinació anterior esdevingui la darrera fita.</string>
|
||||
<string name="quick_action_replace_destination_desc">Un botó per fer del punt central de la pantalla la nova destinació, substituint la destinació anterior (si n\'hi hagués).</string>
|
||||
<string name="quick_action_add_first_intermediate_desc">Un botó per fer del punt central de la pantalla la primera fita.</string>
|
||||
<string name="depth_contour_descr">Isòbates i fondàries nàutiques puntuals.</string>
|
||||
|
@ -2384,15 +2390,15 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="display_zoom_level">Nivell d\'escala de visualització: %1$s</string>
|
||||
<string name="route_is_too_long_v2">En rutes llargues: Afegiu fites intermèdies si no es troba cap resultat en 10 minuts.</string>
|
||||
<string name="srtm_color_scheme">Combinació de colors</string>
|
||||
<string name="show_from_zoom_level">Mostra segons el nivell d\'escala</string>
|
||||
<string name="show_from_zoom_level">Mostra començant pel nivell d\'escala</string>
|
||||
<string name="routing_attr_allow_private_name">Permet l\'accés privat</string>
|
||||
<string name="routing_attr_allow_private_description">Permet l\'accés a zones privades.</string>
|
||||
<string name="hillshade_menu_download_descr">Baixeu el mapa \'Ombrejat de relleu\' per veure ombrejat segons alçada.</string>
|
||||
<string name="hillshade_purchase_header">Per veure ombrejat de relleu en el mapa us cal comprar i Instal·lar el connector \'Corbes de nivell\'</string>
|
||||
<string name="hillshade_purchase_header">Instal·leu el connector \'Corbes de nivell\' per veure àrees graduades verticalment.</string>
|
||||
<string name="shared_string_plugin">Connector</string>
|
||||
<string name="srtm_purchase_header">Compreu i instal·leu el connector \'Corbes de nivell\' per visualitzar una gradació vertical d\'àrees.</string>
|
||||
<string name="srtm_menu_download_descr">Baixeu el mapa \'Corbes de nivell\' per utilitzar-les en aquesta zona.</string>
|
||||
<string name="hide_from_zoom_level">Amaga segons el nivell d\'escala</string>
|
||||
<string name="hide_from_zoom_level">Amaga començant pel nivell d\'escala</string>
|
||||
<string name="quick_action_showhide_osmbugs_title">Mostra o amaga notes OSM</string>
|
||||
<string name="quick_action_osmbugs_show">Mostra notes OSM</string>
|
||||
<string name="quick_action_osmbugs_hide">Amaga notes OSM</string>
|
||||
|
@ -3407,7 +3413,7 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="choose_icon_color_name">Icona, color i nom</string>
|
||||
<string name="reorder_profiles">Edita la llista de perfils</string>
|
||||
<string name="selected_profile">Perfil seleccionat</string>
|
||||
<string name="quick_action_directions_from_desc">Un botó per establir el punt central de la pantalla com el punt de sortida i calcular la ruta vers la destinació o obrir una petició per seleccionar-la si no hi ha un marcador de destinació al mapa.</string>
|
||||
<string name="quick_action_directions_from_desc">Un botó per establir el punt central de la pantalla com el punt de sortida. Llavors, demanarà seleccionar-la destinació o iniciar el càlcul de la ruta.</string>
|
||||
<string name="logcat_buffer">Memòria intermèdia del Logcat</string>
|
||||
<string name="reset_confirmation_descr">Prement %1$s es perdran tots els vostres canvis.</string>
|
||||
<string name="reset_all_profile_settings_descr">Restableix tota la configuració del perfil als valors predeterminats de la instal·lació.</string>
|
||||
|
@ -3580,4 +3586,7 @@ Abasta l\'àrea: %1$s x %2$s</string>
|
|||
<string name="terrain_empty_state_text">Activeu la visió de l\'ombrejat de relleu o del mapa de pistes. Us podeu informar d\'aquests tipus de mapa a la nostra web</string>
|
||||
<string name="app_mode_ski_touring">Esquí de ruta</string>
|
||||
<string name="app_mode_ski_snowmobile">Moto de neu</string>
|
||||
<string name="slope_description">Les pistes es mostren sobre el terreny i amb colors.</string>
|
||||
<string name="download_slope_maps">Pistes</string>
|
||||
<string name="custom_osmand_plugin">Connector d\'OsmAnd adaptat</string>
|
||||
</resources>
|
|
@ -3817,4 +3817,6 @@
|
|||
<string name="poi_drinking_water_refill_yes">Remplissage d\'eau potable : oui</string>
|
||||
<string name="poi_drinking_water_refill_no">Remplissage d\'eau potable : non</string>
|
||||
<string name="poi_drinking_water_refill_network">Réseau de remplissage d\'eau potable</string>
|
||||
<string name="poi_traffic_signals_sound_locate">Uniquement si la marche est autorisée</string>
|
||||
<string name="poi_internet_access_fee_customers">Signal pour trouver le pôle</string>
|
||||
</resources>
|
|
@ -998,7 +998,7 @@
|
|||
<string name="plugin_distance_point">נקודה</string>
|
||||
<string name="gpx_file_name">קובץ שם ה־GPX</string>
|
||||
<string name="gpx_saved_sucessfully">קובץ ה־GPX נשמר אל {0}</string>
|
||||
<string name="osmand_distance_planning_plugin_description">תוסף זה מספק וידג׳ט על המפה שמאפשר ליצור נתיבים על ידי לחיצה על המפה או להשתמש או לשנות קובץ GPX קיים, לטובת תכנון טיול ומדידת מרחק בין נקודות. ניתן לשמור את התוצאות בקובץ GPX, בו ניתן להשתמש לאחר מכן להנחיה.</string>
|
||||
<string name="osmand_distance_planning_plugin_description">ניתן ליצור נתיבים על ידי לחיצה על המפה או על ידי עריכת קובץ GPX קיים, לטובת תכנון טיול ומדידת מרחק בין נקודות. ניתן לשמור את התוצאות בקובץ GPX, בו ניתן להשתמש לאחר מכן להנחיה.</string>
|
||||
<string name="osmand_distance_planning_plugin_name">מחשבון מרחק וכלי תכנון</string>
|
||||
<string name="shared_string_do_not_show_again">לא להציג שוב</string>
|
||||
<string name="distance_measurement_start_editing">להתחיל בעריכה</string>
|
||||
|
@ -3382,12 +3382,12 @@
|
|||
<string name="rendering_attr_showCycleNodeNetworkRoutes_name">הצגת מסלולי אופניים של רשת מפרקים</string>
|
||||
<string name="download_map_dialog">דו־שיח הורדת מפה</string>
|
||||
<string name="dialogs_and_notifications_title">תיבות דו־שיח והתראות</string>
|
||||
<string name="dialogs_and_notifications_descr">שליטה בחלוניות הקופצות, בתיבות הדו־שיח ובהתראות שמוצגות במהלך השימוש ב־OsmAnd.</string>
|
||||
<string name="dialogs_and_notifications_descr">שליטה בחלוניות הקופצות, בתיבות הדו־שיח ובהתראות.</string>
|
||||
<string name="rendering_value_walkingRoutesOSMCNodes_name">רשתות מפרקים</string>
|
||||
<string name="suggested_maps">מפות מוצעות</string>
|
||||
<string name="suggested_maps_descr">המפות האלו נחוצות לטובת שימוש עם תוסף</string>
|
||||
<string name="suggested_maps_descr">המפות האלו נחוצות לתוסף.</string>
|
||||
<string name="added_profiles">הוספת פרופילים</string>
|
||||
<string name="added_profiles_descr">התוסף מוסיף פרופיל חדש ל־OsmAnd</string>
|
||||
<string name="added_profiles_descr">פרופילים שנוספו על ידי תוסף</string>
|
||||
<string name="shared_string_turn_off">כיבוי</string>
|
||||
<string name="new_plugin_added">נוסף תוסף חדש</string>
|
||||
<string name="join_segments">חיבור מקטעים</string>
|
||||
|
@ -3408,11 +3408,11 @@
|
|||
<string name="delete_profiles_descr">נגיעה ב־‚החלה’ תמחק את הפרופילים שהוסרו לצמיתות.</string>
|
||||
<string name="master_profile">פרופיל ראשי</string>
|
||||
<string name="select_color">בחירת צבע</string>
|
||||
<string name="edit_profiles_descr">לא ניתן למחוק את פרופילי בררת המחדל של OsmAnd, אך ניתן להשבית אותם במסך הקודם או להעביר אותם לתחתית.</string>
|
||||
<string name="edit_profiles_descr">לא ניתן למחוק את פרופילי בררת המחדל של OsmAnd, אך ניתן להשבית אותם (במסך הקודם) או להוריד אותם לתחתית.</string>
|
||||
<string name="edit_profiles">עריכת פרופילים</string>
|
||||
<string name="select_nav_profile_dialog_message">סוג הניווט משפיע על כללי חישוב המסלול.</string>
|
||||
<string name="select_nav_profile_dialog_message">‚סוג הניווט’ מגבש את אופן חישוב המסלול.</string>
|
||||
<string name="profile_appearance">הופעת פרופיל</string>
|
||||
<string name="choose_icon_color_name">נא לבחור סמל, צבע ושם</string>
|
||||
<string name="choose_icon_color_name">סמל, צבע ושם</string>
|
||||
<string name="reorder_profiles">עריכת רשימת הפרופילים</string>
|
||||
<string name="selected_profile">פרופיל נבחר</string>
|
||||
<string name="reset_confirmation_descr">נגיעה ב־%1$s תוביל לאבדן כל השינויים שערכת.</string>
|
||||
|
@ -3583,4 +3583,13 @@
|
|||
<string name="tracks_view_descr">המסלולים המוקלטים שלך נמצאים תחת %1$s, או בתיקייה של OsmAnd.</string>
|
||||
<string name="app_mode_ski_snowmobile">אופנוע שלג</string>
|
||||
<string name="custom_osmand_plugin">תוסף OsmAnd מותאם אישית</string>
|
||||
<string name="live_monitoring_adress">כתובת</string>
|
||||
<string name="live_monitoring_time_buffer">מאגר זמן</string>
|
||||
<string name="monitoring_notification">התראה</string>
|
||||
<string name="live_monitoring_adress_descr">נא לציין את הכתובת עם תחביר משתנים: lat={0}, lon={1}, timestamp={2}, hdop={3}, altitude={4}, speed={5}, bearing={6}.</string>
|
||||
<string name="monitoring_min_speed">מהירות מזערית</string>
|
||||
<string name="monitoring_min_accuracy">דיוק מזערי</string>
|
||||
<string name="monitoring_min_distance">תזוזה מזערית</string>
|
||||
<string name="multimedia_rec_split_title">פיצול מקליט</string>
|
||||
<string name="reset_plugin_to_default">איפוס הגדרות התוסף לבררת המחדל</string>
|
||||
</resources>
|
|
@ -1190,8 +1190,8 @@
|
|||
<string name="poi_payment_paypal_no">Non si accetta PayPal</string>
|
||||
<string name="poi_payment_gift_card_yes">Carte regalo</string>
|
||||
<string name="poi_description_payment">Descrizione del pagamento</string>
|
||||
<string name="poi_internet_access_fee_yes">Accesso a Internet - a pagamento</string>
|
||||
<string name="poi_internet_access_fee_no">Accesso a Internet - senza pagamento</string>
|
||||
<string name="poi_internet_access_fee_yes">Accesso a Internet: a pagamento</string>
|
||||
<string name="poi_internet_access_fee_no">Accesso a Internet: senza pagamento</string>
|
||||
<string name="poi_diet_vegetarian_yes">Vegetariana</string>
|
||||
<string name="poi_diet_vegan_only">Solo Vegana</string>
|
||||
<string name="poi_diet_vegan_yes">Vegana</string>
|
||||
|
@ -2285,7 +2285,7 @@
|
|||
<string name="poi_payment_union_card_no">Union Card non accettata</string>
|
||||
<string name="poi_payment_mtsmoney_yes">MTS-Money</string>
|
||||
<string name="poi_payment_mtsmoney_no">MTS-Money non accettato</string>
|
||||
<string name="poi_brewery_additional">Birre</string>
|
||||
<string name="poi_brewery_additional">Nome della birreria</string>
|
||||
<string name="poi_fire_hydrant_style_water_source_main">Principale</string>
|
||||
<string name="poi_fire_hydrant_style_water_source_pond">Stagno</string>
|
||||
<string name="poi_fire_hydrant_style_water_source_stream">Ruscello</string>
|
||||
|
@ -2519,7 +2519,7 @@
|
|||
<string name="poi_group_only_yes">Solo gruppi: sì</string>
|
||||
<string name="poi_group_only_no">Solo gruppi: no</string>
|
||||
<string name="poi_shower_indoor">Doccia: interno</string>
|
||||
<string name="poi_social_facility_group_home">Casa famiglia</string>
|
||||
<string name="poi_social_facility_group_home">Casa di gruppo</string>
|
||||
<string name="poi_social_facility_food_bank">Banco alimentare</string>
|
||||
<string name="poi_social_facility_shelter">Riparo</string>
|
||||
<string name="poi_social_facility_for_drug_addicted">Tossicodipendenti</string>
|
||||
|
@ -2553,7 +2553,7 @@
|
|||
<string name="poi_health_specialty_osteopathy_yes">Osteopatia</string>
|
||||
<string name="poi_health_specialty_anaesthetics_yes">Anestesiologia</string>
|
||||
<string name="poi_health_specialty_pulmonology_yes">Pneumologia</string>
|
||||
<string name="poi_bicycle_repair_station">Stazione fai-da-te riparazione bici</string>
|
||||
<string name="poi_bicycle_repair_station">Stazione di riparazione biciclette;Stazione fai-da-te riparazione bici</string>
|
||||
<string name="poi_counselling_type_family_yes">Consultorio (familiare): si</string>
|
||||
<string name="poi_counselling_type_family_no">Consultorio (familiare): no</string>
|
||||
<string name="poi_pump_status_broken">Stato della pompa: rotta</string>
|
||||
|
@ -2565,7 +2565,7 @@
|
|||
<string name="poi_water_purification_chlorine">Cloro</string>
|
||||
<string name="poi_water_purification_reverse_osmosis">Osmosi inversa</string>
|
||||
<string name="poi_water_purification_aquatabs">Aquatabs</string>
|
||||
<string name="poi_water_supply_pipeline">Acquedotto</string>
|
||||
<string name="poi_water_supply_pipeline">Conduttura</string>
|
||||
<string name="poi_water_supply_running_water">Acqua corrente</string>
|
||||
<string name="poi_water_supply_borehole">Pozzo</string>
|
||||
<string name="poi_water_supply_bottled_water">Acqua imbottigliata</string>
|
||||
|
@ -2817,5 +2817,5 @@
|
|||
<string name="poi_greenhouse_horticulture">Orticoltura in serra</string>
|
||||
<string name="poi_branch">Filiale</string>
|
||||
<string name="poi_resource_aggregate">Aggregato</string>
|
||||
<string name="poi_resource_beryl">berillio</string>
|
||||
<string name="poi_resource_beryl">Berillio</string>
|
||||
</resources>
|
|
@ -1341,7 +1341,7 @@ Memoria in proporzione %4$s MB (limite di Android %5$s MB, Dalvik %6$s MB).</str
|
|||
<string name="rendering_value_americanRoadAtlas_name">Atlante strade americane</string>
|
||||
<string name="routing_attr_no_new_routing_name">Ignora le regole di calcolo del percorso v1.9</string>
|
||||
<string name="routing_attr_no_new_routing_description">Non usare le regole di calcolo del percorso introdotte nella v1.9.</string>
|
||||
<string name="traffic_warning_railways">Passaggio a livello</string>
|
||||
<string name="traffic_warning_railways">Attraversamento ferroviario</string>
|
||||
<string name="traffic_warning_pedestrian">Attraversamento pedonale</string>
|
||||
<string name="show_railway_warnings">Passaggi a livello</string>
|
||||
<string name="show_pedestrian_warnings">Attraversamenti pedonali</string>
|
||||
|
|
|
@ -3794,4 +3794,10 @@
|
|||
<string name="poi_tactile_paving_incorrect">正しく設置されていない点字ブロック</string>
|
||||
<string name="poi_tactile_paving_primitive">非点字ブロックだが凹凸で判断可</string>
|
||||
<string name="poi_tactile_paving_contrasted">一般的な点字ブロック</string>
|
||||
<string name="poi_seamark_water_level_floods">水位:湿っている</string>
|
||||
<string name="poi_seamark_water_level_dry">水位:常時乾燥</string>
|
||||
<string name="poi_seamark_water_level_submerged">水位:常時水没</string>
|
||||
<string name="poi_seamark_water_level_awash">水位:干潮時などは冠水</string>
|
||||
<string name="poi_seamark_water_level_covers">水位:覆われること有り</string>
|
||||
<string name="poi_seamark_water_level_part_submerged">水位:部分的に水没</string>
|
||||
</resources>
|
|
@ -3608,4 +3608,7 @@ Reprezentuje obszar: %1$s x %2$s</string>
|
|||
\n
|
||||
\nTo może zająć chwilę.</string>
|
||||
<string name="shared_string_min">Min</string>
|
||||
<string name="shared_string_octagon">Ośmiokąt</string>
|
||||
<string name="app_mode_ski_touring">Turystyka narciarska</string>
|
||||
<string name="app_mode_ski_snowmobile">Skuter śnieżny</string>
|
||||
</resources>
|
|
@ -2237,7 +2237,7 @@
|
|||
<string name="storage_free_space">Свободное место</string>
|
||||
<string name="search_location">Определение местоположения…</string>
|
||||
<string name="no_inet_connection_desc_map">Требуется загрузить карты</string>
|
||||
<string name="no_inet_connection">Соединение с Интернетом отсутствует</string>
|
||||
<string name="no_inet_connection">Соединение с интернетом отсутствует</string>
|
||||
<string name="location_not_found">Не удалось определить местоположение</string>
|
||||
<string name="first_usage_wizard_desc">OsmAnd определит ваше местоположение и предложит загрузить карты для этой области.</string>
|
||||
<string name="search_map">Поиск карт…</string>
|
||||
|
@ -3565,4 +3565,29 @@
|
|||
<string name="import_complete_description">Все данные из %1$s импортированы, вы можете использовать кнопки ниже, чтобы открыть соответствующий раздел приложения для управления ими.</string>
|
||||
<string name="recalculate_route_distance_promo">Маршрут будет пересчитан, если расстояние от маршрута до текущего местоположения больше выбранного значения.</string>
|
||||
<string name="select_distance_route_will_recalc">Выберите расстояние, после которого маршрут будет пересчитан.</string>
|
||||
<string name="shared_string_legend">Легенда</string>
|
||||
<string name="search_offline_geo_error">Невозможно разобрать геоссылку \"%s\".</string>
|
||||
<string name="hillshade_download_description"></string>
|
||||
<string name="shared_string_min">Мин.</string>
|
||||
<string name="terrain_empty_state_text"></string>
|
||||
<string name="shared_string_transparency">Прозрачность</string>
|
||||
<string name="shared_string_zoom_levels">Уровни масштаба</string>
|
||||
<string name="recalculate_route_in_deviation">Пересчитывать маршрут в случае отклонения</string>
|
||||
<string name="n_items_of_z">%1$s из %2$s</string>
|
||||
<string name="terrain_slider_description">Настройка минимального и максимального уровней масштабирования, при которых слой будет отображаться.</string>
|
||||
<string name="quick_action_show_hide_terrain">Показать/скрыть рельеф</string>
|
||||
<string name="quick_action_terrain_descr">Кнопка для отображения или скрытия слоя рельефа местности на карте.</string>
|
||||
<string name="quick_action_terrain_show">Показать рельеф</string>
|
||||
<string name="quick_action_terrain_hide">Скрыть рельеф</string>
|
||||
<string name="shared_string_terrain">Рельеф</string>
|
||||
<string name="app_mode_ski_touring">Лыжный туризм</string>
|
||||
<string name="app_mode_ski_snowmobile">Снегоход</string>
|
||||
<string name="custom_osmand_plugin">Пользовательский плагин</string>
|
||||
<string name="delete_description">Удалить описание</string>
|
||||
<string name="add_description">Добавить описание</string>
|
||||
<string name="select_group">Выберите группу</string>
|
||||
<string name="shared_string_square">Квадрат</string>
|
||||
<string name="select_shape">Выберите фигуру</string>
|
||||
<string name="shared_string_circle">Круг</string>
|
||||
<string name="shared_string_octagon">Восьмиугольник</string>
|
||||
</resources>
|
|
@ -12,9 +12,14 @@
|
|||
|
||||
-->
|
||||
<string name="select_track_file">Select track file</string>
|
||||
<string name="settings_item_import_error">Could not import %1$s.</string>
|
||||
<string name="settings_item_write_error">Could not write %1$s.</string>
|
||||
<string name="settings_item_read_error">Could not read %1$s.</string>
|
||||
<string name="changes_applied_to_profile">Changes applied to %1$s profile.</string>
|
||||
<string name="custom_osmand_plugin">Custom OsmAnd plugin</string>
|
||||
<string name="app_mode_ski_snowmobile">Snowmobile</string>
|
||||
<string name="app_mode_ski_touring">Ski touring</string>
|
||||
<string name="replace_point_descr">Replace another point with this</string>
|
||||
<string name="shared_string_min">Min</string>
|
||||
<string name="shared_string_square">Square</string>
|
||||
<string name="shared_string_octagon">Octagon</string>
|
||||
|
|
|
@ -784,4 +784,18 @@ public class AndroidUtils {
|
|||
|
||||
return newName;
|
||||
}
|
||||
|
||||
public static StringBuilder formatWarnings(List<String> warnings) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
boolean f = true;
|
||||
for (String w : warnings) {
|
||||
if (f) {
|
||||
f = false;
|
||||
} else {
|
||||
builder.append('\n');
|
||||
}
|
||||
builder.append(w);
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
}
|
|
@ -16,6 +16,7 @@ import android.os.Build;
|
|||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.IProgress;
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.PlatformUtil;
|
||||
|
@ -761,7 +762,7 @@ public class AppInitializer implements IProgress {
|
|||
appInitializing = false;
|
||||
notifyFinish();
|
||||
if (warnings != null && !warnings.isEmpty()) {
|
||||
app.showToastMessage(formatWarnings(warnings).toString());
|
||||
app.showToastMessage(AndroidUtils.formatWarnings(warnings).toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -880,22 +881,6 @@ public class AppInitializer implements IProgress {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private StringBuilder formatWarnings(List<String> warnings) {
|
||||
final StringBuilder b = new StringBuilder();
|
||||
boolean f = true;
|
||||
for (String w : warnings) {
|
||||
if (f) {
|
||||
f = false;
|
||||
} else {
|
||||
b.append('\n');
|
||||
}
|
||||
b.append(w);
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
public void notifyFinish() {
|
||||
app.uiHandler.post(new Runnable() {
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.osmand.plus.activities.HelpActivity;
|
|||
import net.osmand.plus.activities.actions.AppModeDialog;
|
||||
import net.osmand.plus.dialogs.ConfigureMapMenu;
|
||||
import net.osmand.plus.dialogs.HelpArticleDialogFragment;
|
||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
|
@ -258,6 +259,9 @@ public class ContextMenuAdapter {
|
|||
icon.setVisibility(View.INVISIBLE);
|
||||
desc.setVisibility(View.GONE);
|
||||
} else {
|
||||
AndroidUiHelper.updateVisibility(icon, true);
|
||||
AndroidUiHelper.updateVisibility(desc, true);
|
||||
AndroidUtils.setTextPrimaryColor(app, title, nightMode);
|
||||
icon.setImageDrawable(mIconsCache.getIcon(item.getIcon(), colorResId));
|
||||
desc.setText(item.getDescription());
|
||||
boolean selectedMode = tag == PROFILES_CHOSEN_PROFILE_TAG;
|
||||
|
|
|
@ -186,13 +186,21 @@ public class CustomOsmandPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
public File getPluginDir() {
|
||||
return new File(app.getAppPath(null), IndexConstants.PLUGINS_DIR + pluginId);
|
||||
return app.getAppPath(IndexConstants.PLUGINS_DIR + pluginId);
|
||||
}
|
||||
|
||||
public File getPluginItemsFile() {
|
||||
return new File(getPluginDir(), "items" + IndexConstants.OSMAND_SETTINGS_FILE_EXT);
|
||||
}
|
||||
|
||||
public File getPluginResDir() {
|
||||
File pluginDir = getPluginDir();
|
||||
if (!Algorithms.isEmpty(resourceDirName)) {
|
||||
return new File(pluginDir, resourceDirName);
|
||||
}
|
||||
return pluginDir;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return pluginId;
|
||||
|
@ -375,9 +383,7 @@ public class CustomOsmandPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
public void loadResources() {
|
||||
if (!Algorithms.isEmpty(resourceDirName)) {
|
||||
File pluginDir = new File(app.getAppPath(null), IndexConstants.PLUGINS_DIR + pluginId);
|
||||
File pluginResDir = new File(pluginDir, resourceDirName);
|
||||
File pluginResDir = getPluginResDir();
|
||||
if (pluginResDir.exists() && pluginResDir.isDirectory()) {
|
||||
File[] files = pluginResDir.listFiles();
|
||||
for (File resFile : files) {
|
||||
|
@ -391,7 +397,6 @@ public class CustomOsmandPlugin extends OsmandPlugin {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Drawable getIconForFile(String path, Map<String, String> fileNames) {
|
||||
for (Map.Entry<String, String> entry : fileNames.entrySet()) {
|
||||
|
|
|
@ -17,6 +17,7 @@ import androidx.annotation.Nullable;
|
|||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.IProgress;
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.aidl.ConnectedApp;
|
||||
import net.osmand.data.LocationPoint;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
|
@ -24,22 +25,28 @@ import net.osmand.plus.activities.PluginsActivity;
|
|||
import net.osmand.plus.activities.SettingsActivity;
|
||||
import net.osmand.plus.activities.TrackActivity;
|
||||
import net.osmand.plus.download.DownloadActivity;
|
||||
import net.osmand.plus.helpers.ImportHelper;
|
||||
import net.osmand.plus.helpers.WaypointHelper;
|
||||
import net.osmand.plus.myplaces.FavoritesActivity;
|
||||
import net.osmand.plus.routing.RouteCalculationResult;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
|
@ -53,10 +60,13 @@ public class OsmAndAppCustomization {
|
|||
|
||||
private static final int MAX_NAV_DRAWER_ITEMS_PER_APP = 3;
|
||||
|
||||
private static final Log LOG = PlatformUtil.getLog(OsmAndAppCustomization.class);
|
||||
|
||||
protected OsmandApplication app;
|
||||
protected OsmandSettings osmandSettings;
|
||||
|
||||
private Bitmap navDrawerLogo;
|
||||
private Map<String, Bitmap> navDrawerLogos = new HashMap<>();
|
||||
|
||||
private ArrayList<String> navDrawerParams;
|
||||
|
||||
private String navDrawerFooterIntent;
|
||||
|
@ -134,7 +144,6 @@ public class OsmAndAppCustomization {
|
|||
}
|
||||
|
||||
public boolean restoreOsmand() {
|
||||
navDrawerLogo = null;
|
||||
featuresCustomized = false;
|
||||
widgetsCustomized = false;
|
||||
customOsmandSettings = null;
|
||||
|
@ -218,7 +227,30 @@ public class OsmAndAppCustomization {
|
|||
|
||||
@Nullable
|
||||
public Bitmap getNavDrawerLogo() {
|
||||
return navDrawerLogo;
|
||||
ApplicationMode mode = app.getSettings().APPLICATION_MODE.get();
|
||||
Bitmap drawerLogo = navDrawerLogos.get(mode.getStringKey());
|
||||
if (drawerLogo == null) {
|
||||
String logoFileName = app.getSettings().NAV_DRAWER_LOGO.get();
|
||||
if (!Algorithms.isEmpty(logoFileName)) {
|
||||
try {
|
||||
JSONObject json = new JSONObject(logoFileName);
|
||||
for (Iterator<String> it = json.keys(); it.hasNext(); ) {
|
||||
String iconPath = json.getString(it.next());
|
||||
|
||||
File iconFile = app.getAppPath(iconPath);
|
||||
if (iconFile.exists()) {
|
||||
drawerLogo = BitmapFactory.decodeFile(iconFile.getAbsolutePath());
|
||||
navDrawerLogos.put(mode.getStringKey(), drawerLogo);
|
||||
break;
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
LOG.error("Failed to read json", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return drawerLogo;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
@ -227,20 +259,46 @@ public class OsmAndAppCustomization {
|
|||
}
|
||||
|
||||
public boolean setNavDrawerLogo(String uri, @Nullable String packageName, @Nullable String intent) {
|
||||
String connectedAppDirPath = IndexConstants.PLUGINS_DIR + packageName;
|
||||
File connectedAppDir = app.getAppPath(connectedAppDirPath);
|
||||
if (TextUtils.isEmpty(uri)) {
|
||||
navDrawerLogo = null;
|
||||
app.getSettings().NAV_DRAWER_LOGO.resetToDefault();
|
||||
Algorithms.removeAllFiles(connectedAppDir);
|
||||
} else {
|
||||
try {
|
||||
InputStream is = app.getContentResolver().openInputStream(Uri.parse(uri));
|
||||
Uri fileUri = Uri.parse(uri);
|
||||
InputStream is = app.getContentResolver().openInputStream(fileUri);
|
||||
if (is != null) {
|
||||
navDrawerLogo = BitmapFactory.decodeStream(is);
|
||||
String iconName = ImportHelper.getNameFromContentUri(app, fileUri);
|
||||
if (!connectedAppDir.exists()) {
|
||||
connectedAppDir.mkdirs();
|
||||
}
|
||||
OutputStream fout = new FileOutputStream(new File(connectedAppDir, iconName));
|
||||
try {
|
||||
Algorithms.streamCopy(is, fout);
|
||||
} finally {
|
||||
try {
|
||||
is.close();
|
||||
|
||||
} catch (IOException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
try {
|
||||
fout.close();
|
||||
} catch (IOException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
}
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("", connectedAppDirPath + "/" + iconName);
|
||||
app.getSettings().NAV_DRAWER_LOGO.set(json.toString());
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
LOG.error(e);
|
||||
return false;
|
||||
} catch (JSONException e) {
|
||||
LOG.error("Failed to read json", e);
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
LOG.error("Failed to write file", e);
|
||||
}
|
||||
if (packageName != null && intent != null) {
|
||||
navDrawerParams = new ArrayList<>();
|
||||
|
|
|
@ -190,6 +190,10 @@ public abstract class OsmandPlugin {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
protected List<QuickActionType> getQuickActionTypes() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin was installed
|
||||
*/
|
||||
|
@ -496,9 +500,6 @@ public abstract class OsmandPlugin {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
}
|
||||
|
||||
protected void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) {
|
||||
}
|
||||
|
||||
|
@ -789,12 +790,10 @@ public abstract class OsmandPlugin {
|
|||
|
||||
public static void registerQuickActionTypesPlugins(List<QuickActionType> quickActionTypes) {
|
||||
for (OsmandPlugin p : getEnabledPlugins()) {
|
||||
p.registerQuickActionTypes(quickActionTypes);
|
||||
quickActionTypes.addAll(p.getQuickActionTypes());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void updateLocationPlugins(net.osmand.Location location) {
|
||||
for (OsmandPlugin p : getEnabledPlugins()) {
|
||||
p.updateLocation(location);
|
||||
|
|
|
@ -1287,6 +1287,7 @@ public class OsmandSettings {
|
|||
|
||||
public final CommonPreference<String> API_NAV_DRAWER_ITEMS_JSON = new StringPreference("api_nav_drawer_items_json", "{}").makeGlobal();
|
||||
public final CommonPreference<String> API_CONNECTED_APPS_JSON = new StringPreference("api_connected_apps_json", "[]").makeGlobal();
|
||||
public final CommonPreference<String> NAV_DRAWER_LOGO = new StringPreference("nav_drawer_logo", "").makeProfile();
|
||||
|
||||
public final CommonPreference<Integer> NUMBER_OF_STARTS_FIRST_XMAS_SHOWN = new IntPreference("number_of_starts_first_xmas_shown", 0).makeGlobal();
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import androidx.annotation.Nullable;
|
|||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.data.LatLon;
|
||||
|
@ -142,6 +143,8 @@ public class SettingsHelper {
|
|||
|
||||
boolean shouldReplace = false;
|
||||
|
||||
protected List<String> warnings;
|
||||
|
||||
SettingsItem(OsmandApplication app) {
|
||||
this.app = app;
|
||||
init();
|
||||
|
@ -149,6 +152,7 @@ public class SettingsHelper {
|
|||
|
||||
SettingsItem(OsmandApplication app, @NonNull JSONObject json) throws JSONException {
|
||||
this.app = app;
|
||||
warnings = new ArrayList<>();
|
||||
init();
|
||||
readFromJson(json);
|
||||
}
|
||||
|
@ -157,6 +161,10 @@ public class SettingsHelper {
|
|||
// override
|
||||
}
|
||||
|
||||
public List<String> getWarnings() {
|
||||
return warnings;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public abstract SettingsItemType getType();
|
||||
|
||||
|
@ -691,6 +699,7 @@ public class SettingsHelper {
|
|||
private ApplicationModeBuilder builder;
|
||||
private ApplicationModeBean modeBean;
|
||||
private Set<String> appModeBeanPrefsIds;
|
||||
private Map<String, String> drawerLogoParams;
|
||||
|
||||
public ProfileSettingsItem(@NonNull OsmandApplication app, @NonNull ApplicationMode appMode) {
|
||||
super(app.getSettings());
|
||||
|
@ -711,6 +720,11 @@ public class SettingsHelper {
|
|||
appModeBeanPrefsIds = new HashSet<>(Arrays.asList(app.getSettings().appModeBeanPrefsIds));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
drawerLogoParams = new HashMap<>();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public SettingsItemType getType() {
|
||||
|
@ -762,6 +776,27 @@ public class SettingsHelper {
|
|||
this.appMode = appMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
void readItemsFromJson(@NonNull JSONObject json) throws IllegalArgumentException {
|
||||
try {
|
||||
JSONObject drawerLogoJson = json.has("drawerLogo") ? json.getJSONObject("drawerLogo") : null;
|
||||
if (drawerLogoJson != null) {
|
||||
for (Iterator<String> it = drawerLogoJson.keys(); it.hasNext(); ) {
|
||||
String localeKey = it.next();
|
||||
String name = drawerLogoJson.getString(localeKey);
|
||||
drawerLogoParams.put(localeKey, name);
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public Map<String, String> getDrawerLogoParams() {
|
||||
return drawerLogoParams;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean exists() {
|
||||
return builder != null && ApplicationMode.valueOfStringKey(getName(), null) != null;
|
||||
|
@ -1229,6 +1264,7 @@ public class SettingsHelper {
|
|||
try {
|
||||
setInputStream(new FileInputStream(file));
|
||||
} catch (FileNotFoundException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_read_error, file.getName()));
|
||||
LOG.error("Failed to set input stream from file: " + file.getName(), e);
|
||||
}
|
||||
return super.getWriter();
|
||||
|
@ -1401,9 +1437,12 @@ public class SettingsHelper {
|
|||
}
|
||||
quickAction.setParams(params);
|
||||
items.add(quickAction);
|
||||
} else {
|
||||
warnings.add(app.getString(R.string.settings_item_read_error, name));
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
|
||||
throw new IllegalArgumentException("Json parse error", e);
|
||||
}
|
||||
}
|
||||
|
@ -1426,6 +1465,7 @@ public class SettingsHelper {
|
|||
}
|
||||
json.put("items", jsonArray);
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType())));
|
||||
LOG.error("Failed write to json", e);
|
||||
}
|
||||
}
|
||||
|
@ -1547,6 +1587,7 @@ public class SettingsHelper {
|
|||
items.add(filter);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
|
||||
throw new IllegalArgumentException("Json parse error", e);
|
||||
}
|
||||
}
|
||||
|
@ -1568,6 +1609,7 @@ public class SettingsHelper {
|
|||
}
|
||||
json.put("items", jsonArray);
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType())));
|
||||
LOG.error("Failed write to json", e);
|
||||
}
|
||||
}
|
||||
|
@ -1731,6 +1773,7 @@ public class SettingsHelper {
|
|||
items.add(template);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
|
||||
throw new IllegalArgumentException("Json parse error", e);
|
||||
}
|
||||
}
|
||||
|
@ -1765,6 +1808,7 @@ public class SettingsHelper {
|
|||
json.put("items", jsonArray);
|
||||
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType())));
|
||||
LOG.error("Failed write to json", e);
|
||||
}
|
||||
}
|
||||
|
@ -1900,6 +1944,7 @@ public class SettingsHelper {
|
|||
items.add(roadInfo);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_read_error, String.valueOf(getType())));
|
||||
throw new IllegalArgumentException("Json parse error", e);
|
||||
}
|
||||
}
|
||||
|
@ -1919,6 +1964,7 @@ public class SettingsHelper {
|
|||
}
|
||||
json.put("items", jsonArray);
|
||||
} catch (JSONException e) {
|
||||
warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType())));
|
||||
LOG.error("Failed write to json", e);
|
||||
}
|
||||
}
|
||||
|
@ -2142,7 +2188,8 @@ public class SettingsHelper {
|
|||
try {
|
||||
ZipEntry entry;
|
||||
while ((entry = zis.getNextEntry()) != null) {
|
||||
if (entry.getName().equals("items.json")) {
|
||||
String fileName = checkEntryName(entry.getName());
|
||||
if (fileName.equals("items.json")) {
|
||||
String itemsJson = null;
|
||||
try {
|
||||
itemsJson = Algorithms.readFromInputStream(ois).toString();
|
||||
|
@ -2188,7 +2235,7 @@ public class SettingsHelper {
|
|||
try {
|
||||
ZipEntry entry;
|
||||
while ((entry = zis.getNextEntry()) != null) {
|
||||
String fileName = entry.getName();
|
||||
String fileName = checkEntryName(entry.getName());
|
||||
SettingsItem item = null;
|
||||
for (SettingsItem settingsItem : items) {
|
||||
if (settingsItem != null && settingsItem.applyFileName(fileName)) {
|
||||
|
@ -2204,8 +2251,10 @@ public class SettingsHelper {
|
|||
reader.readFromStream(ois);
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
item.warnings.add(app.getString(R.string.settings_item_read_error, item.getName()));
|
||||
LOG.error("Error reading item data: " + item.getName(), e);
|
||||
} catch (IOException e) {
|
||||
item.warnings.add(app.getString(R.string.settings_item_read_error, item.getName()));
|
||||
LOG.error("Error reading item data: " + item.getName(), e);
|
||||
} finally {
|
||||
zis.closeEntry();
|
||||
|
@ -2220,6 +2269,15 @@ public class SettingsHelper {
|
|||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
private String checkEntryName(String entryName) {
|
||||
String fileExt = OSMAND_SETTINGS_FILE_EXT + "/";
|
||||
int index = entryName.indexOf(fileExt);
|
||||
if (index != -1) {
|
||||
entryName = entryName.substring(index + fileExt.length());
|
||||
}
|
||||
return entryName;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
@ -2447,6 +2505,13 @@ public class SettingsHelper {
|
|||
|
||||
private void finishImport(@Nullable SettingsImportListener listener, boolean success, @NonNull List<SettingsItem> items) {
|
||||
importTask = null;
|
||||
List<String> warnings = new ArrayList<>();
|
||||
for (SettingsItem item : items) {
|
||||
warnings.addAll(item.getWarnings());
|
||||
}
|
||||
if (!warnings.isEmpty()) {
|
||||
app.showToastMessage(AndroidUtils.formatWarnings(warnings).toString());
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onSettingsImportFinished(success, items);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ import net.osmand.plus.TargetPointsHelper;
|
|||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.activities.actions.OsmAndDialogs;
|
||||
import net.osmand.plus.activities.actions.OsmandRestoreOrExitDialog;
|
||||
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
|
||||
import net.osmand.plus.dialogs.FavoriteDialogs;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
|
@ -144,22 +143,18 @@ public class MapActivityActions implements DialogProvider {
|
|||
|
||||
private final MapActivity mapActivity;
|
||||
private OsmandSettings settings;
|
||||
private RoutingHelper routingHelper;
|
||||
|
||||
@NonNull
|
||||
private ImageView drawerLogoHeader;
|
||||
private View drawerOsmAndFooter;
|
||||
|
||||
private int drawerMode = DRAWER_MODE_NORMAL;
|
||||
|
||||
public MapActivityActions(MapActivity mapActivity) {
|
||||
this.mapActivity = mapActivity;
|
||||
settings = mapActivity.getMyApplication().getSettings();
|
||||
routingHelper = mapActivity.getMyApplication().getRoutingHelper();
|
||||
drawerLogoHeader = new ImageView(mapActivity);
|
||||
drawerLogoHeader.setPadding(-AndroidUtils.dpToPx(mapActivity, 8f), AndroidUtils.dpToPx(mapActivity, 16f), 0,
|
||||
0);
|
||||
drawerOsmAndFooter = mapActivity.getLayoutInflater().inflate(R.layout.powered_by_osmand_item, null);
|
||||
drawerLogoHeader.setPadding(-AndroidUtils.dpToPx(mapActivity, 8f),
|
||||
AndroidUtils.dpToPx(mapActivity, 16f), 0, 0);
|
||||
}
|
||||
|
||||
public void addAsTarget(double latitude, double longitude, PointDescription pd) {
|
||||
|
@ -1121,13 +1116,10 @@ public class MapActivityActions implements DialogProvider {
|
|||
menuItemsListView.setBackgroundColor(ContextCompat.getColor(mapActivity, R.color.list_background_color_light));
|
||||
}
|
||||
menuItemsListView.removeHeaderView(drawerLogoHeader);
|
||||
menuItemsListView.removeFooterView(drawerOsmAndFooter);
|
||||
Bitmap navDrawerLogo = getMyApplication().getAppCustomization().getNavDrawerLogo();
|
||||
final ArrayList<String> navDrawerLogoParams = getMyApplication().getAppCustomization().getNavDrawerLogoParams();
|
||||
|
||||
boolean customHeader = false;
|
||||
if (navDrawerLogo != null) {
|
||||
customHeader = true;
|
||||
drawerLogoHeader.setImageBitmap(navDrawerLogo);
|
||||
menuItemsListView.addHeaderView(drawerLogoHeader);
|
||||
}
|
||||
|
@ -1143,9 +1135,10 @@ public class MapActivityActions implements DialogProvider {
|
|||
mapActivity.dismissCardDialog();
|
||||
boolean hasHeader = menuItemsListView.getHeaderViewsCount() > 0;
|
||||
boolean hasFooter = menuItemsListView.getFooterViewsCount() > 0;
|
||||
if (hasHeader && position ==0 || (hasFooter && position== menuItemsListView.getCount() - 1)) {
|
||||
if(navDrawerLogoParams!=null) executeHeadersIntent(navDrawerLogoParams.get(0));
|
||||
else restoreOsmand();
|
||||
if (hasHeader && position == 0 || (hasFooter && position == menuItemsListView.getCount() - 1)) {
|
||||
if (navDrawerLogoParams != null) {
|
||||
executeHeadersIntent(navDrawerLogoParams.get(0));
|
||||
}
|
||||
} else {
|
||||
position -= menuItemsListView.getHeaderViewsCount();
|
||||
ContextMenuItem item = contextMenuAdapter.getItem(position);
|
||||
|
@ -1158,44 +1151,6 @@ public class MapActivityActions implements DialogProvider {
|
|||
}
|
||||
|
||||
});
|
||||
if (customHeader) {
|
||||
menuItemsListView.post(new Runnable() {
|
||||
public void run() {
|
||||
View footerLayout = mapActivity.findViewById(R.id.drawer_footer_layout);
|
||||
boolean showFooterLayout = false;
|
||||
if (menuItemsListView.getChildCount() > 0) {
|
||||
int numItemsVisible = menuItemsListView.getLastVisiblePosition() -
|
||||
menuItemsListView.getFirstVisiblePosition();
|
||||
View lastView = menuItemsListView.getChildAt(menuItemsListView.getLastVisiblePosition());
|
||||
boolean overlapped = lastView != null && lastView.getY() + lastView.getHeight() * 2 > menuItemsListView.getHeight();
|
||||
if (simpleListAdapter.getCount() - 1 > numItemsVisible || overlapped) {
|
||||
menuItemsListView.addFooterView(drawerOsmAndFooter);
|
||||
} else {
|
||||
showFooterLayout = true;
|
||||
}
|
||||
} else {
|
||||
showFooterLayout = true;
|
||||
}
|
||||
if (showFooterLayout) {
|
||||
footerLayout.setVisibility(View.VISIBLE);
|
||||
footerLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (navDrawerLogoParams != null) {
|
||||
mapActivity.closeDrawer();
|
||||
}
|
||||
new OsmandRestoreOrExitDialog()
|
||||
.show(mapActivity.getSupportFragmentManager(), "dialog");
|
||||
//showReturnConfirmationDialog(navDrawerLogoParams.get(0));
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
footerLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void executeHeadersIntent(String packageName) {
|
||||
|
|
|
@ -21,6 +21,7 @@ import android.widget.Toast;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AlertDialog.Builder;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
|
@ -599,16 +600,7 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
|||
|
||||
public static void showWarnings(final OsmandApplication app, List<String> warnings) {
|
||||
if (!warnings.isEmpty()) {
|
||||
final StringBuilder b = new StringBuilder();
|
||||
boolean f = true;
|
||||
for (String w : warnings) {
|
||||
if (f) {
|
||||
f = false;
|
||||
} else {
|
||||
b.append('\n');
|
||||
}
|
||||
b.append(w);
|
||||
}
|
||||
final StringBuilder b = AndroidUtils.formatWarnings(warnings);
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
@ -34,6 +34,7 @@ import androidx.appcompat.app.AlertDialog;
|
|||
import androidx.appcompat.widget.AppCompatCheckedTextView;
|
||||
import androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.IProgress;
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.data.PointDescription;
|
||||
|
@ -682,21 +683,11 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
|
|||
|
||||
protected void showWarnings(List<String> warnings) {
|
||||
if (!warnings.isEmpty()) {
|
||||
final StringBuilder b = new StringBuilder();
|
||||
boolean f = true;
|
||||
for (String w : warnings) {
|
||||
if (f) {
|
||||
f = false;
|
||||
} else {
|
||||
b.append('\n');
|
||||
}
|
||||
b.append(w);
|
||||
}
|
||||
final StringBuilder b = AndroidUtils.formatWarnings(warnings);
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(SettingsGeneralActivity.this, b.toString(), Toast.LENGTH_LONG).show();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -872,10 +872,12 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
protected List<QuickActionType> getQuickActionTypes() {
|
||||
ArrayList<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
quickActionTypes.add(TakeAudioNoteAction.TYPE);
|
||||
quickActionTypes.add(TakePhotoNoteAction.TYPE);
|
||||
quickActionTypes.add(TakeVideoNoteAction.TYPE);
|
||||
return quickActionTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -584,17 +584,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
|
|||
protected void onPostExecute(List<String> warnings) {
|
||||
setSupportProgressBarIndeterminateVisibility(false);
|
||||
if (!warnings.isEmpty()) {
|
||||
final StringBuilder b = new StringBuilder();
|
||||
boolean f = true;
|
||||
for (String w : warnings) {
|
||||
if (f) {
|
||||
f = false;
|
||||
} else {
|
||||
b.append('\n');
|
||||
}
|
||||
b.append(w);
|
||||
}
|
||||
Toast.makeText(DownloadActivity.this, b.toString(), Toast.LENGTH_LONG).show();
|
||||
Toast.makeText(DownloadActivity.this, AndroidUtils.formatWarnings(warnings).toString(), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
newDownloadIndexes();
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ import net.osmand.plus.R;
|
|||
import net.osmand.plus.SettingsHelper;
|
||||
import net.osmand.plus.SettingsHelper.CheckDuplicatesListener;
|
||||
import net.osmand.plus.SettingsHelper.PluginSettingsItem;
|
||||
import net.osmand.plus.SettingsHelper.ProfileSettingsItem;
|
||||
import net.osmand.plus.SettingsHelper.SettingsCollectListener;
|
||||
import net.osmand.plus.SettingsHelper.SettingsImportListener;
|
||||
import net.osmand.plus.SettingsHelper.SettingsItem;
|
||||
|
@ -62,6 +63,7 @@ import net.osmand.router.RoutingConfiguration;
|
|||
import net.osmand.util.Algorithms;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
|
@ -77,6 +79,7 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
@ -843,6 +846,24 @@ public class ImportHelper {
|
|||
CustomOsmandPlugin plugin = pluginItem.getPlugin();
|
||||
plugin.loadResources();
|
||||
|
||||
for (SettingsItem item : items) {
|
||||
if (item instanceof ProfileSettingsItem) {
|
||||
ProfileSettingsItem profileItem = (ProfileSettingsItem) item;
|
||||
Map<String, String> drawerLogoNames = profileItem.getDrawerLogoParams();
|
||||
if (!Algorithms.isEmpty(drawerLogoNames)) {
|
||||
String pluginResDir = IndexConstants.PLUGINS_DIR + plugin.getId() + "/" + plugin.getPluginResDir().getName();
|
||||
for (Map.Entry<String, String> entry : drawerLogoNames.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
if (value.startsWith("@") || value.startsWith("/")) {
|
||||
value = value.substring(1);
|
||||
}
|
||||
entry.setValue(pluginResDir + "/" + value);
|
||||
}
|
||||
String json = new JSONObject(drawerLogoNames).toString();
|
||||
app.getSettings().NAV_DRAWER_LOGO.setModeValue(profileItem.getAppMode(), json);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (activity != null) {
|
||||
plugin.onInstall(app, activity);
|
||||
}
|
||||
|
|
|
@ -84,6 +84,8 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
private String selectedIconCategory;
|
||||
private LinkedHashMap<String, JSONArray> iconCategories;
|
||||
private OsmandApplication app;
|
||||
private View descriptionCaption;
|
||||
private EditText descriptionEdit;
|
||||
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||
|
@ -186,14 +188,14 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
categoryEdit.setText(getCategoryInitValue());
|
||||
}
|
||||
|
||||
final EditText descriptionEdit = (EditText) view.findViewById(R.id.description_edit);
|
||||
descriptionEdit = (EditText) view.findViewById(R.id.description_edit);
|
||||
AndroidUtils.setTextPrimaryColor(view.getContext(), descriptionEdit, nightMode);
|
||||
AndroidUtils.setHintTextSecondaryColor(view.getContext(), descriptionEdit, nightMode);
|
||||
if (getDescriptionInitValue() != null) {
|
||||
descriptionEdit.setText(getDescriptionInitValue());
|
||||
}
|
||||
|
||||
final View descriptionCaption = view.findViewById(R.id.description);
|
||||
descriptionCaption = view.findViewById(R.id.description);
|
||||
addDelDescription = (TextView) view.findViewById(R.id.description_button);
|
||||
addDelDescription.setTextColor(getResources().getColor(activeColorResId));
|
||||
addDelDescription.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -209,6 +211,7 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
descriptionCaption.setVisibility(View.GONE);
|
||||
addDelDescription.setText(view.getResources().getString(R.string.add_description));
|
||||
AndroidUtils.hideSoftKeyboard(requireActivity(), descriptionEdit);
|
||||
descriptionEdit.clearFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -240,13 +243,6 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
toolbarAction.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_delete_dark, activeColorResId));
|
||||
deleteButton.setVisibility(View.VISIBLE);
|
||||
deleteIcon.setVisibility(View.VISIBLE);
|
||||
if (!descriptionEdit.getText().toString().isEmpty() || descriptionCaption.getVisibility() != View.VISIBLE) {
|
||||
descriptionCaption.setVisibility(View.VISIBLE);
|
||||
addDelDescription.setText(app.getString(R.string.delete_description));
|
||||
} else {
|
||||
descriptionCaption.setVisibility(View.GONE);
|
||||
addDelDescription.setText(app.getString(R.string.add_description));
|
||||
}
|
||||
}
|
||||
|
||||
toolbarAction.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -267,6 +263,19 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (!descriptionEdit.getText().toString().isEmpty() || descriptionCaption.getVisibility() != View.VISIBLE
|
||||
|| descriptionEdit.hasFocus()) {
|
||||
descriptionCaption.setVisibility(View.VISIBLE);
|
||||
addDelDescription.setText(app.getString(R.string.delete_description));
|
||||
} else {
|
||||
descriptionCaption.setVisibility(View.GONE);
|
||||
addDelDescription.setText(app.getString(R.string.add_description));
|
||||
}
|
||||
}
|
||||
|
||||
private void createGroupSelector() {
|
||||
groupListAdapter = new GroupAdapter();
|
||||
groupRecyclerView = view.findViewById(R.id.group_recycler_view);
|
||||
|
@ -533,25 +542,6 @@ public abstract class PointEditorFragmentNew extends BaseOsmAndFragment {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getContextMenu().setBaseFragmentVisibility(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
hideKeyboard();
|
||||
MapActivity mapActivity = getMapActivity();
|
||||
if (mapActivity != null) {
|
||||
mapActivity.getContextMenu().setBaseFragmentVisibility(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
PointEditor editor = getEditor();
|
||||
|
|
|
@ -306,7 +306,7 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return super.onPreferenceChange(preference, newValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,6 +49,7 @@ import net.osmand.util.Algorithms;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static net.osmand.aidlapi.OsmAndCustomizationConstants.MAP_CONTEXT_MENU_CREATE_POI;
|
||||
|
@ -139,10 +140,12 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
|||
// private EditingPOIDialogProvider poiActions;
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
protected List<QuickActionType> getQuickActionTypes() {
|
||||
List<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
quickActionTypes.add(AddPOIAction.TYPE);
|
||||
quickActionTypes.add(AddOSMBugAction.TYPE);
|
||||
quickActionTypes.add(ShowHideOSMBugAction.TYPE);
|
||||
return quickActionTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,6 +41,7 @@ import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
|
|||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
import net.osmand.plus.views.mapwidgets.TextInfoWidget;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -632,7 +633,9 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
|||
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
protected List<QuickActionType> getQuickActionTypes() {
|
||||
List<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
quickActionTypes.add(ParkingAction.TYPE);
|
||||
return quickActionTypes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -683,9 +683,11 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
protected List<QuickActionType> getQuickActionTypes() {
|
||||
List<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
quickActionTypes.add(MapSourceAction.TYPE);
|
||||
quickActionTypes.add(MapOverlayAction.TYPE);
|
||||
quickActionTypes.add(MapUnderlayAction.TYPE);
|
||||
return quickActionTypes;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,13 @@ import android.annotation.SuppressLint;
|
|||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -44,6 +47,7 @@ import androidx.preference.TwoStatePreference;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
|
@ -51,6 +55,7 @@ import net.osmand.access.AccessibilitySettingsFragment;
|
|||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.OsmandSettings.CommonPreference;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
|
@ -63,6 +68,7 @@ import net.osmand.plus.osmedit.OsmEditingFragment;
|
|||
import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment;
|
||||
import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment.AppModeChangedListener;
|
||||
import net.osmand.plus.settings.bottomsheets.BooleanPreferenceBottomSheet;
|
||||
import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet;
|
||||
import net.osmand.plus.settings.bottomsheets.EditTextPreferenceBottomSheet;
|
||||
import net.osmand.plus.settings.bottomsheets.MultiSelectPreferencesBottomSheet;
|
||||
import net.osmand.plus.settings.bottomsheets.SingleSelectPreferenceBottomSheet;
|
||||
|
@ -72,6 +78,8 @@ import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SETTINGS_ID;
|
||||
|
||||
public abstract class BaseSettingsFragment extends PreferenceFragmentCompat implements OnPreferenceChangeListener,
|
||||
|
@ -101,42 +109,48 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
|
||||
public enum SettingsScreenType {
|
||||
|
||||
MAIN_SETTINGS(MainSettingsFragment.TAG, false, R.xml.settings_main_screen, R.layout.global_preference_toolbar),
|
||||
GLOBAL_SETTINGS(GlobalSettingsFragment.class.getName(), false, R.xml.global_settings, R.layout.global_preference_toolbar),
|
||||
CONFIGURE_PROFILE(ConfigureProfileFragment.class.getName(), true, R.xml.configure_profile, R.layout.profile_preference_toolbar_with_switch),
|
||||
PROXY_SETTINGS(ProxySettingsFragment.class.getName(), false, R.xml.proxy_preferences, R.layout.global_preferences_toolbar_with_switch),
|
||||
GENERAL_PROFILE(GeneralProfileSettingsFragment.class.getName(), true, R.xml.general_profile_settings, R.layout.profile_preference_toolbar),
|
||||
NAVIGATION(NavigationFragment.class.getName(), true, R.xml.navigation_settings_new, R.layout.profile_preference_toolbar),
|
||||
COORDINATES_FORMAT(CoordinatesFormatFragment.class.getName(), true, R.xml.coordinates_format, R.layout.profile_preference_toolbar),
|
||||
ROUTE_PARAMETERS(RouteParametersFragment.class.getName(), true, R.xml.route_parameters, R.layout.profile_preference_toolbar),
|
||||
SCREEN_ALERTS(ScreenAlertsFragment.class.getName(), true, R.xml.screen_alerts, R.layout.profile_preference_toolbar_with_switch),
|
||||
VOICE_ANNOUNCES(VoiceAnnouncesFragment.class.getName(), true, R.xml.voice_announces, R.layout.profile_preference_toolbar_with_switch),
|
||||
VEHICLE_PARAMETERS(VehicleParametersFragment.class.getName(), true, R.xml.vehicle_parameters, R.layout.profile_preference_toolbar),
|
||||
MAP_DURING_NAVIGATION(MapDuringNavigationFragment.class.getName(), true, R.xml.map_during_navigation, R.layout.profile_preference_toolbar),
|
||||
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch),
|
||||
DATA_STORAGE(DataStorageFragment.class.getName(), false, R.xml.data_storage, R.layout.global_preference_toolbar),
|
||||
DIALOGS_AND_NOTIFICATIONS_SETTINGS(DialogsAndNotificationsSettingsFragment.class.getName(), false, R.xml.dialogs_and_notifications_preferences, R.layout.global_preferences_toolbar_with_switch),
|
||||
PROFILE_APPEARANCE(ProfileAppearanceFragment.TAG, true, R.xml.profile_appearance, R.layout.profile_preference_toolbar),
|
||||
OPEN_STREET_MAP_EDITING(OsmEditingFragment.class.getName(), false, R.xml.osm_editing, R.layout.global_preference_toolbar),
|
||||
MULTIMEDIA_NOTES(MultimediaNotesFragment.class.getName(), true, R.xml.multimedia_notes, R.layout.profile_preference_toolbar),
|
||||
MONITORING_SETTINGS(MonitoringSettingsFragment.class.getName(), true, R.xml.monitoring_settings, R.layout.profile_preference_toolbar),
|
||||
LIVE_MONITORING(LiveMonitoringFragment.class.getName(), false, R.xml.live_monitoring, R.layout.global_preferences_toolbar_with_switch),
|
||||
ACCESSIBILITY_SETTINGS(AccessibilitySettingsFragment.class.getName(), true, R.xml.accessibility_settings, R.layout.profile_preference_toolbar),
|
||||
DEVELOPMENT_SETTINGS(DevelopmentSettingsFragment.class.getName(), false, R.xml.development_settings, R.layout.global_preference_toolbar);
|
||||
MAIN_SETTINGS(MainSettingsFragment.TAG, false, null, R.xml.settings_main_screen, R.layout.global_preference_toolbar),
|
||||
GLOBAL_SETTINGS(GlobalSettingsFragment.class.getName(), false, null, R.xml.global_settings, R.layout.global_preference_toolbar),
|
||||
CONFIGURE_PROFILE(ConfigureProfileFragment.class.getName(), true, null, R.xml.configure_profile, R.layout.profile_preference_toolbar_with_switch),
|
||||
PROXY_SETTINGS(ProxySettingsFragment.class.getName(), false, null, R.xml.proxy_preferences, R.layout.global_preferences_toolbar_with_switch),
|
||||
GENERAL_PROFILE(GeneralProfileSettingsFragment.class.getName(), true, MessageType.BOTTOM_SHEET, R.xml.general_profile_settings, R.layout.profile_preference_toolbar),
|
||||
NAVIGATION(NavigationFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.navigation_settings_new, R.layout.profile_preference_toolbar),
|
||||
COORDINATES_FORMAT(CoordinatesFormatFragment.class.getName(), true, MessageType.BOTTOM_SHEET, R.xml.coordinates_format, R.layout.profile_preference_toolbar),
|
||||
ROUTE_PARAMETERS(RouteParametersFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.route_parameters, R.layout.profile_preference_toolbar),
|
||||
SCREEN_ALERTS(ScreenAlertsFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.screen_alerts, R.layout.profile_preference_toolbar_with_switch),
|
||||
VOICE_ANNOUNCES(VoiceAnnouncesFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.voice_announces, R.layout.profile_preference_toolbar_with_switch),
|
||||
VEHICLE_PARAMETERS(VehicleParametersFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.vehicle_parameters, R.layout.profile_preference_toolbar),
|
||||
MAP_DURING_NAVIGATION(MapDuringNavigationFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.map_during_navigation, R.layout.profile_preference_toolbar),
|
||||
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch),
|
||||
DATA_STORAGE(DataStorageFragment.class.getName(), false, null, R.xml.data_storage, R.layout.global_preference_toolbar),
|
||||
DIALOGS_AND_NOTIFICATIONS_SETTINGS(DialogsAndNotificationsSettingsFragment.class.getName(), false, null, R.xml.dialogs_and_notifications_preferences, R.layout.global_preferences_toolbar_with_switch),
|
||||
PROFILE_APPEARANCE(ProfileAppearanceFragment.TAG, true, null, R.xml.profile_appearance, R.layout.profile_preference_toolbar),
|
||||
OPEN_STREET_MAP_EDITING(OsmEditingFragment.class.getName(), false, null, R.xml.osm_editing, R.layout.global_preference_toolbar),
|
||||
MULTIMEDIA_NOTES(MultimediaNotesFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.multimedia_notes, R.layout.profile_preference_toolbar),
|
||||
MONITORING_SETTINGS(MonitoringSettingsFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.monitoring_settings, R.layout.profile_preference_toolbar),
|
||||
LIVE_MONITORING(LiveMonitoringFragment.class.getName(), false, null, R.xml.live_monitoring, R.layout.global_preferences_toolbar_with_switch),
|
||||
ACCESSIBILITY_SETTINGS(AccessibilitySettingsFragment.class.getName(), true, MessageType.SNACK_BAR, R.xml.accessibility_settings, R.layout.profile_preference_toolbar),
|
||||
DEVELOPMENT_SETTINGS(DevelopmentSettingsFragment.class.getName(), false, null, R.xml.development_settings, R.layout.global_preference_toolbar);
|
||||
|
||||
public final String fragmentName;
|
||||
public final boolean profileDependent;
|
||||
public final MessageType onChangeMessageType;
|
||||
public final int preferencesResId;
|
||||
public final int toolbarResId;
|
||||
|
||||
SettingsScreenType(String fragmentName, boolean profileDependent, int preferencesResId, int toolbarResId) {
|
||||
SettingsScreenType(String fragmentName, boolean profileDependent, MessageType onChangeMessageType, int preferencesResId, int toolbarResId) {
|
||||
this.fragmentName = fragmentName;
|
||||
this.profileDependent = profileDependent;
|
||||
this.onChangeMessageType = onChangeMessageType;
|
||||
this.preferencesResId = preferencesResId;
|
||||
this.toolbarResId = toolbarResId;
|
||||
}
|
||||
}
|
||||
|
||||
private enum MessageType {
|
||||
SNACK_BAR, BOTTOM_SHEET
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
app = requireMyApplication();
|
||||
|
@ -304,6 +318,23 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
MessageType messageType = getMessageType();
|
||||
if (messageType != null) {
|
||||
String prefId = preference.getKey();
|
||||
OsmandSettings.OsmandPreference pref = settings.getPreference(prefId);
|
||||
if (pref instanceof CommonPreference && !((CommonPreference) pref).hasDefaultValueForMode(getSelectedAppMode())) {
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
if (newValue instanceof Serializable) {
|
||||
if (messageType == MessageType.SNACK_BAR) {
|
||||
applyChangeAndSuggestApplyToAllProfiles(prefId, (Serializable) newValue);
|
||||
} else if (messageType == MessageType.BOTTOM_SHEET && fragmentManager != null) {
|
||||
ChangeGeneralProfilesPrefBottomSheet.showInstance(fragmentManager, prefId,
|
||||
(Serializable) newValue, this, false, getSelectedAppMode());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -316,6 +347,10 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
return currentScreenType != null && currentScreenType.profileDependent;
|
||||
}
|
||||
|
||||
public MessageType getMessageType() {
|
||||
return currentScreenType != null ? currentScreenType.onChangeMessageType : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisplayPreferenceDialog(Preference preference) {
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
|
@ -859,4 +894,25 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
|
|||
mapActivity.getMapRouteInfoMenu().updateMenu();
|
||||
}
|
||||
}
|
||||
|
||||
protected void applyChangeAndSuggestApplyToAllProfiles(final String prefId, final Serializable newValue) {
|
||||
app.getSettings().setPreference(prefId, newValue, getSelectedAppMode());
|
||||
onSettingApplied(prefId, false);
|
||||
updateSetting(prefId);
|
||||
View containerView = getView();
|
||||
if (containerView != null) {
|
||||
String modeName = appMode.toHumanString();
|
||||
String text = app.getString(R.string.changes_applied_to_profile, modeName);
|
||||
SpannableString message = UiUtilities.createSpannableString(text, modeName, new StyleSpan(Typeface.BOLD));
|
||||
Snackbar snackbar = Snackbar.make(containerView, message, Snackbar.LENGTH_LONG)
|
||||
.setAction(R.string.apply_to_all_profiles, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
app.getSettings().setPreferenceForAllModes(prefId, newValue);
|
||||
onSettingApplied(prefId, true);
|
||||
}
|
||||
});
|
||||
snackbar.show();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -354,18 +354,11 @@ public class GeneralProfileSettingsFragment extends BaseSettingsFragment impleme
|
|||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
String prefId = preference.getKey();
|
||||
|
||||
OsmandSettings.OsmandPreference pref = settings.getPreference(prefId);
|
||||
if (pref instanceof CommonPreference && !((CommonPreference) pref).hasDefaultValueForMode(getSelectedAppMode())) {
|
||||
FragmentManager fragmentManager = getFragmentManager();
|
||||
if (fragmentManager != null && newValue instanceof Serializable) {
|
||||
ChangeGeneralProfilesPrefBottomSheet.showInstance(fragmentManager, prefId,
|
||||
(Serializable) newValue, this, false, getSelectedAppMode());
|
||||
}
|
||||
if (prefId.equals(settings.ROTATE_MAP.getId()) && newValue instanceof Serializable) {
|
||||
applyChangeAndSuggestApplyToAllProfiles(prefId, (Serializable) newValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
return super.onPreferenceChange(preference, newValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -184,13 +184,14 @@ public class MainSettingsFragment extends BaseSettingsFragment {
|
|||
SwitchPreferenceEx pref = new SwitchPreferenceEx(app);
|
||||
pref.setPersistent(false);
|
||||
pref.setKey(applicationMode.getStringKey());
|
||||
preferenceCategory.addPreference(pref);
|
||||
|
||||
pref.setIcon(getAppProfilesIcon(applicationMode, isAppProfileEnabled));
|
||||
pref.setTitle(applicationMode.toHumanString());
|
||||
pref.setSummary(getAppModeDescription(getContext(), applicationMode));
|
||||
pref.setChecked(isAppProfileEnabled);
|
||||
pref.setLayoutResource(R.layout.preference_with_descr_dialog_and_switch);
|
||||
pref.setFragment(ConfigureProfileFragment.class.getName());
|
||||
preferenceCategory.addPreference(pref);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.osmand.router.GeneralRouter;
|
|||
import net.osmand.router.RoutingConfiguration;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
|
|
@ -56,6 +56,7 @@ public class ScreenAlertsFragment extends BaseSettingsFragment {
|
|||
ApplicationMode selectedMode = getSelectedAppMode();
|
||||
boolean checked = !settings.SHOW_ROUTING_ALARMS.getModeValue(selectedMode);
|
||||
settings.SHOW_ROUTING_ALARMS.setModeValue(selectedMode, checked);
|
||||
applyChangeAndSuggestApplyToAllProfiles(settings.SHOW_ROUTING_ALARMS.getId(), checked);
|
||||
updateToolbarSwitch();
|
||||
enableDisablePreferences(checked);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ public class TurnScreenOnFragment extends BaseSettingsFragment {
|
|||
ApplicationMode selectedMode = getSelectedAppMode();
|
||||
boolean checked = !settings.TURN_SCREEN_ON_ENABLED.getModeValue(selectedMode);
|
||||
settings.TURN_SCREEN_ON_ENABLED.setModeValue(selectedMode, checked);
|
||||
applyChangeAndSuggestApplyToAllProfiles(settings.TURN_SCREEN_ON_ENABLED.getId(), checked);
|
||||
updateToolbarSwitch();
|
||||
enableDisablePreferences(checked);
|
||||
}
|
||||
|
|
|
@ -51,6 +51,7 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment {
|
|||
ApplicationMode selectedMode = getSelectedAppMode();
|
||||
boolean checked = !settings.VOICE_MUTE.getModeValue(selectedMode);
|
||||
settings.VOICE_MUTE.setModeValue(selectedMode, checked);
|
||||
applyChangeAndSuggestApplyToAllProfiles(settings.VOICE_MUTE.getId(), checked);
|
||||
updateToolbarSwitch();
|
||||
enableDisablePreferences(!checked);
|
||||
updateMenu();
|
||||
|
|
|
@ -520,8 +520,10 @@ public class SRTMPlugin extends OsmandPlugin {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void registerQuickActionTypes(List<QuickActionType> quickActionTypes) {
|
||||
protected List<QuickActionType> getQuickActionTypes() {
|
||||
List<QuickActionType> quickActionTypes = new ArrayList<>();
|
||||
quickActionTypes.add(ContourLinesAction.TYPE);
|
||||
quickActionTypes.add(TerrainAction.TYPE);
|
||||
return quickActionTypes;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue