Merge pull request #8297 from osmandapp/plugin_prefs

Plugins settings improvements
This commit is contained in:
max-klaus 2020-01-22 19:23:15 +03:00 committed by GitHub
commit 530e2b684e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 1239 additions and 244 deletions

View file

@ -11,7 +11,6 @@
android:paddingTop="@dimen/bottom_sheet_image_text_margin_start" android:paddingTop="@dimen/bottom_sheet_image_text_margin_start"
android:paddingRight="@dimen/content_padding" android:paddingRight="@dimen/content_padding"
android:paddingBottom="@dimen/gpx_small_text_margin" android:paddingBottom="@dimen/gpx_small_text_margin"
android:textColor="?android:textColorPrimary" android:textAppearance="@style/TextAppearance.ListItemTitle"
android:textSize="@dimen/default_desc_text_size"
app:typeface="@string/font_roboto_regular" app:typeface="@string/font_roboto_regular"
tools:text="@string/auto_zoom_map_descr" /> tools:text="@string/auto_zoom_map_descr" />

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="@dimen/settings_divider_margin_start"
android:layout_marginLeft="@dimen/settings_divider_margin_start"
android:background="?attr/divider_color_basic"
android:orientation="vertical" />

View file

@ -5,7 +5,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/content_padding" android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"> android:paddingRight="@dimen/content_padding"
android:paddingBottom="@dimen/route_info_list_text_padding">
<net.osmand.plus.widgets.TextViewEx <net.osmand.plus.widgets.TextViewEx
android:layout_width="match_parent" android:layout_width="match_parent"
@ -26,7 +27,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing" android:letterSpacing="@dimen/text_button_letter_spacing"
android:maxLines="1" android:maxLines="1"
android:paddingBottom="@dimen/dialog_content_margin" android:paddingBottom="@dimen/content_padding"
android:text="@string/open_street_map_login_descr" android:text="@string/open_street_map_login_descr"
android:textAppearance="@style/TextAppearance.ListItemTitle" android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_regular" /> osmand:typeface="@string/font_roboto_regular" />

View file

@ -14,25 +14,15 @@
android:minHeight="@dimen/bottom_sheet_list_item_height" android:minHeight="@dimen/bottom_sheet_list_item_height"
tools:background="?android:attr/selectableItemBackground"> tools:background="?android:attr/selectableItemBackground">
<FrameLayout
android:id="@+id/icon_container"
android:layout_width="@dimen/route_info_toolbar_button_size"
android:layout_height="@dimen/route_info_toolbar_button_size"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_marginTop="@dimen/content_padding_half"
android:layout_marginRight="@dimen/content_padding_half"
android:layout_marginBottom="@dimen/content_padding_half">
<ImageView <ImageView
android:id="@android:id/icon" android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size" android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size" android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center" android:layout_gravity="center"
tools:tint="?colorAccent" android:layout_marginLeft="@dimen/content_padding"
tools:src="@drawable/ic_action_car_dark" /> android:layout_marginRight="@dimen/content_padding"
tools:src="@drawable/ic_action_car_dark"
</FrameLayout> tools:tint="?colorAccent" />
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
@ -52,7 +42,7 @@
android:textColor="?colorAccent" android:textColor="?colorAccent"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_medium" osmand:typeface="@string/font_roboto_medium"
tools:text="Button text"/> tools:text="Button text" />
</LinearLayout> </LinearLayout>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/list_background_color"
android:minHeight="@dimen/setting_list_item_large_height"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding">
<net.osmand.plus.widgets.TextViewEx
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:letterSpacing="@dimen/text_button_letter_spacing"
android:lineSpacingExtra="5sp"
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
</LinearLayout>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<studio.carbonylgroup.textfieldboxes.TextFieldBoxes
android:id="@+id/text_field_box"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
app:helperText=" ">
<studio.carbonylgroup.textfieldboxes.ExtendedEditText
android:id="@+id/edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionDone"
android:inputType="textMultiLine" />
</studio.carbonylgroup.textfieldboxes.TextFieldBoxes>
</LinearLayout>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:osmand="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_marginRight="@dimen/content_padding_half"
android:background="?attr/list_background_color">
<LinearLayout
android:id="@+id/selectable_list_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/bottom_sheet_list_item_height"
android:orientation="horizontal">
<ImageView
android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_marginTop="@dimen/content_padding_small"
android:layout_marginRight="@dimen/content_padding_half"
tools:src="@drawable/ic_action_lock" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="@dimen/dialog_content_margin"
android:paddingLeft="@dimen/dialog_content_margin">
<net.osmand.plus.widgets.TextViewEx
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/content_padding_small"
android:textAppearance="@style/TextAppearance.ListItemTitle"
osmand:typeface="@string/font_roboto_medium"
tools:text="@string/permission_is_required" />
<net.osmand.plus.widgets.TextViewEx
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:letterSpacing="@dimen/description_letter_spacing"
android:maxLines="1"
android:paddingTop="@dimen/content_padding_small"
android:paddingBottom="@dimen/content_padding_small"
android:textColor="?attr/active_color_basic"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
tools:text="@string/give_permission" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View file

@ -11,29 +11,21 @@
android:id="@+id/selectable_list_item" android:id="@+id/selectable_list_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/bottom_sheet_list_item_height" android:minHeight="@dimen/setting_list_item_large_height"
tools:background="?android:attr/selectableItemBackground"> tools:background="?android:attr/selectableItemBackground">
<FrameLayout
android:id="@+id/icon_container"
android:layout_width="@dimen/route_info_toolbar_button_size"
android:layout_height="@dimen/route_info_toolbar_button_size"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding_half"
android:layout_marginTop="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding_half"
android:layout_marginBottom="@dimen/content_padding">
<ImageView <ImageView
android:id="@android:id/icon" android:id="@android:id/icon"
android:layout_width="@dimen/standard_icon_size" android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size" android:layout_height="@dimen/standard_icon_size"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginTop="@dimen/bottom_sheet_icon_margin"
android:layout_marginRight="@dimen/content_padding"
android:layout_marginBottom="@dimen/bottom_sheet_icon_margin"
tools:src="@drawable/ic_action_car_dark" tools:src="@drawable/ic_action_car_dark"
tools:tint="@color/active_color_primary_light" /> tools:tint="@color/active_color_primary_light" />
</FrameLayout>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View file

@ -11,6 +11,7 @@
android:id="@+id/selectable_list_item" android:id="@+id/selectable_list_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="@dimen/setting_list_item_large_height"
tools:background="?android:attr/selectableItemBackground"> tools:background="?android:attr/selectableItemBackground">
<ImageView <ImageView

View file

@ -115,7 +115,7 @@
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/bottom_sheet_image_text_margin_start" android:layout_marginLeft="@dimen/bottom_sheet_image_text_margin_start"
android:layout_marginRight="@dimen/bottom_sheet_image_text_margin_start" android:layout_marginRight="@dimen/bottom_sheet_image_text_margin_start"
android:src="@drawable/ic_action_arrow_drop_down" android:src="@drawable/ic_action_arrow_down"
android:tint="?attr/default_icon_color" /> android:tint="?attr/default_icon_color" />
</LinearLayout> </LinearLayout>

View file

@ -3351,7 +3351,6 @@
<string name="live_monitoring_descr">تتيح لك مشاركة الموقع الحالي باستخدام تسجيل الرحلة.</string> <string name="live_monitoring_descr">تتيح لك مشاركة الموقع الحالي باستخدام تسجيل الرحلة.</string>
<string name="live_monitoring">تعقب عبر الانترنت</string> <string name="live_monitoring">تعقب عبر الانترنت</string>
<string name="save_track_logging_accuracy">دقة التسجيل</string> <string name="save_track_logging_accuracy">دقة التسجيل</string>
<string name="multimedia_notes_view_descr">يمكنك العثور على جميع ملاحظاتك في القائمة — أماكني المفضلة — ملاحظات</string>
<string name="video_notes">ملاحظات الفيديو</string> <string name="video_notes">ملاحظات الفيديو</string>
<string name="photo_notes">ملاحظات الصورة</string> <string name="photo_notes">ملاحظات الصورة</string>
<string name="route_recalculation">إعادة حساب الطريق</string> <string name="route_recalculation">إعادة حساب الطريق</string>
@ -3362,7 +3361,5 @@
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">سترى الأيقونة فقط أثناء الملاحة أو أثناء التحرك.</string> <string name="select_nav_icon_descr">سترى الأيقونة فقط أثناء الملاحة أو أثناء التحرك.</string>
<string name="button_rate">معدل</string> <string name="button_rate">معدل</string>
<string name="tracks_view_descr">يمكنك العثور على جميع المسارات المسجلة الخاصة بك في القائمة - مكاني - المسارات أو في مجلد أوسماند باستخدام مدير الملفات.</string>
<string name="osm_edits_view_descr">يمكنك عرض جميع التعديلات التي قمت بإلغاء تحميلها أو أخطاء نظام التشغيل في القائمة - الأماكن الخاصة بي - تعديلات OSM. لا يتم عرض النقاط التي تم تحميلها في أوسماند.</string>
<string name="select_map_icon_descr">تظهر أيقونة الخريطة فقط على الخريطة ، وتتغير أثناء التنقل إلى أيقونة التنقل.</string> <string name="select_map_icon_descr">تظهر أيقونة الخريطة فقط على الخريطة ، وتتغير أثناء التنقل إلى أيقونة التنقل.</string>
</resources> </resources>

View file

@ -3444,19 +3444,19 @@ Abasta l\'àrea: %1$s x %2$s</string>
<string name="live_monitoring_descr">Permet compartir la ubicació actual utilitzant l\'enregistrament de viatges.</string> <string name="live_monitoring_descr">Permet compartir la ubicació actual utilitzant l\'enregistrament de viatges.</string>
<string name="live_monitoring">Seguiment en línia</string> <string name="live_monitoring">Seguiment en línia</string>
<string name="save_track_logging_accuracy">Precisió de registre</string> <string name="save_track_logging_accuracy">Precisió de registre</string>
<string name="multimedia_notes_view_descr">Pots trobar totes les teves notes a Menú — Els meus llocs — Notes</string> <string name="multimedia_notes_view_descr">Pots trobar totes les teves notes a %1$s</string>
<string name="video_notes">Notes de vídeo</string> <string name="video_notes">Notes de vídeo</string>
<string name="photo_notes">Notes de fotos</string> <string name="photo_notes">Notes de fotos</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="save_heading">Inclou la direcció</string> <string name="save_heading">Inclou la direcció</string>
<string name="save_heading_descr">Desa l\'orientació a cada fita mentre es fa un enregistrament.</string> <string name="save_heading_descr">Desa l\'orientació a cada fita mentre es fa un enregistrament.</string>
<string name="tracks_view_descr">Podeu trobar els vostres enregistraments a Menú — Els meus llocs — Traces o, amb un gestor de fitxers, al directori d\'OsmAnd .</string> <string name="tracks_view_descr">Podeu trobar els vostres enregistraments a %1$s o, amb un gestor de fitxers, al directori d\'OsmAnd .</string>
<string name="route_recalculation">Recàlcul de la ruta</string> <string name="route_recalculation">Recàlcul de la ruta</string>
<string name="accessibility_announce">Anunci</string> <string name="accessibility_announce">Anunci</string>
<string name="login_and_pass">Nom d\'usuari i contrasenya</string> <string name="login_and_pass">Nom d\'usuari i contrasenya</string>
<string name="plugin_global_prefs_info">Aquesta configuració del connector és global i afecta tots els perfils.</string> <string name="plugin_global_prefs_info">Aquesta configuració del connector és global i afecta tots els perfils.</string>
<string name="osm_editing">Edició d\'OpenStreetMap</string> <string name="osm_editing">Edició d\'OpenStreetMap</string>
<string name="osm_edits_view_descr">Podeu veure totes les vostres edicions no enviades o els errors OSM a Menú — Els meus llocs — Edicions OSM. Els punts enviats no es mostren a OsmAnd.</string> <string name="osm_edits_view_descr">Podeu veure totes les vostres edicions no enviades o els errors OSM a %1$s. Els punts enviats no es mostren a OsmAnd.</string>
<string name="select_nav_icon_descr">Només veureu la icona mentre navegueu o us mogueu.</string> <string name="select_nav_icon_descr">Només veureu la icona mentre navegueu o us mogueu.</string>
<string name="select_map_icon_descr">La icona de mapa només es mostra al mapa i es canvia a la icona de navegació quan durant aquesta.</string> <string name="select_map_icon_descr">La icona de mapa només es mostra al mapa i es canvia a la icona de navegació quan durant aquesta.</string>
<string name="logcat_buffer_descr">Aquí podeu veure i compartir els enregistraments de l\'aplicació</string> <string name="logcat_buffer_descr">Aquí podeu veure i compartir els enregistraments de l\'aplicació</string>

View file

@ -3443,8 +3443,8 @@ Repræsenterer område: %1$s x %2$s</string>
<string name="live_monitoring_descr">Tillader at dele den aktuelle placering ved hjælp af tur-optagelse.</string> <string name="live_monitoring_descr">Tillader at dele den aktuelle placering ved hjælp af tur-optagelse.</string>
<string name="live_monitoring">Online sporing</string> <string name="live_monitoring">Online sporing</string>
<string name="save_track_logging_accuracy">Lognøjagtighed</string> <string name="save_track_logging_accuracy">Lognøjagtighed</string>
<string name="tracks_view_descr">Find alle optagede spor i Menu - Foretrukne - Spor eller i OsmAnd mappen vha. filhåndtering.</string> <string name="tracks_view_descr">Find alle optagede spor i %1$s eller i OsmAnd mappen vha. filhåndtering.</string>
<string name="multimedia_notes_view_descr">Find alle noter i Menu - Foretrukne - Noter</string> <string name="multimedia_notes_view_descr">Find alle noter i %1$s</string>
<string name="video_notes">Video noter</string> <string name="video_notes">Video noter</string>
<string name="photo_notes">Foto noter</string> <string name="photo_notes">Foto noter</string>
<string name="route_recalculation">Genberegning af rute</string> <string name="route_recalculation">Genberegning af rute</string>
@ -3452,7 +3452,7 @@ Repræsenterer område: %1$s x %2$s</string>
<string name="login_and_pass">Brugernavn og adgangskode</string> <string name="login_and_pass">Brugernavn og adgangskode</string>
<string name="plugin_global_prefs_info">Indstillinger for udvidelsen er globale, og gælder for alle profiler.</string> <string name="plugin_global_prefs_info">Indstillinger for udvidelsen er globale, og gælder for alle profiler.</string>
<string name="osm_editing">OpenStreetMap redigering</string> <string name="osm_editing">OpenStreetMap redigering</string>
<string name="osm_edits_view_descr">Se alle ikke overførte redigeringer eller OSM fejl i Menu - Foretrukne - OSM-redigeringer. Overførte punkter vises ikke i OsmAnd.</string> <string name="osm_edits_view_descr">Se alle ikke overførte redigeringer eller OSM fejl i %1$s. Overførte punkter vises ikke i OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Ikonet vises kun under navigation eller under bevægelse.</string> <string name="select_nav_icon_descr">Ikonet vises kun under navigation eller under bevægelse.</string>
<string name="select_map_icon_descr">Kortikon vises kun på kortet og skifter under navigation til navigationsikon.</string> <string name="select_map_icon_descr">Kortikon vises kun på kortet og skifter under navigation til navigationsikon.</string>

View file

@ -3413,8 +3413,8 @@ Indikas lokon: %1$s x %2$s"</string>
<string name="live_monitoring_descr">Kunhavigi vian nunan pozicion per registrado de kurso.</string> <string name="live_monitoring_descr">Kunhavigi vian nunan pozicion per registrado de kurso.</string>
<string name="live_monitoring">Perreta spurado</string> <string name="live_monitoring">Perreta spurado</string>
<string name="save_track_logging_accuracy">Precizo de registrado</string> <string name="save_track_logging_accuracy">Precizo de registrado</string>
<string name="tracks_view_descr">Vi povas trovi ĉiujn registritajn spurojn per la menuo → “miaj ejoj” → “spuroj” aŭ en la dosierujo OsmAnd (uzu dosieresplorilon).</string> <string name="tracks_view_descr">Vi povas trovi ĉiujn registritajn spurojn per la %1$s aŭ en la dosierujo OsmAnd (uzu dosieresplorilon).</string>
<string name="multimedia_notes_view_descr">Vi povas trovi ĉiujn notojn per la menuo → “miaj ejoj” → “notoj”.</string> <string name="multimedia_notes_view_descr">Vi povas trovi ĉiujn notojn per la %1$s.</string>
<string name="video_notes">Videaj notoj</string> <string name="video_notes">Videaj notoj</string>
<string name="photo_notes">Fotaj notoj</string> <string name="photo_notes">Fotaj notoj</string>
<string name="route_recalculation">Rekalkuli kurson</string> <string name="route_recalculation">Rekalkuli kurson</string>
@ -3423,7 +3423,7 @@ Indikas lokon: %1$s x %2$s"</string>
<string name="login_and_pass">Uzantnomo kaj pasvorto</string> <string name="login_and_pass">Uzantnomo kaj pasvorto</string>
<string name="plugin_global_prefs_info">Agordoj pri tiu ĉi kromprogramo influas al ĉiuj profiloj.</string> <string name="plugin_global_prefs_info">Agordoj pri tiu ĉi kromprogramo influas al ĉiuj profiloj.</string>
<string name="osm_editing">OpenStreetMap-redaktilo</string> <string name="osm_editing">OpenStreetMap-redaktilo</string>
<string name="osm_edits_view_descr">Vi povas vidi ĉiujn viajn nesenditajn redaktojn kaj rimarkojn per la menuo → “miaj ejoj” → “OSMredaktoj”. Senditaj punktoj malaperos el OsmAnd.</string> <string name="osm_edits_view_descr">Vi povas vidi ĉiujn viajn nesenditajn redaktojn kaj rimarkojn per la %1$s. Senditaj punktoj malaperos el OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">La emblemo montriĝos nur dum navigi aŭ dum moviĝi.</string> <string name="select_nav_icon_descr">La emblemo montriĝos nur dum navigi aŭ dum moviĝi.</string>
<string name="select_map_icon_descr">Mapemblemo montriĝas nur dum foliumi mapon kaj ŝanĝiĝas dum navigi al la emblemo de navigo.</string> <string name="select_map_icon_descr">Mapemblemo montriĝas nur dum foliumi mapon kaj ŝanĝiĝas dum navigi al la emblemo de navigo.</string>

View file

@ -3445,8 +3445,8 @@ Lon %2$s</string>
<string name="live_monitoring_descr">Permite compartir la ubicación actual utilizando la grabación del viaje.</string> <string name="live_monitoring_descr">Permite compartir la ubicación actual utilizando la grabación del viaje.</string>
<string name="live_monitoring">Seguimiento en línea</string> <string name="live_monitoring">Seguimiento en línea</string>
<string name="save_track_logging_accuracy">Precisión de registro</string> <string name="save_track_logging_accuracy">Precisión de registro</string>
<string name="tracks_view_descr">Puedes encontrar todas tus trazas grabadas en «Menú — Mi sitios — Trazas» o en la carpeta OsmAnd usando el administrador de archivos.</string> <string name="tracks_view_descr">Puedes encontrar todas tus trazas grabadas en «%1$s» o en la carpeta OsmAnd usando el administrador de archivos.</string>
<string name="multimedia_notes_view_descr">Puedes encontrar todas tus notas en «Menú — Mis sitios — Nota</string> <string name="multimedia_notes_view_descr">Puedes encontrar todas tus notas en «%1$</string>
<string name="video_notes">Notas de video</string> <string name="video_notes">Notas de video</string>
<string name="photo_notes">Notas fotográficas</string> <string name="photo_notes">Notas fotográficas</string>
<string name="route_recalculation">Recálculo de la ruta</string> <string name="route_recalculation">Recálculo de la ruta</string>
@ -3454,7 +3454,7 @@ Lon %2$s</string>
<string name="login_and_pass">Nombre de usuario y contraseña</string> <string name="login_and_pass">Nombre de usuario y contraseña</string>
<string name="plugin_global_prefs_info">Los ajustes de este complemento es global y se aplica a todos los perfiles.</string> <string name="plugin_global_prefs_info">Los ajustes de este complemento es global y se aplica a todos los perfiles.</string>
<string name="osm_editing">Edición de OpenStreetMap</string> <string name="osm_editing">Edición de OpenStreetMap</string>
<string name="osm_edits_view_descr">Puedes ver todas tus ediciones no subidas o errores de OSM en «Menú — Mis sitios — Ediciones OSM». Los puntos subidos no se muestran en OsmAnd.</string> <string name="osm_edits_view_descr">Puedes ver todas tus ediciones no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Sólo verás el icono durante la navegación o mientras te mueves.</string> <string name="select_nav_icon_descr">Sólo verás el icono durante la navegación o mientras te mueves.</string>
<string name="select_map_icon_descr">El icono del mapa aparece sólo en el mapa y cambia mientras se navega hacia el icono de navegación.</string> <string name="select_map_icon_descr">El icono del mapa aparece sólo en el mapa y cambia mientras se navega hacia el icono de navegación.</string>

View file

@ -3439,8 +3439,8 @@ Lon %2$s</string>
<string name="live_monitoring_descr">Permite compartir la ubicación actual utilizando la grabación del viaje.</string> <string name="live_monitoring_descr">Permite compartir la ubicación actual utilizando la grabación del viaje.</string>
<string name="live_monitoring">Seguimiento en línea</string> <string name="live_monitoring">Seguimiento en línea</string>
<string name="save_track_logging_accuracy">Precisión de registro</string> <string name="save_track_logging_accuracy">Precisión de registro</string>
<string name="tracks_view_descr">Puedes encontrar todas tus trazas grabadas en «Menú — Mi sitios — Trazas» o en la carpeta OsmAnd usando el administrador de archivos.</string> <string name="tracks_view_descr">Puedes encontrar todas tus trazas grabadas en «%1$s» o en la carpeta OsmAnd usando el administrador de archivos.</string>
<string name="multimedia_notes_view_descr">Puedes encontrar todas tus notas en «Menú — Mis sitios — Nota</string> <string name="multimedia_notes_view_descr">Puedes encontrar todas tus notas en «%1$</string>
<string name="video_notes">Notas de video</string> <string name="video_notes">Notas de video</string>
<string name="photo_notes">Notas fotográficas</string> <string name="photo_notes">Notas fotográficas</string>
<string name="route_recalculation">Recálculo de la ruta</string> <string name="route_recalculation">Recálculo de la ruta</string>
@ -3448,7 +3448,7 @@ Lon %2$s</string>
<string name="login_and_pass">Nombre de usuario y contraseña</string> <string name="login_and_pass">Nombre de usuario y contraseña</string>
<string name="plugin_global_prefs_info">Los ajustes de este complemento es global y se aplica a todos los perfiles.</string> <string name="plugin_global_prefs_info">Los ajustes de este complemento es global y se aplica a todos los perfiles.</string>
<string name="osm_editing">Edición de OpenStreetMap</string> <string name="osm_editing">Edición de OpenStreetMap</string>
<string name="osm_edits_view_descr">Puedes ver todas tus ediciones no subidas o errores de OSM en «Menú — Mis sitios — Ediciones OSM». Los puntos subidos no se muestran en OsmAnd.</string> <string name="osm_edits_view_descr">Puedes ver todas tus ediciones no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Sólo verás el icono durante la navegación o mientras te mueves.</string> <string name="select_nav_icon_descr">Sólo verás el icono durante la navegación o mientras te mueves.</string>
<string name="select_map_icon_descr">El icono del mapa aparece sólo en el mapa y cambia mientras se navega hacia el icono de navegación.</string> <string name="select_map_icon_descr">El icono del mapa aparece sólo en el mapa y cambia mientras se navega hacia el icono de navegación.</string>

View file

@ -3430,8 +3430,8 @@
<string name="live_monitoring_descr">Te permite compartir la ubicación actual utilizando la grabación del viaje.</string> <string name="live_monitoring_descr">Te permite compartir la ubicación actual utilizando la grabación del viaje.</string>
<string name="live_monitoring">Seguimiento en línea</string> <string name="live_monitoring">Seguimiento en línea</string>
<string name="save_track_logging_accuracy">Precisión de registro</string> <string name="save_track_logging_accuracy">Precisión de registro</string>
<string name="tracks_view_descr">Puedes encontrar todas las trazas grabadas en Menú — Mis sitios — Trazas o en la carpeta OsmAnd utilizando el administrador de archivos.</string> <string name="tracks_view_descr">Puedes encontrar todas las trazas grabadas en %1$s o en la carpeta OsmAnd utilizando el administrador de archivos.</string>
<string name="multimedia_notes_view_descr">Puedes encontrar todas tus notas en Menú - Mis sitios - Notas</string> <string name="multimedia_notes_view_descr">Puedes encontrar todas tus notas en %1$s</string>
<string name="video_notes">Notas de video</string> <string name="video_notes">Notas de video</string>
<string name="photo_notes">Notas de foto</string> <string name="photo_notes">Notas de foto</string>
<string name="route_recalculation">Recálculo de la ruta</string> <string name="route_recalculation">Recálculo de la ruta</string>
@ -3439,7 +3439,7 @@
<string name="login_and_pass">Nombre de usuario y clave</string> <string name="login_and_pass">Nombre de usuario y clave</string>
<string name="plugin_global_prefs_info">La configuración de este complemento es global y se aplica a todos los perfiles.</string> <string name="plugin_global_prefs_info">La configuración de este complemento es global y se aplica a todos los perfiles.</string>
<string name="osm_editing">Edición de OpenStreetMap</string> <string name="osm_editing">Edición de OpenStreetMap</string>
<string name="osm_edits_view_descr">Puedes ver todas las ediciones y errores de osm no enviadas en Menú — Mis sitios — Ediciones OSM. Los puntos enviados no se muestran en OsmAnd.</string> <string name="osm_edits_view_descr">Puedes ver todas las ediciones y errores de osm no enviadas en %1$s. Los puntos enviados no se muestran en OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Verás el icono sólo durante la navegación o mientras te estés moviendo.</string> <string name="select_nav_icon_descr">Verás el icono sólo durante la navegación o mientras te estés moviendo.</string>
<string name="select_map_icon_descr">El icono del mapa solo aparece en el mapa y cambia durante la navegación al icono de navegación.</string> <string name="select_map_icon_descr">El icono del mapa solo aparece en el mapa y cambia durante la navegación al icono de navegación.</string>

View file

@ -3365,8 +3365,8 @@
<string name="live_monitoring_descr">Lubab sul jagada praegust asukohta kasutades reisi salvestamist.</string> <string name="live_monitoring_descr">Lubab sul jagada praegust asukohta kasutades reisi salvestamist.</string>
<string name="live_monitoring">Veebis jälgimine</string> <string name="live_monitoring">Veebis jälgimine</string>
<string name="save_track_logging_accuracy">Logimise täpsus</string> <string name="save_track_logging_accuracy">Logimise täpsus</string>
<string name="tracks_view_descr">Kõik oma salvestatud rajad leiad Menüü- Minu koht - Rajad või OsmAd kataloogist failihalduri abil.</string> <string name="tracks_view_descr">Kõik oma salvestatud rajad leiad %1$s või OsmAd kataloogist failihalduri abil.</string>
<string name="multimedia_notes_view_descr">Kõik oma märkmed leiad Menüü - Minu kohad - Märkmed</string> <string name="multimedia_notes_view_descr">Kõik oma märkmed leiad %1$s</string>
<string name="video_notes">Video märkmed</string> <string name="video_notes">Video märkmed</string>
<string name="photo_notes">Foto märkmed</string> <string name="photo_notes">Foto märkmed</string>
<string name="route_recalculation">Teekonna ümberarvutamine</string> <string name="route_recalculation">Teekonna ümberarvutamine</string>
@ -3374,7 +3374,7 @@
<string name="login_and_pass">Kasutajanimi ja salasõna</string> <string name="login_and_pass">Kasutajanimi ja salasõna</string>
<string name="plugin_global_prefs_info">Selle lisa seaded kehtivad kogu rakenduses ja rakenduvad kõikidele profiilidele.</string> <string name="plugin_global_prefs_info">Selle lisa seaded kehtivad kogu rakenduses ja rakenduvad kõikidele profiilidele.</string>
<string name="osm_editing">OpenStreetMap muutmine</string> <string name="osm_editing">OpenStreetMap muutmine</string>
<string name="osm_edits_view_descr">Kõiki üleslaadimata muudatusi või osm vigu saad vaadata menüüs Menüü - Minu kohad - OSM muudatused. Üleslaaditud punkte OsmAnd ei kuva.</string> <string name="osm_edits_view_descr">Kõiki üleslaadimata muudatusi või osm vigu saad vaadata menüüs %1$s. Üleslaaditud punkte OsmAnd ei kuva.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Ikooni näed ainult navigeerimise või liikumise ajal.</string> <string name="select_nav_icon_descr">Ikooni näed ainult navigeerimise või liikumise ajal.</string>
<string name="select_map_icon_descr">Kaardiikoon kuvatakse ainult kaardil ja muutub navigeerimise ajal navigeerimise ikooniks.</string> <string name="select_map_icon_descr">Kaardiikoon kuvatakse ainult kaardil ja muutub navigeerimise ajal navigeerimise ikooniks.</string>

View file

@ -3407,8 +3407,8 @@ représentant la zone : %1$s x %2$s</string>
<string name="live_monitoring_descr">Permet de partager votre position actuelle grâce à l\'enregistrement du trajet.</string> <string name="live_monitoring_descr">Permet de partager votre position actuelle grâce à l\'enregistrement du trajet.</string>
<string name="live_monitoring">Suivi en ligne</string> <string name="live_monitoring">Suivi en ligne</string>
<string name="save_track_logging_accuracy">Précision de l\'enregistrement</string> <string name="save_track_logging_accuracy">Précision de l\'enregistrement</string>
<string name="tracks_view_descr">Retrouvez toutes vos traces enregistrées dans le Menu : Mon emplacement &gt; Traces ou dans le dossier OsmAnd via votre gestionnaire de fichiers.</string> <string name="tracks_view_descr">Retrouvez toutes vos traces enregistrées dans le %1$s ou dans le dossier OsmAnd via votre gestionnaire de fichiers.</string>
<string name="multimedia_notes_view_descr">Retrouvez toutes vos notes dans le menu : Mon emplacement &gt; Notes</string> <string name="multimedia_notes_view_descr">Retrouvez toutes vos notes dans le %1$s</string>
<string name="video_notes">Notes vidéo</string> <string name="video_notes">Notes vidéo</string>
<string name="photo_notes">Notes photo</string> <string name="photo_notes">Notes photo</string>
<string name="route_recalculation">Recalcul de l\'itinéraire</string> <string name="route_recalculation">Recalcul de l\'itinéraire</string>
@ -3416,7 +3416,7 @@ représentant la zone : %1$s x %2$s</string>
<string name="login_and_pass">Nom d\'utilisateur et mot de passe</string> <string name="login_and_pass">Nom d\'utilisateur et mot de passe</string>
<string name="plugin_global_prefs_info">Ces paramètres de greffon sont globaux et s\'appliquent à tous les profils.</string> <string name="plugin_global_prefs_info">Ces paramètres de greffon sont globaux et s\'appliquent à tous les profils.</string>
<string name="osm_editing">Édition OpenStreetMap</string> <string name="osm_editing">Édition OpenStreetMap</string>
<string name="osm_edits_view_descr">Vous pouvez consulter toutes vos modifications non envoyées comme vos bugs OSM dans le menu : Mes emplacements &gt; Modifications OSM. Les points envoyés ne s\'affichent plus dans OsmAnd.</string> <string name="osm_edits_view_descr">Vous pouvez consulter toutes vos modifications non envoyées comme vos bugs OSM dans le %1$s. Les points envoyés ne s\'affichent plus dans OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Vous ne verrez l\'icône que lors de la navigation ou en déplacement.</string> <string name="select_nav_icon_descr">Vous ne verrez l\'icône que lors de la navigation ou en déplacement.</string>
<string name="select_map_icon_descr">L \'icône Carte n\'apparaît que sur la carte et est remplacée par l\'icône Navigation lors de la navigation.</string> <string name="select_map_icon_descr">L \'icône Carte n\'apparaît que sur la carte et est remplacée par l\'icône Navigation lors de la navigation.</string>

View file

@ -3466,8 +3466,8 @@ Lon %2$s</string>
<string name="live_monitoring_descr">Permite compartir a localización actual empregando a gravación da viaxe.</string> <string name="live_monitoring_descr">Permite compartir a localización actual empregando a gravación da viaxe.</string>
<string name="live_monitoring">Seguimento en liña</string> <string name="live_monitoring">Seguimento en liña</string>
<string name="save_track_logging_accuracy">Precisión de rexistro</string> <string name="save_track_logging_accuracy">Precisión de rexistro</string>
<string name="tracks_view_descr">Podes atopar todas as túas pistas gravadas en Menú — Os meus lugares — Pista ou no cartafol OsmAnd empregando o xestor de ficheiros.</string> <string name="tracks_view_descr">Podes atopar todas as túas pistas gravadas en %1$s ou no cartafol OsmAnd empregando o xestor de ficheiros.</string>
<string name="multimedia_notes_view_descr">Podes atopar todas as túas notas en Menú - Os meus lugares - Notas</string> <string name="multimedia_notes_view_descr">Podes atopar todas as túas notas en %1$s</string>
<string name="video_notes">Notas de vídeo</string> <string name="video_notes">Notas de vídeo</string>
<string name="photo_notes">Notas de imaxe</string> <string name="photo_notes">Notas de imaxe</string>
<string name="route_recalculation">Recálculo da ruta</string> <string name="route_recalculation">Recálculo da ruta</string>
@ -3475,7 +3475,7 @@ Lon %2$s</string>
<string name="login_and_pass">Nome de usuario e contrasinal</string> <string name="login_and_pass">Nome de usuario e contrasinal</string>
<string name="plugin_global_prefs_info">A configuración deste engadido é global e se aplica a todos os perfís.</string> <string name="plugin_global_prefs_info">A configuración deste engadido é global e se aplica a todos os perfís.</string>
<string name="osm_editing">Edición do OpenStreetMap</string> <string name="osm_editing">Edición do OpenStreetMap</string>
<string name="osm_edits_view_descr">Podes ollar todas as túas edicións de erros do osm non subidas en Menú — Os meus lugares — Edicións OSM. Os puntos subidos non se amosan no OsmAnd.</string> <string name="osm_edits_view_descr">Podes ollar todas as túas edicións de erros do osm non subidas en %1$s. Os puntos subidos non se amosan no OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Ollarás a icona só durante a navegación ou mentres esteas a moverte.</string> <string name="select_nav_icon_descr">Ollarás a icona só durante a navegación ou mentres esteas a moverte.</string>
<string name="select_map_icon_descr">A icona do mapa só aparece no mapa e muda durante a navegación á icona de navegación.</string> <string name="select_map_icon_descr">A icona do mapa só aparece no mapa e muda durante a navegación á icona de navegación.</string>

View file

@ -3424,8 +3424,6 @@
<string name="live_monitoring_descr">לאפשר לך לשתף את המיקום הנוכחי באמצעות הקלטת המסלול.</string> <string name="live_monitoring_descr">לאפשר לך לשתף את המיקום הנוכחי באמצעות הקלטת המסלול.</string>
<string name="live_monitoring">מעקב מקוון</string> <string name="live_monitoring">מעקב מקוון</string>
<string name="save_track_logging_accuracy">דיוק תיעוד ביומן</string> <string name="save_track_logging_accuracy">דיוק תיעוד ביומן</string>
<string name="tracks_view_descr">באפשרותך למצוא את כל המסלול שהקלטת בתפריט - המיקום שלי - מסלולים או בתיקייה של OsmAnd בעזרת מנהל קבצים.</string>
<string name="multimedia_notes_view_descr">באפשרותך למצוא את כל ההערות שכתבת תחת תפריט - המיקומים שלי - פתקים</string>
<string name="video_notes">הערות וידאו</string> <string name="video_notes">הערות וידאו</string>
<string name="photo_notes">הערות בתמונות</string> <string name="photo_notes">הערות בתמונות</string>
<string name="route_recalculation">חישוב מסלול מחדש</string> <string name="route_recalculation">חישוב מסלול מחדש</string>
@ -3433,7 +3431,6 @@
<string name="login_and_pass">שם משתמש וססמה</string> <string name="login_and_pass">שם משתמש וססמה</string>
<string name="plugin_global_prefs_info">הגדרות התוסף הזה הן גלובליות וחלות על כל הפרופילים.</string> <string name="plugin_global_prefs_info">הגדרות התוסף הזה הן גלובליות וחלות על כל הפרופילים.</string>
<string name="osm_editing">עריכה של OpenStreetMap</string> <string name="osm_editing">עריכה של OpenStreetMap</string>
<string name="osm_edits_view_descr">באפשרותך לצפות בכל העריכות שטרם העלית דרך התפריט - המקומות שלי - עריכות OSM. הנקודות שהועלו לא מופיעות ב־OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">הסמל יופיע רק בזמן הניווט או בזמן תזוזה.</string> <string name="select_nav_icon_descr">הסמל יופיע רק בזמן הניווט או בזמן תזוזה.</string>
<string name="select_map_icon_descr">סמל המפה מופיע במפה בלבד והוא מתחלף בעת הניווט לסמל הניווט.</string> <string name="select_map_icon_descr">סמל המפה מופיע במפה בלבד והוא מתחלף בעת הניווט לסמל הניווט.</string>

View file

@ -3434,8 +3434,8 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
<string name="live_monitoring_descr">Lehetővé teszi, hogy az útvonal rögzítésével megossza aktuális pozícióját.</string> <string name="live_monitoring_descr">Lehetővé teszi, hogy az útvonal rögzítésével megossza aktuális pozícióját.</string>
<string name="live_monitoring">Online nyomvonalrögzítés</string> <string name="live_monitoring">Online nyomvonalrögzítés</string>
<string name="save_track_logging_accuracy">Naplózás pontossága</string> <string name="save_track_logging_accuracy">Naplózás pontossága</string>
<string name="tracks_view_descr">Az összes rögzített nyomvonal megtalálható a Menü &gt; Saját helyek &gt; Nyomvonalaim helyen vagy a fájlkezelővel az OsmAnd mappában.</string> <string name="tracks_view_descr">Az összes rögzített nyomvonal megtalálható a %1$s helyen vagy a fájlkezelővel az OsmAnd mappában.</string>
<string name="multimedia_notes_view_descr">Az összes jegyzetét megtalálja a Menü &gt; Saját helyek &gt; Jegyzetek helyen</string> <string name="multimedia_notes_view_descr">Az összes jegyzetét megtalálja a %1$s helyen</string>
<string name="video_notes">Videojegyzetek</string> <string name="video_notes">Videojegyzetek</string>
<string name="photo_notes">Fényképes jegyzetek</string> <string name="photo_notes">Fényképes jegyzetek</string>
<string name="route_recalculation">Útvonal újraszámítása</string> <string name="route_recalculation">Útvonal újraszámítása</string>
@ -3443,7 +3443,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
<string name="login_and_pass">Felhasználónév és jelszó</string> <string name="login_and_pass">Felhasználónév és jelszó</string>
<string name="plugin_global_prefs_info">Ezek a bővítménybeállítások globálisak, és minden profilra vonatkoznak.</string> <string name="plugin_global_prefs_info">Ezek a bővítménybeállítások globálisak, és minden profilra vonatkoznak.</string>
<string name="osm_editing">OpenStreetMap-szerkesztés</string> <string name="osm_editing">OpenStreetMap-szerkesztés</string>
<string name="osm_edits_view_descr">Az összes még fel nem töltött szerkesztés vagy OSM-hiba megtalálható a Menü &gt; Saját helyek &gt; OSM-szerkesztések helyen. A már feltöltött pontok nem láthatók az OsmAndban.</string> <string name="osm_edits_view_descr">Az összes még fel nem töltött szerkesztés vagy OSM-hiba megtalálható a %1$s helyen. A már feltöltött pontok nem láthatók az OsmAndban.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Az ikon csak navigáció vagy mozgás közben lesz látható.</string> <string name="select_nav_icon_descr">Az ikon csak navigáció vagy mozgás közben lesz látható.</string>
<string name="select_map_icon_descr">A térképikon csak a térképen jelenik meg, navigáció közben pedig navigációs ikonra vált.</string> <string name="select_map_icon_descr">A térképikon csak a térképen jelenik meg, navigáció közben pedig navigációs ikonra vált.</string>

View file

@ -3432,8 +3432,8 @@ Rappresenta l\'area: %1$s x %2$s</string>
<string name="live_monitoring_descr">Permette di condividere la posizione corrente utilizzando la registrazione del viaggio.</string> <string name="live_monitoring_descr">Permette di condividere la posizione corrente utilizzando la registrazione del viaggio.</string>
<string name="live_monitoring">Tracciamento online</string> <string name="live_monitoring">Tracciamento online</string>
<string name="save_track_logging_accuracy">Precisione di registrazione</string> <string name="save_track_logging_accuracy">Precisione di registrazione</string>
<string name="tracks_view_descr">Puoi trovare tutte le tue tracce registrate in Menu - I miei luoghi - Le mie tracce o nella cartella OsmAd utilizzando il file manager.</string> <string name="tracks_view_descr">Puoi trovare tutte le tue tracce registrate in %1$s o nella cartella OsmAd utilizzando il file manager.</string>
<string name="multimedia_notes_view_descr">Puoi trovare tutte le tue note in Menu - I miei luoghi - Note</string> <string name="multimedia_notes_view_descr">Puoi trovare tutte le tue note in %1$s</string>
<string name="video_notes">Note video</string> <string name="video_notes">Note video</string>
<string name="photo_notes">Note fotografiche</string> <string name="photo_notes">Note fotografiche</string>
<string name="route_recalculation">Ricalcolo del percorso</string> <string name="route_recalculation">Ricalcolo del percorso</string>

View file

@ -237,4 +237,7 @@
<dimen name="wikilink_bottom_sheet_padding">21dp</dimen> <dimen name="wikilink_bottom_sheet_padding">21dp</dimen>
<dimen name="settings_divider_margin_start">108dp</dimen>
<dimen name="setting_list_item_large_height">108dp</dimen>
</resources> </resources>

View file

@ -3441,8 +3441,8 @@
<string name="live_monitoring_descr">Tillater deg å dele nåværende plassering ved bruk av turopptak.</string> <string name="live_monitoring_descr">Tillater deg å dele nåværende plassering ved bruk av turopptak.</string>
<string name="live_monitoring">Nettbasert sporing</string> <string name="live_monitoring">Nettbasert sporing</string>
<string name="save_track_logging_accuracy">Loggingsnøyaktighet</string> <string name="save_track_logging_accuracy">Loggingsnøyaktighet</string>
<string name="tracks_view_descr">Du kan finne alle dine innspilte spor i Meny → Mitt sted → Spor, eller i OsmAnd-mappen.</string> <string name="tracks_view_descr">Du kan finne alle dine innspilte spor i %1$s, eller i OsmAnd-mappen.</string>
<string name="multimedia_notes_view_descr">Du finner alle dine notater i Meny → Mine steder → Notater</string> <string name="multimedia_notes_view_descr">Du finner alle dine notater i %1$sr</string>
<string name="video_notes">Videonotater</string> <string name="video_notes">Videonotater</string>
<string name="photo_notes">Bildenotater</string> <string name="photo_notes">Bildenotater</string>
<string name="route_recalculation">Ruteomberegning</string> <string name="route_recalculation">Ruteomberegning</string>
@ -3450,7 +3450,7 @@
<string name="login_and_pass">Brukernavn og passord</string> <string name="login_and_pass">Brukernavn og passord</string>
<string name="plugin_global_prefs_info">Innstillinger av dette programtillegget har innvirkning på alle profiler.</string> <string name="plugin_global_prefs_info">Innstillinger av dette programtillegget har innvirkning på alle profiler.</string>
<string name="osm_editing">OpenStreetMap-redigering</string> <string name="osm_editing">OpenStreetMap-redigering</string>
<string name="osm_edits_view_descr">Du kan vise alle dine uopplastede redigeringer eller OSM-feil i Meny → Mine steder → OSM-redigeringer. Opplastede punkter viser ikke i OsmAnd.</string> <string name="osm_edits_view_descr">Du kan vise alle dine uopplastede redigeringer eller OSM-feil i %1$s. Opplastede punkter viser ikke i OsmAnd.</string>
<string name="select_nav_icon_descr">Du vil se ikonet kun under navigasjon eller bevegelse.</string> <string name="select_nav_icon_descr">Du vil se ikonet kun under navigasjon eller bevegelse.</string>
<string name="select_map_icon_descr">Kartikon vises kun på kartet, og endrer seg under navigasjon til navigasjonsikonet.</string> <string name="select_map_icon_descr">Kartikon vises kun på kartet, og endrer seg under navigasjon til navigasjonsikonet.</string>
</resources> </resources>

View file

@ -3311,8 +3311,8 @@ voor Gebied: %1$s x %2$s</string>
<string name="live_monitoring_descr">Laat u toe uw positie te delen dankzij reisopname.</string> <string name="live_monitoring_descr">Laat u toe uw positie te delen dankzij reisopname.</string>
<string name="live_monitoring">Online volgen</string> <string name="live_monitoring">Online volgen</string>
<string name="save_track_logging_accuracy">Opnamenauwkeurigheid</string> <string name="save_track_logging_accuracy">Opnamenauwkeurigheid</string>
<string name="tracks_view_descr">U kan al uw opgenomen tracks terugvinden bij Menu - Mijn plaatsen - Tracks of in OsmAnd-map met een bestand verkenner.</string> <string name="tracks_view_descr">U kan al uw opgenomen tracks terugvinden bij %1$s of in OsmAnd-map met een bestand verkenner.</string>
<string name="multimedia_notes_view_descr">U kan al uw notities terugvinden bij Menu - Mijn plaatsen - Notities</string> <string name="multimedia_notes_view_descr">U kan al uw notities terugvinden bij %1$s</string>
<string name="video_notes">Videonotities</string> <string name="video_notes">Videonotities</string>
<string name="photo_notes">Fotonotities</string> <string name="photo_notes">Fotonotities</string>
<string name="route_recalculation">Route herberekening</string> <string name="route_recalculation">Route herberekening</string>
@ -3320,7 +3320,7 @@ voor Gebied: %1$s x %2$s</string>
<string name="login_and_pass">Gebruikersnaam en wachtwoord</string> <string name="login_and_pass">Gebruikersnaam en wachtwoord</string>
<string name="plugin_global_prefs_info">Deze plugin instellingen zijn globaal en hebben betrekking op alle profielen.</string> <string name="plugin_global_prefs_info">Deze plugin instellingen zijn globaal en hebben betrekking op alle profielen.</string>
<string name="osm_editing">OpenStreetMap Bewerking</string> <string name="osm_editing">OpenStreetMap Bewerking</string>
<string name="osm_edits_view_descr">U kan al uw niet-geüploade bewerkingen of osm fouten zien in Menu - Mijn plaatsen - OSM Bewerkingen. Geüploade punten ziet u niet in OsmAnd.</string> <string name="osm_edits_view_descr">U kan al uw niet-geüploade bewerkingen of osm fouten zien in %1$s. Geüploade punten ziet u niet in OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">U zal het icoon enkel zien tijdens het navigeren of bewegen.</string> <string name="select_nav_icon_descr">U zal het icoon enkel zien tijdens het navigeren of bewegen.</string>
<string name="select_map_icon_descr">Kaarticoon verschijnt op de kaart en wijzigt slechts bij het navigeren in het navigatie-icoon.</string> <string name="select_map_icon_descr">Kaarticoon verschijnt op de kaart en wijzigt slechts bij het navigeren in het navigatie-icoon.</string>

View file

@ -3421,8 +3421,8 @@ Pôr do Sol: %2$s</string>
<string name="live_monitoring_descr">Permite compartilhar a localização atual usando a gravação de viagem.</string> <string name="live_monitoring_descr">Permite compartilhar a localização atual usando a gravação de viagem.</string>
<string name="live_monitoring">Rastreamento online</string> <string name="live_monitoring">Rastreamento online</string>
<string name="save_track_logging_accuracy">Precisão de registro</string> <string name="save_track_logging_accuracy">Precisão de registro</string>
<string name="tracks_view_descr">Você pode encontrar todas as suas faixas gravadas em Menu - Meu lugar - Faixas ou na pasta OsmAd usando o gerenciador de arquivos.</string> <string name="tracks_view_descr">Você pode encontrar todas as suas faixas gravadas em %1$ss ou na pasta OsmAd usando o gerenciador de arquivos.</string>
<string name="multimedia_notes_view_descr">Você pode encontrar todas as suas anotações em Menu - Meus lugares - Notas</string> <string name="multimedia_notes_view_descr">Você pode encontrar todas as suas anotações em %1$s</string>
<string name="video_notes">Notas de vídeo</string> <string name="video_notes">Notas de vídeo</string>
<string name="photo_notes">Notas fotográficas</string> <string name="photo_notes">Notas fotográficas</string>
<string name="route_recalculation">Recálculo da rota</string> <string name="route_recalculation">Recálculo da rota</string>
@ -3430,7 +3430,7 @@ Pôr do Sol: %2$s</string>
<string name="login_and_pass">Usuário e senha</string> <string name="login_and_pass">Usuário e senha</string>
<string name="plugin_global_prefs_info">As configurações deste plug-in são globais e se aplicam a todos os perfis.</string> <string name="plugin_global_prefs_info">As configurações deste plug-in são globais e se aplicam a todos os perfis.</string>
<string name="osm_editing">Edição de OpenStreetMap</string> <string name="osm_editing">Edição de OpenStreetMap</string>
<string name="osm_edits_view_descr">Você pode ver todos os erros de osm do editor carregado em Menu - Meus lugares - Edições OSM. Os pontos enviados não são exibidos no OsmAnd.</string> <string name="osm_edits_view_descr">Você pode ver todos os erros de osm do editor carregado em %1$s. Os pontos enviados não são exibidos no OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Você verá o ícone apenas enquanto estiver navegando ou em movimento.</string> <string name="select_nav_icon_descr">Você verá o ícone apenas enquanto estiver navegando ou em movimento.</string>
<string name="select_map_icon_descr">O ícone do mapa aparece apenas no mapa e é alterado enquanto estiver navegando para o ícone de navegação.</string> <string name="select_map_icon_descr">O ícone do mapa aparece apenas no mapa e é alterado enquanto estiver navegando para o ícone de navegação.</string>

View file

@ -3434,8 +3434,8 @@ Pro praghere iscrie su còdighe intreu</string>
<string name="live_monitoring_descr">Ti permitit de cumpartzire sa positzione atuale impreende sa registratzione de su biàgiu.</string> <string name="live_monitoring_descr">Ti permitit de cumpartzire sa positzione atuale impreende sa registratzione de su biàgiu.</string>
<string name="live_monitoring">Arrastamentu in lìnia</string> <string name="live_monitoring">Arrastamentu in lìnia</string>
<string name="save_track_logging_accuracy">Pretzisione de registratzione</string> <string name="save_track_logging_accuracy">Pretzisione de registratzione</string>
<string name="tracks_view_descr">Podes agatare totu sas rastas registradas tuas in Menù — Logos meos — Rastas o in sa cartella de OsmAnd impreende su gestore de documentos.</string> <string name="tracks_view_descr">Podes agatare totu sas rastas registradas tuas in %1$s o in sa cartella de OsmAnd impreende su gestore de documentos.</string>
<string name="multimedia_notes_view_descr">Podes agatare totu sas notas tuas in Menù — Logos meos — Notas</string> <string name="multimedia_notes_view_descr">Podes agatare totu sas notas tuas in %1$s</string>
<string name="video_notes">Vìdeo-notas</string> <string name="video_notes">Vìdeo-notas</string>
<string name="photo_notes">Foto-notas</string> <string name="photo_notes">Foto-notas</string>
<string name="route_recalculation">Ricàlculu de s\'àndala</string> <string name="route_recalculation">Ricàlculu de s\'àndala</string>
@ -3443,7 +3443,7 @@ Pro praghere iscrie su còdighe intreu</string>
<string name="login_and_pass">Nùmene impreadore e crae</string> <string name="login_and_pass">Nùmene impreadore e crae</string>
<string name="plugin_global_prefs_info">Sas impostatziones de s\'estensione sunt globales, e si aplicant a totu sos profilos.</string> <string name="plugin_global_prefs_info">Sas impostatziones de s\'estensione sunt globales, e si aplicant a totu sos profilos.</string>
<string name="osm_editing">Modìfica de OpenStreetMap</string> <string name="osm_editing">Modìfica de OpenStreetMap</string>
<string name="osm_edits_view_descr">Podes pompiare totu sas modìficas non carrigadas tuas o sos errores de osm in Menù — Logos meos — Modìficas de OSM. Sos puntos carrigados no ant a èssere ammustrados in OsmAnd.</string> <string name="osm_edits_view_descr">Podes pompiare totu sas modìficas non carrigadas tuas o sos errores de osm in %1$s. Sos puntos carrigados no ant a èssere ammustrados in OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">As a bìdere s\'icona petzi durante sa navigatzione o su movimentu.</string> <string name="select_nav_icon_descr">As a bìdere s\'icona petzi durante sa navigatzione o su movimentu.</string>
<string name="select_map_icon_descr">S\'icona de sa mapa aparit in sa mapa ebbia, e divenit s\'icona de navigatzione durante sa navigatzione.</string> <string name="select_map_icon_descr">S\'icona de sa mapa aparit in sa mapa ebbia, e divenit s\'icona de navigatzione durante sa navigatzione.</string>

View file

@ -3385,8 +3385,6 @@
<string name="live_monitoring_descr">Seyahat kaydını kullanarak geçerli konumunuzu paylaşmaya izin verin.</string> <string name="live_monitoring_descr">Seyahat kaydını kullanarak geçerli konumunuzu paylaşmaya izin verin.</string>
<string name="live_monitoring">Çevrimiçi takip etme</string> <string name="live_monitoring">Çevrimiçi takip etme</string>
<string name="save_track_logging_accuracy">Kayıt tutma doğruluğu</string> <string name="save_track_logging_accuracy">Kayıt tutma doğruluğu</string>
<string name="tracks_view_descr">Kaydedilen tüm yol-izlerinizi Menü - Benim yerim - Yol-izleri içinde veya dosya yöneticisini kullanarak OsmAnd klasöründe bulabilirsiniz.</string>
<string name="multimedia_notes_view_descr">Tüm notlarınızı Menü - Yerlerim - Notlar bölümünde bulabilirsiniz</string>
<string name="video_notes">Video notları</string> <string name="video_notes">Video notları</string>
<string name="photo_notes">Fotoğraf notları</string> <string name="photo_notes">Fotoğraf notları</string>
<string name="route_recalculation">Rotanın yeniden hesaplanması</string> <string name="route_recalculation">Rotanın yeniden hesaplanması</string>
@ -3394,7 +3392,7 @@
<string name="login_and_pass">Kullanıcı adı ve parola</string> <string name="login_and_pass">Kullanıcı adı ve parola</string>
<string name="plugin_global_prefs_info">Bu eklenti ayarları globaldir ve tüm profiller için geçerlidir.</string> <string name="plugin_global_prefs_info">Bu eklenti ayarları globaldir ve tüm profiller için geçerlidir.</string>
<string name="osm_editing">OpenStreetMap Düzenleme</string> <string name="osm_editing">OpenStreetMap Düzenleme</string>
<string name="osm_edits_view_descr">Karşıya yüklenmemiş tüm düzenlemelerinizi veya osm hatalarınızı Menü — Yerlerim — OSM Düzenlemeleri içinde görüntüleyebilirsiniz. Yüklenen noktalar OsmAnd\'de gösterilmez.</string> <string name="osm_edits_view_descr">Karşıya yüklenmemiş tüm düzenlemelerinizi veya osm hatalarınızı %1$s içinde görüntüleyebilirsiniz. Yüklenen noktalar OsmAnd\'de gösterilmez.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Simgeyi yalnızca navigasyon sırasında veya hareket halindeyken göreceksiniz.</string> <string name="select_nav_icon_descr">Simgeyi yalnızca navigasyon sırasında veya hareket halindeyken göreceksiniz.</string>
<string name="select_map_icon_descr">Harita simgesi yalnızca haritada görünür ve navigasyon esnasında navigasyon simgesine dönüşür.</string> <string name="select_map_icon_descr">Harita simgesi yalnızca haritada görünür ve navigasyon esnasında navigasyon simgesine dönüşür.</string>

View file

@ -3425,8 +3425,8 @@
<string name="live_monitoring_descr">Дозволяє ділитися поточним місцезнаходженням, використовуючи запис поїздки.</string> <string name="live_monitoring_descr">Дозволяє ділитися поточним місцезнаходженням, використовуючи запис поїздки.</string>
<string name="live_monitoring">Мережеве відстеження</string> <string name="live_monitoring">Мережеве відстеження</string>
<string name="save_track_logging_accuracy">Точність часопису</string> <string name="save_track_logging_accuracy">Точність часопису</string>
<string name="tracks_view_descr">Ви можете знайти всі записи в Меню - Мої місця - Треки або в теці OsmAnd за допомогою файлового провідника.</string> <string name="tracks_view_descr">Ви можете знайти всі записи в %1$s або в теці OsmAnd за допомогою файлового провідника.</string>
<string name="multimedia_notes_view_descr">Ви можете знайти всі свої примітки в Меню - Мої місця - Примітки</string> <string name="multimedia_notes_view_descr">Ви можете знайти всі свої примітки в %1$s</string>
<string name="video_notes">Відеопримітки</string> <string name="video_notes">Відеопримітки</string>
<string name="photo_notes">Світлинопримітки</string> <string name="photo_notes">Світлинопримітки</string>
<string name="route_recalculation">Перерахунок маршруту</string> <string name="route_recalculation">Перерахунок маршруту</string>
@ -3434,7 +3434,7 @@
<string name="login_and_pass">Ім\'я користувача і пароль</string> <string name="login_and_pass">Ім\'я користувача і пароль</string>
<string name="plugin_global_prefs_info">Налаштування цього втулка є всеохопними та стосуються всіх профілів.</string> <string name="plugin_global_prefs_info">Налаштування цього втулка є всеохопними та стосуються всіх профілів.</string>
<string name="osm_editing">OpenStreetMap редагування</string> <string name="osm_editing">OpenStreetMap редагування</string>
<string name="osm_edits_view_descr">Ви можете переглянути всі не завантажені зміни або помилки в OSM в Меню - Мої місця - Правки OSM. Завантажені точки не відображаються в OsmAnd.</string> <string name="osm_edits_view_descr">Ви можете переглянути всі не завантажені зміни або помилки в OSM в %1$s. Завантажені точки не відображаються в OsmAnd.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Ви побачите значок тільки під час навігації або під час переміщення.</string> <string name="select_nav_icon_descr">Ви побачите значок тільки під час навігації або під час переміщення.</string>
<string name="select_map_icon_descr">Образок мапи відображається лише на мапі та змінюється під час навігації до образка навігації.</string> <string name="select_map_icon_descr">Образок мапи відображається лише на мапі та змінюється під час навігації до образка навігації.</string>

View file

@ -3422,8 +3422,6 @@
<string name="live_monitoring_descr">允許您使用旅程錄製來分享目前的位置。</string> <string name="live_monitoring_descr">允許您使用旅程錄製來分享目前的位置。</string>
<string name="live_monitoring">線上追蹤</string> <string name="live_monitoring">線上追蹤</string>
<string name="save_track_logging_accuracy">記錄精度</string> <string name="save_track_logging_accuracy">記錄精度</string>
<string name="tracks_view_descr">您可以在選單 → 我的收藏 → 軌跡或使用檔案管理員在 OsmAnd 的資料夾中找到您所有已紀錄的軌跡。</string>
<string name="multimedia_notes_view_descr">您可以在選單 → 我的收藏 → 註記中找到您所有的註記</string>
<string name="video_notes">視訊註記</string> <string name="video_notes">視訊註記</string>
<string name="photo_notes">照片註記</string> <string name="photo_notes">照片註記</string>
<string name="route_recalculation">路徑重新計算</string> <string name="route_recalculation">路徑重新計算</string>
@ -3431,7 +3429,6 @@
<string name="login_and_pass">使用者名稱與密碼</string> <string name="login_and_pass">使用者名稱與密碼</string>
<string name="plugin_global_prefs_info">此外掛程式設定是全域設定,並會套用到所有設定檔。</string> <string name="plugin_global_prefs_info">此外掛程式設定是全域設定,並會套用到所有設定檔。</string>
<string name="osm_editing">開放街圖編輯</string> <string name="osm_editing">開放街圖編輯</string>
<string name="osm_edits_view_descr">您可以在選單 → 我的收藏 → OSM 編輯中檢視您所有未上傳的編輯或開放街圖的問題。已上傳的點不會在 OsmAnd 中顯示。</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">僅在導航或移動時,您才會看到該圖示。</string> <string name="select_nav_icon_descr">僅在導航或移動時,您才會看到該圖示。</string>
<string name="select_map_icon_descr">地圖圖示只會顯示在地圖上,並會在導航時換成導航圖示。</string> <string name="select_map_icon_descr">地圖圖示只會顯示在地圖上,並會在導航時換成導航圖示。</string>

View file

@ -350,5 +350,7 @@
<dimen name="setting_profile_item_height">64dp</dimen> <dimen name="setting_profile_item_height">64dp</dimen>
<dimen name="setting_profile_item_switch_margin">18dp</dimen> <dimen name="setting_profile_item_switch_margin">18dp</dimen>
<dimen name="settings_divider_margin_start">72dp</dimen>
<dimen name="setting_list_item_large_height">72dp</dimen>
</resources> </resources>

View file

@ -11,9 +11,37 @@
Thx - Hardy Thx - Hardy
--> -->
<string name="permission_is_required">Permission is required to use this option.</string>
<string name="logcat_buffer_descr">Check and share detailed logs of the application</string> <string name="logcat_buffer_descr">Check and share detailed logs of the application</string>
<string name="file_does_not_contain_routing_rules">No routing rules in \'%1$s\'. Please choose another file.</string> <string name="file_does_not_contain_routing_rules">No routing rules in \'%1$s\'. Please choose another file.</string>
<string name="not_support_file_type_with_ext">Select a supported %1$s extension file instead.</string> <string name="not_support_file_type_with_ext">Select a supported %1$s extension file instead.</string>
<string name="monitoring_min_speed_descr">This is a low-speed cut-off filter to not record points below a certain speed. This may make recorded tracks look "smoother" when viewed on the map.</string>
<string name="monitoring_min_speed_descr_side_effect">Side effect: Your track will be missing all sections where the minimum speed criterion was not met (e.g. where you push your bike up a steep hill). Also, there will be no information about periods at rest, like breaks. This has effects on any analysis or post-processing, like when trying to determine the total length of your trip, time in motion, or your average speed.</string>
<string name="monitoring_min_speed_descr_recommendation">Recommendation: Try using the motion detection via the "logging minimum displacement" filter (B) first, it may produce better results, and you will lose less data. If your tracks remain noisy at low speeds, try non-zero values here. Please note that some measurements may not report any speed value at all (some network-based methods), in which case you would not record anything.</string>
<string name="monitoring_min_speed_descr_remark">Remark: "speed > 0" check: Most GPS chipsets report a speed value only if the algorithm determines you are in motion, and none if you are not. Hence using the "> 0" setting in this filter in a sense uses the motion detection of the GPS chipset. But even if not filtered here at recording time, we still use this feature in our GPX analysis to determine the "Distance corrected", i.e. the value displayed in that field is the "distance recorded while in motion".</string>
<string name="monitoring_min_accuracy_descr">This will record only points measured with a minimum "accuracy" indication (in meters/feet, as reported by Android for your chipset). Accuracy refers to the scatter of repeated measurements, and is not directly related to precision, which defines how close your measurements are to your "true" position.</string>
<string name="monitoring_min_accuracy_descr_side_effect">Side effect: As a result of filtering by accuracy, points may be entirely missing for e.g. below bridges, under trees, between high buildings, or with certain weather conditions.</string>
<string name="monitoring_min_accuracy_descr_recommendation">Recommendation: It is hard to predict what will be recorded and what not, it may be best to turn this filter off.</string>
<string name="monitoring_min_accuracy_descr_remark">Remark: If GPS had been off immediately before a recording, the first point measured may have a decreased accuracy,so in our code we may want to wait a second or so before recording a point (or record the best of 3 consecutive points, etc.), but this is not yet implemented.</string>
<string name="monitoring_min_distance_descr">This filter avoids duplicate points being recorded where too little actual motion may have occurred, makes a nicer spatial appearance of tracks not post-processed later.</string>
<string name="monitoring_min_distance_descr_side_effect">Side effects: Periods at rest are not recorded at all or by just one point each. Small (real world) movements (e.g. sideways, to mark a possile turnoff on your trip) may be filtered out. Your file contains less information for post-processing, and has worse stats by filtering out obviously redundant points at recording time, while potentially keeping artifacts caused by bad reception or GPS chipset effects.</string>
<string name="monitoring_min_distance_descr_recommendation">Recommendation: A setting of 5 meters may work well for you if you do not require to capture details finer than that, and do not want to explicitly capture data while at rest.</string>
<string name="live_monitoring_time_buffer">Time buffer</string>
<string name="live_monitoring_tracking_interval">Tracking interval</string>
<string name="live_monitoring_adress">Web address</string>
<string name="live_monitoring_adress_descr">Specify the web address with parameter syntax: lat={0}, lon={1}, timestamp={2}, hdop={3}, altitude={4}, speed={5}, bearing={6}.</string>
<string name="monitoring_notification">Notification</string>
<string name="monitoring_min_speed">Minimum speed</string>
<string name="monitoring_min_accuracy">Minimum accuracy</string>
<string name="monitoring_min_distance">Minimum displacement</string>
<string name="tracks_view_path">Menu — My places — Tracks</string>
<string name="multimedia_notes_view_path">Menu — My places — Notes</string>
<string name="osm_edits_view_path">Menu — My places — OSM Edits</string>
<string name="reset_plugin_to_default">Reset plugin settings to default</string>
<string name="multimedia_rec_split_title">Recorder split</string>
<string name="multimedia_use_system_camera">Use system app</string>
<string name="multimedia_photo_play_sound">Camera shutter sound</string>
<string name="osm_authorization_success">Authorization is successful</string>
<string name="import_from_file">Import from file</string> <string name="import_from_file">Import from file</string>
<string name="import_routing_file">Import routing file</string> <string name="import_routing_file">Import routing file</string>
<string name="import_profile">Import profile</string> <string name="import_profile">Import profile</string>
@ -24,8 +52,8 @@
<string name="live_monitoring_descr">Allows sharing current location using trip recording.</string> <string name="live_monitoring_descr">Allows sharing current location using trip recording.</string>
<string name="live_monitoring">Online tracking</string> <string name="live_monitoring">Online tracking</string>
<string name="save_track_logging_accuracy">Logging accuracy</string> <string name="save_track_logging_accuracy">Logging accuracy</string>
<string name="tracks_view_descr">Your recorded tracks are in \'Menu\' → \'My place\' → \'Tracks\', or the OsmAnd folder.</string> <string name="tracks_view_descr">Your recorded tracks are in %1$s, or the OsmAnd folder.</string>
<string name="multimedia_notes_view_descr">Your OSM notes are in \'Menu\' → \'My places\' → \'OSM edits\'.</string> <string name="multimedia_notes_view_descr">Your OSM notes are in %1$s.</string>
<string name="video_notes">Video notes</string> <string name="video_notes">Video notes</string>
<string name="photo_notes">Photo notes</string> <string name="photo_notes">Photo notes</string>
<string name="route_recalculation">Route recalculation</string> <string name="route_recalculation">Route recalculation</string>
@ -33,7 +61,7 @@
<string name="login_and_pass">Username and password</string> <string name="login_and_pass">Username and password</string>
<string name="plugin_global_prefs_info">These settings apply to all profiles.</string> <string name="plugin_global_prefs_info">These settings apply to all profiles.</string>
<string name="osm_editing">OSM editing</string> <string name="osm_editing">OSM editing</string>
<string name="osm_edits_view_descr">View your edits or OSM bugs not yet uploaded in \'Menu\' → \'My places\' — \'OSM edits\'. Uploaded points will not show any more.</string> <string name="osm_edits_view_descr">View your edits or OSM bugs not yet uploaded in %1$s. Uploaded points will not show any more.</string>
<string name="app_mode_osm">OSM</string> <string name="app_mode_osm">OSM</string>
<string name="select_nav_icon_descr">Icon only shown while navigating or moving.</string> <string name="select_nav_icon_descr">Icon only shown while navigating or moving.</string>
<string name="select_map_icon_descr">Map icon only shown on the map.</string> <string name="select_map_icon_descr">Map icon only shown on the map.</string>

View file

@ -97,7 +97,7 @@
android:key="reset_to_default" android:key="reset_to_default"
android:layout="@layout/preference_button" android:layout="@layout/preference_button"
android:persistent="false" android:persistent="false"
android:title="@string/reset_to_default" android:title="@string/reset_plugin_to_default"
tools:icon="@drawable/ic_action_reset_to_default_dark" /> tools:icon="@drawable/ic_action_reset_to_default_dark" />
</PreferenceScreen> </PreferenceScreen>

View file

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:title="@string/debugging_and_development">
<Preference
android:key="development_info"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:selectable="false"
android:title="@string/plugin_global_prefs_info"
tools:icon="@drawable/ic_action_info_dark" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="use_opengl_render"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/use_opengl_render" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="safe_mode"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/safe_mode" />
<PreferenceCategory
android:key="routing"
android:layout="@layout/preference_category_with_descr"
android:title="@string/routing_settings" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="disable_complex_routing"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/disable_complex_routing" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="use_fast_recalculation"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/use_fast_recalculation" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="enable_osmc_routing"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/use_osm_live_routing" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="enable_osmc_public_transport"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/use_osm_live_public_transport" />
<Preference
android:key="simulate_your_location"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:title="@string/simulate_your_location"
tools:summary="@string/simulate_your_location_stop_descr" />
<PreferenceCategory
android:key="debugging_and_development"
android:layout="@layout/preference_category_with_descr"
android:title="@string/debugging_and_development" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="debug_rendering"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/trace_rendering" />
<Preference
android:key="simulate_initial_startup"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:summary="@string/simulate_initial_startup_descr"
android:title="@string/simulate_initial_startup" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="should_show_free_version_banner"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/show_free_version_banner" />
<Preference
android:key="test_voice_commands"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:summary="@string/play_commands_of_currently_selected_voice"
android:title="@string/test_voice_prompts" />
<Preference
android:key="logcat_buffer"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:summary="@string/logcat_buffer_descr"
android:title="@string/logcat_buffer" />
<PreferenceCategory
android:key="info"
android:layout="@layout/preference_category_with_descr"
android:title="@string/info_button" />
<Preference
android:key="global_app_allocated_memory"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:selectable="false"
android:title="@string/global_app_allocated_memory"
tools:summary="@string/global_app_allocated_memory_descr" />
<Preference
android:key="native_app_allocated_memory"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:selectable="false"
android:title="@string/native_app_allocated_memory"
tools:summary="@string/native_app_allocated_memory_descr" />
<Preference
android:key="agps_data_downloaded"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:title="@string/agps_info"
tools:summary="@string/agps_data_last_downloaded" />
<Preference
android:key="day_night_info"
android:layout="@layout/preference_with_descr"
android:persistent="false"
android:selectable="false"
android:title="@string/day_night_info"
tools:summary="@string/day_night_info_description" />
</PreferenceScreen>

View file

@ -6,7 +6,7 @@
<Preference <Preference
android:key="live_monitoring_info" android:key="live_monitoring_info"
android:layout="@layout/preference_info" android:layout="@layout/preference_with_descr"
android:persistent="false" android:persistent="false"
android:selectable="false" android:selectable="false"
android:title="@string/live_monitoring_descr" /> android:title="@string/live_monitoring_descr" />
@ -14,21 +14,21 @@
<net.osmand.plus.settings.preferences.EditTextPreferenceEx <net.osmand.plus.settings.preferences.EditTextPreferenceEx
android:key="live_monitoring_url" android:key="live_monitoring_url"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:title="@string/live_monitoring_url" android:title="@string/live_monitoring_adress"
tools:icon="@drawable/ic_world_globe_dark" tools:icon="@drawable/ic_world_globe_dark"
tools:summary="@string/live_monitoring_m_descr" /> tools:summary="@string/live_monitoring_m_descr" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
android:key="live_monitoring_interval" android:key="live_monitoring_interval"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:title="@string/live_monitoring_interval" android:title="@string/live_monitoring_tracking_interval"
tools:icon="@drawable/ic_action_time_span" tools:icon="@drawable/ic_action_time_span"
tools:summary="5 seconds" /> tools:summary="5 seconds" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
android:key="live_monitoring_maximum_interval_to_send" android:key="live_monitoring_maximum_interval_to_send"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:title="@string/live_monitoring_max_interval_to_send" android:title="@string/live_monitoring_time_buffer"
tools:icon="@drawable/ic_action_time_span" tools:icon="@drawable/ic_action_time_span"
tools:summary="15 min" /> tools:summary="15 min" />

View file

@ -36,19 +36,19 @@
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
android:key="save_track_min_distance" android:key="save_track_min_distance"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:title="@string/save_track_min_distance" android:title="@string/monitoring_min_distance"
tools:summary="Not selected" /> tools:summary="Not selected" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
android:key="save_track_precision" android:key="save_track_precision"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:title="@string/save_track_precision" android:title="@string/monitoring_min_accuracy"
tools:summary="50 m" /> tools:summary="50 m" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
android:key="save_track_min_speed" android:key="save_track_min_speed"
android:layout="@layout/preference_with_descr" android:layout="@layout/preference_with_descr"
android:title="@string/save_track_min_speed" android:title="@string/monitoring_min_speed"
tools:summary="Not selected" /> tools:summary="Not selected" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx <net.osmand.plus.settings.preferences.SwitchPreferenceEx
@ -65,6 +65,13 @@
android:summaryOn="@string/shared_string_enabled" android:summaryOn="@string/shared_string_enabled"
android:title="@string/disable_recording_once_app_killed" /> android:title="@string/disable_recording_once_app_killed" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="save_heading_to_gpx"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/save_heading" />
<Preference <Preference
android:layout="@layout/simple_divider_item" android:layout="@layout/simple_divider_item"
android:selectable="false" /> android:selectable="false" />
@ -76,6 +83,18 @@
tools:icon="@drawable/ic_action_folder" tools:icon="@drawable/ic_action_folder"
tools:summary="Not selected" /> tools:summary="Not selected" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="show_trip_recording_notification"
android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled"
android:title="@string/monitoring_notification"
tools:icon="@drawable/ic_action_notification" />
<Preference
android:layout="@layout/simple_divider_item"
android:selectable="false" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx <net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="live_monitoring" android:key="live_monitoring"
android:layout="@layout/preference_with_descr_dialog_and_switch" android:layout="@layout/preference_with_descr_dialog_and_switch"
@ -91,7 +110,7 @@
<Preference <Preference
android:key="open_tracks_description" android:key="open_tracks_description"
android:layout="@layout/preference_info" android:layout="@layout/preference_description"
android:persistent="false" android:persistent="false"
android:selectable="false" android:selectable="false"
android:title="@string/tracks_view_descr" /> android:title="@string/tracks_view_descr" />
@ -104,14 +123,14 @@
tools:icon="@drawable/ic_action_folder" /> tools:icon="@drawable/ic_action_folder" />
<Preference <Preference
android:layout="@layout/simple_divider_item" android:layout="@layout/divider_half_item"
android:selectable="false" /> android:selectable="false" />
<Preference <Preference
android:key="reset_to_default" android:key="reset_to_default"
android:layout="@layout/preference_button" android:layout="@layout/preference_button"
android:persistent="false" android:persistent="false"
android:title="@string/reset_to_default" android:title="@string/reset_plugin_to_default"
tools:icon="@drawable/ic_action_reset_to_default_dark" /> tools:icon="@drawable/ic_action_reset_to_default_dark" />
<Preference <Preference

View file

@ -8,12 +8,19 @@
android:layout="@layout/preference_category_with_descr" android:layout="@layout/preference_category_with_descr"
android:title="@string/photo_notes" /> android:title="@string/photo_notes" />
<Preference
android:icon="@drawable/ic_action_lock"
android:key="camera_permission"
android:layout="@layout/preference_permission"
android:summary="@string/give_permission"
android:title="@string/permission_is_required" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx <net.osmand.plus.settings.preferences.SwitchPreferenceEx
android:key="av_external_cam" android:key="av_external_cam"
android:layout="@layout/preference_with_descr_dialog_and_switch" android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled" android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled" android:summaryOn="@string/shared_string_enabled"
android:title="@string/av_use_external_camera" android:title="@string/multimedia_use_system_camera"
tools:icon="@drawable/ic_action_photo_dark" /> tools:icon="@drawable/ic_action_photo_dark" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
@ -35,7 +42,7 @@
android:layout="@layout/preference_with_descr_dialog_and_switch" android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled" android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled" android:summaryOn="@string/shared_string_enabled"
android:title="@string/av_photo_play_sound" android:title="@string/multimedia_photo_play_sound"
tools:icon="@drawable/ic_action_music_off" /> tools:icon="@drawable/ic_action_music_off" />
<Preference <Preference
@ -73,7 +80,7 @@
android:layout="@layout/preference_with_descr_dialog_and_switch" android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled" android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled" android:summaryOn="@string/shared_string_enabled"
android:title="@string/av_use_external_recorder" android:title="@string/multimedia_use_system_camera"
tools:icon="@drawable/ic_action_video_dark" /> tools:icon="@drawable/ic_action_video_dark" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
@ -84,7 +91,7 @@
tools:summary="4128x3096 (12.19 Mpx)" /> tools:summary="4128x3096 (12.19 Mpx)" />
<Preference <Preference
android:layout="@layout/simple_divider_item" android:layout="@layout/divider_half_item"
android:selectable="false" /> android:selectable="false" />
<net.osmand.plus.settings.preferences.SwitchPreferenceEx <net.osmand.plus.settings.preferences.SwitchPreferenceEx
@ -92,7 +99,7 @@
android:layout="@layout/preference_with_descr_dialog_and_switch" android:layout="@layout/preference_with_descr_dialog_and_switch"
android:summaryOff="@string/shared_string_disabled" android:summaryOff="@string/shared_string_disabled"
android:summaryOn="@string/shared_string_enabled" android:summaryOn="@string/shared_string_enabled"
android:title="@string/rec_split_title" /> android:title="@string/multimedia_rec_split_title" />
<net.osmand.plus.settings.preferences.ListPreferenceEx <net.osmand.plus.settings.preferences.ListPreferenceEx
android:key="av_rs_clip_length" android:key="av_rs_clip_length"
@ -113,7 +120,7 @@
<Preference <Preference
android:key="open_notes_description" android:key="open_notes_description"
android:layout="@layout/preference_info" android:layout="@layout/preference_description"
android:persistent="false" android:persistent="false"
android:selectable="false" android:selectable="false"
android:title="@string/multimedia_notes_view_descr" /> android:title="@string/multimedia_notes_view_descr" />
@ -126,14 +133,14 @@
tools:icon="@drawable/ic_action_folder" /> tools:icon="@drawable/ic_action_folder" />
<Preference <Preference
android:layout="@layout/simple_divider_item" android:layout="@layout/divider_half_item"
android:selectable="false" /> android:selectable="false" />
<Preference <Preference
android:key="reset_to_default" android:key="reset_to_default"
android:layout="@layout/preference_button" android:layout="@layout/preference_button"
android:persistent="false" android:persistent="false"
android:title="@string/reset_to_default" android:title="@string/reset_plugin_to_default"
tools:icon="@drawable/ic_action_reset_to_default_dark" /> tools:icon="@drawable/ic_action_reset_to_default_dark" />
<Preference <Preference

View file

@ -6,7 +6,7 @@
<Preference <Preference
android:key="osm_editing_info" android:key="osm_editing_info"
android:layout="@layout/preference_info" android:layout="@layout/preference_with_descr"
android:persistent="false" android:persistent="false"
android:selectable="false" android:selectable="false"
android:title="@string/plugin_global_prefs_info" android:title="@string/plugin_global_prefs_info"
@ -34,7 +34,7 @@
<Preference <Preference
android:key="osm_edits_description" android:key="osm_edits_description"
android:layout="@layout/preference_info" android:layout="@layout/preference_description"
android:persistent="false" android:persistent="false"
android:selectable="false" android:selectable="false"
android:title="@string/osm_edits_view_descr" /> android:title="@string/osm_edits_view_descr" />

View file

@ -7,6 +7,7 @@ import android.support.annotation.NonNull;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.settings.BaseSettingsFragment; import net.osmand.plus.settings.BaseSettingsFragment;
@ -27,6 +28,16 @@ public class AccessibilityPlugin extends OsmandPlugin {
public AccessibilityPlugin(OsmandApplication app) { public AccessibilityPlugin(OsmandApplication app) {
this.app = app; this.app = app;
OsmandSettings settings = app.getSettings();
pluginPreferences.add(settings.ACCESSIBILITY_MODE);
pluginPreferences.add(settings.SPEECH_RATE);
pluginPreferences.add(settings.ACCESSIBILITY_SMART_AUTOANNOUNCE);
pluginPreferences.add(settings.ACCESSIBILITY_AUTOANNOUNCE_PERIOD);
pluginPreferences.add(settings.DISABLE_OFFROUTE_RECALC);
pluginPreferences.add(settings.DISABLE_WRONG_DIRECTION_RECALC);
pluginPreferences.add(settings.DIRECTION_STYLE);
pluginPreferences.add(settings.DIRECTION_AUDIO_FEEDBACK);
pluginPreferences.add(settings.DIRECTION_HAPTIC_FEEDBACK);
} }
@Override @Override

View file

@ -1,17 +1,25 @@
package net.osmand.access; package net.osmand.access;
import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen; import android.support.v7.preference.PreferenceScreen;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.access.AccessibilityMode; import net.osmand.plus.access.AccessibilityMode;
import net.osmand.plus.access.RelativeDirectionStyle; import net.osmand.plus.access.RelativeDirectionStyle;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
import net.osmand.plus.settings.BaseSettingsFragment; import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.settings.OnPreferenceChanged; import net.osmand.plus.settings.OnPreferenceChanged;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener;
import net.osmand.plus.settings.preferences.ListPreferenceEx; import net.osmand.plus.settings.preferences.ListPreferenceEx;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx; import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
public class AccessibilitySettingsFragment extends BaseSettingsFragment implements OnPreferenceChanged { public class AccessibilitySettingsFragment extends BaseSettingsFragment implements OnPreferenceChanged, CopyAppModePrefsListener, ResetAppModePrefsListener {
private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings"; private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
private static final String RESET_TO_DEFAULT = "reset_to_default"; private static final String RESET_TO_DEFAULT = "reset_to_default";
@ -150,14 +158,49 @@ public class AccessibilitySettingsFragment extends BaseSettingsFragment implemen
} }
} }
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();
if (COPY_PLUGIN_SETTINGS.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
SelectCopyAppModeBottomSheet.showInstance(fragmentManager, this, false, getSelectedAppMode());
}
} else if (RESET_TO_DEFAULT.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
ResetProfilePrefsBottomSheet.showInstance(fragmentManager, prefId, this, false, getSelectedAppMode());
}
}
return super.onPreferenceClick(preference);
}
@Override
public void copyAppModePrefs(ApplicationMode appMode) {
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
app.getSettings().copyProfilePreferences(appMode, getSelectedAppMode(), plugin.getPreferences());
}
}
@Override
public void resetAppModePrefs(ApplicationMode appMode) {
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
app.getSettings().resetProfilePreferences(appMode, plugin.getPreferences());
}
}
private void updateAccessibilityOptions() { private void updateAccessibilityOptions() {
boolean accessibilityEnabled = app.accessibilityEnabledForMode(getSelectedAppMode()); boolean accessibilityEnabled = app.accessibilityEnabledForMode(getSelectedAppMode());
PreferenceScreen screen = getPreferenceScreen(); PreferenceScreen screen = getPreferenceScreen();
if (screen != null) { OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
if (screen != null && plugin != null) {
for (int i = 0; i < screen.getPreferenceCount(); i++) { for (int i = 0; i < screen.getPreferenceCount(); i++) {
Preference preference = screen.getPreference(i); Preference preference = screen.getPreference(i);
String prefId = preference.getKey(); String prefId = preference.getKey();
if (!settings.ACCESSIBILITY_MODE.getId().equals(prefId) && !settings.SPEECH_RATE.getId().equals(prefId)) if (!settings.ACCESSIBILITY_MODE.getId().equals(prefId) && !settings.SPEECH_RATE.getId().equals(prefId)
&& !RESET_TO_DEFAULT.equals(prefId) && !COPY_PLUGIN_SETTINGS.equals(prefId))
preference.setEnabled(accessibilityEnabled); preference.setEnabled(accessibilityEnabled);
} }
} }

View file

@ -171,7 +171,8 @@ public class ConnectedApp implements Comparable<ConnectedApp> {
if (layer != null) { if (layer != null) {
TextInfoWidget control = createWidgetControl(mapActivity, widget.getId()); TextInfoWidget control = createWidgetControl(mapActivity, widget.getId());
widgetControls.put(widget.getId(), control); widgetControls.put(widget.getId(), control);
int menuIconId = AndroidUtils.getDrawableId(mapActivity.getMyApplication(), widget.getMenuIconName()); int iconId = AndroidUtils.getDrawableId(mapActivity.getMyApplication(), widget.getMenuIconName());
int menuIconId = iconId != 0 ? iconId : ContextMenuItem.INVALID_ID;
MapWidgetRegistry.MapWidgetRegInfo widgetInfo = layer.registerSideWidget(control, menuIconId, MapWidgetRegistry.MapWidgetRegInfo widgetInfo = layer.registerSideWidget(control, menuIconId,
widget.getMenuTitle(), "aidl_widget_" + widget.getId(), false, widget.getOrder()); widget.getMenuTitle(), "aidl_widget_" + widget.getId(), false, widget.getOrder());
if (!mapActivity.getMapLayers().getMapWidgetRegistry().isVisible(widgetInfo.key)) { if (!mapActivity.getMapLayers().getMapWidgetRegistry().isVisible(widgetInfo.key)) {

View file

@ -40,6 +40,7 @@ import net.osmand.plus.AppInitializer.AppInitializeListener;
import net.osmand.plus.AppInitializer.InitEvents; import net.osmand.plus.AppInitializer.InitEvents;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.GPXDatabase.GpxDataItem; import net.osmand.plus.GPXDatabase.GpxDataItem;
import net.osmand.plus.GpxSelectionHelper; import net.osmand.plus.GpxSelectionHelper;
@ -318,7 +319,8 @@ public class OsmandAidlApi {
ApplicationMode.regWidgetVisibility(widget.getId(), (ApplicationMode[]) null); ApplicationMode.regWidgetVisibility(widget.getId(), (ApplicationMode[]) null);
TextInfoWidget control = connectedApp.createWidgetControl(mapActivity, widgetId); TextInfoWidget control = connectedApp.createWidgetControl(mapActivity, widgetId);
connectedApp.getWidgetControls().put(widgetId, control); connectedApp.getWidgetControls().put(widgetId, control);
int menuIconId = AndroidUtils.getDrawableId(app, widget.getMenuIconName()); int iconId = AndroidUtils.getDrawableId(app, widget.getMenuIconName());
int menuIconId = iconId != 0 ? iconId : ContextMenuItem.INVALID_ID;
MapWidgetRegInfo widgetInfo = layer.registerSideWidget(control, MapWidgetRegInfo widgetInfo = layer.registerSideWidget(control,
menuIconId, widget.getMenuTitle(), "aidl_widget_" + widgetId, menuIconId, widget.getMenuTitle(), "aidl_widget_" + widgetId,
false, widget.getOrder()); false, widget.getOrder());

View file

@ -57,6 +57,8 @@ public abstract class OsmandPlugin {
private static List<OsmandPlugin> allPlugins = new ArrayList<OsmandPlugin>(); private static List<OsmandPlugin> allPlugins = new ArrayList<OsmandPlugin>();
private static final Log LOG = PlatformUtil.getLog(OsmandPlugin.class); private static final Log LOG = PlatformUtil.getLog(OsmandPlugin.class);
protected List<OsmandSettings.OsmandPreference> pluginPreferences = new ArrayList<>();
private boolean active; private boolean active;
private String installURL = null; private String installURL = null;
@ -81,6 +83,10 @@ public abstract class OsmandPlugin {
return null; return null;
} }
public List<OsmandSettings.OsmandPreference> getPreferences() {
return pluginPreferences;
}
public String getPrefsDescription() { public String getPrefsDescription() {
return null; return null;
} }
@ -628,4 +634,46 @@ public abstract class OsmandPlugin {
p.addMyPlacesTab(favoritesActivity, mTabs, intent); p.addMyPlacesTab(favoritesActivity, mTabs, intent);
} }
} }
protected OsmandSettings.CommonPreference<Boolean> registerBooleanPreference(OsmandApplication app, String prefId, boolean defValue) {
OsmandSettings.CommonPreference<Boolean> preference = app.getSettings().registerBooleanPreference(prefId, defValue);
pluginPreferences.add(preference);
return preference;
}
private OsmandSettings.CommonPreference<Boolean> registerBooleanAccessibilityPreference(OsmandApplication app, String prefId, boolean defValue) {
OsmandSettings.CommonPreference<Boolean> preference = app.getSettings().registerBooleanAccessibilityPreference(prefId, defValue);
pluginPreferences.add(preference);
return preference;
}
protected OsmandSettings.CommonPreference<String> registerStringPreference(OsmandApplication app, String prefId, String defValue) {
OsmandSettings.CommonPreference<String> preference = app.getSettings().registerStringPreference(prefId, defValue);
pluginPreferences.add(preference);
return preference;
}
protected OsmandSettings.CommonPreference<Integer> registerIntPreference(OsmandApplication app, String prefId, int defValue) {
OsmandSettings.CommonPreference<Integer> preference = app.getSettings().registerIntPreference(prefId, defValue);
pluginPreferences.add(preference);
return preference;
}
protected OsmandSettings.CommonPreference<Long> registerLongPreference(OsmandApplication app, String prefId, long defValue) {
OsmandSettings.CommonPreference<Long> preference = app.getSettings().registerLongPreference(prefId, defValue);
pluginPreferences.add(preference);
return preference;
}
protected OsmandSettings.CommonPreference<Float> registerFloatPreference(OsmandApplication app, String prefId, float defValue) {
OsmandSettings.CommonPreference<Float> preference = app.getSettings().registerFloatPreference(prefId, defValue);
pluginPreferences.add(preference);
return preference;
}
protected <T extends Enum> OsmandSettings.CommonPreference<T> registerEnumIntPreference(OsmandApplication app, String prefId, Enum defaultValue, Enum[] values, Class<T> clz) {
OsmandSettings.CommonPreference<T> preference = app.getSettings().registerEnumIntPreference(prefId, defaultValue, values, clz);
pluginPreferences.add(preference);
return preference;
}
} }

View file

@ -410,11 +410,14 @@ public class OsmandSettings {
} }
public boolean copyPreferencesFromProfile(ApplicationMode modeFrom, ApplicationMode modeTo) { public boolean copyPreferencesFromProfile(ApplicationMode modeFrom, ApplicationMode modeTo) {
return copyProfilePreferences(modeFrom, modeTo, new ArrayList<OsmandPreference>(registeredPreferences.values()));
}
public boolean copyProfilePreferences(ApplicationMode modeFrom, ApplicationMode modeTo, List<OsmandPreference> profilePreferences) {
SettingsEditor settingsEditor = settingsAPI.edit(getProfilePreferences(modeTo)); SettingsEditor settingsEditor = settingsAPI.edit(getProfilePreferences(modeTo));
for (OsmandPreference pref : registeredPreferences.values()) { for (OsmandPreference pref : profilePreferences) {
if (pref instanceof CommonPreference && !((CommonPreference) pref).global) { if (pref instanceof CommonPreference && !((CommonPreference) pref).global) {
CommonPreference profilePref = (CommonPreference) pref; CommonPreference profilePref = (CommonPreference) pref;
if (profilePref.isSetForMode(modeFrom) || profilePref.hasDefaultValueForMode(modeFrom)) {
Object copiedValue = profilePref.getModeValue(modeFrom); Object copiedValue = profilePref.getModeValue(modeFrom);
if (copiedValue instanceof String) { if (copiedValue instanceof String) {
settingsEditor.putString(pref.getId(), (String) copiedValue); settingsEditor.putString(pref.getId(), (String) copiedValue);
@ -427,9 +430,6 @@ public class OsmandSettings {
} else if (copiedValue instanceof Long) { } else if (copiedValue instanceof Long) {
settingsEditor.putLong(pref.getId(), (Long) copiedValue); settingsEditor.putLong(pref.getId(), (Long) copiedValue);
} }
} else {
settingsEditor.remove(pref.getId());
}
} }
} }
return settingsEditor.commit(); return settingsEditor.commit();
@ -439,6 +439,16 @@ public class OsmandSettings {
return settingsAPI.edit(getProfilePreferences(mode)).clear().commit(); return settingsAPI.edit(getProfilePreferences(mode)).clear().commit();
} }
public boolean resetProfilePreferences(ApplicationMode mode, List<OsmandPreference> profilePreferences) {
SettingsEditor settingsEditor = settingsAPI.edit(getProfilePreferences(mode));
for (OsmandPreference pref : profilePreferences) {
if (pref instanceof CommonPreference && !((CommonPreference) pref).global) {
settingsEditor.remove(pref.getId());
}
}
return settingsEditor.commit();
}
public ApplicationMode LAST_ROUTING_APPLICATION_MODE = null; public ApplicationMode LAST_ROUTING_APPLICATION_MODE = null;
// this value string is synchronized with settings_pref.xml preference name // this value string is synchronized with settings_pref.xml preference name
@ -1107,6 +1117,16 @@ public class OsmandSettings {
return p; return p;
} }
@SuppressWarnings("unchecked")
public CommonPreference<Boolean> registerBooleanAccessibilityPreference(String id, boolean defValue) {
if (registeredPreferences.containsKey(id)) {
return (CommonPreference<Boolean>) registeredPreferences.get(id);
}
BooleanPreference p = new BooleanAccessibilityPreference(id, defValue);
registeredPreferences.put(id, p);
return p;
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public CommonPreference<String> registerStringPreference(String id, String defValue) { public CommonPreference<String> registerStringPreference(String id, String defValue) {
if (registeredPreferences.containsKey(id)) { if (registeredPreferences.containsKey(id)) {
@ -1147,6 +1167,16 @@ public class OsmandSettings {
return p; return p;
} }
@SuppressWarnings("unchecked")
public <T extends Enum> CommonPreference<T> registerEnumIntPreference(String id, Enum defaultValue, Enum[] values, Class<T> clz) {
if (registeredPreferences.containsKey(id)) {
return (CommonPreference<T>) registeredPreferences.get(id);
}
EnumIntPreference p = new EnumIntPreference(id, defaultValue, values);
registeredPreferences.put(id, p);
return p;
}
public final CommonPreference<RulerMode> RULER_MODE = new EnumIntPreference<>("ruler_mode", RulerMode.FIRST, RulerMode.values()).makeGlobal(); public final CommonPreference<RulerMode> RULER_MODE = new EnumIntPreference<>("ruler_mode", RulerMode.FIRST, RulerMode.values()).makeGlobal();
public final OsmandPreference<Boolean> SHOW_COMPASS_CONTROL_RULER = new BooleanPreference("show_compass_ruler", true).makeGlobal(); public final OsmandPreference<Boolean> SHOW_COMPASS_CONTROL_RULER = new BooleanPreference("show_compass_ruler", true).makeGlobal();

View file

@ -51,7 +51,6 @@ import net.osmand.plus.ContextMenuAdapter.ItemClickListener;
import net.osmand.plus.ContextMenuItem; import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandSettings.OsmandPreference; import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.R; import net.osmand.plus.R;
@ -537,27 +536,26 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
public AudioVideoNotesPlugin(OsmandApplication app) { public AudioVideoNotesPlugin(OsmandApplication app) {
this.app = app; this.app = app;
OsmandSettings settings = app.getSettings();
ApplicationMode.regWidgetVisibility("audionotes", (ApplicationMode[]) null); ApplicationMode.regWidgetVisibility("audionotes", (ApplicationMode[]) null);
AV_EXTERNAL_RECORDER = settings.registerBooleanPreference("av_external_recorder", false); AV_EXTERNAL_RECORDER = registerBooleanPreference(app, "av_external_recorder", false);
AV_EXTERNAL_PHOTO_CAM = settings.registerBooleanPreference("av_external_cam", true); AV_EXTERNAL_PHOTO_CAM = registerBooleanPreference(app, "av_external_cam", true);
AV_VIDEO_FORMAT = settings.registerIntPreference("av_video_format", VIDEO_OUTPUT_MP4); AV_VIDEO_FORMAT = registerIntPreference(app, "av_video_format", VIDEO_OUTPUT_MP4);
AV_VIDEO_QUALITY = settings.registerIntPreference("av_video_quality", VIDEO_QUALITY_DEFAULT); AV_VIDEO_QUALITY = registerIntPreference(app, "av_video_quality", VIDEO_QUALITY_DEFAULT);
AV_AUDIO_FORMAT = settings.registerIntPreference("av_audio_format", AUDIO_FORMAT_DEFAULT); AV_AUDIO_FORMAT = registerIntPreference(app, "av_audio_format", AUDIO_FORMAT_DEFAULT);
AV_AUDIO_BITRATE = settings.registerIntPreference("av_audio_bitrate", AUDIO_BITRATE_DEFAULT); AV_AUDIO_BITRATE = registerIntPreference(app, "av_audio_bitrate", AUDIO_BITRATE_DEFAULT);
AV_DEFAULT_ACTION = settings.registerIntPreference("av_default_action", AV_DEFAULT_ACTION_CHOOSE); AV_DEFAULT_ACTION = registerIntPreference(app, "av_default_action", AV_DEFAULT_ACTION_CHOOSE);
// camera picture size: // camera picture size:
AV_CAMERA_PICTURE_SIZE = settings.registerIntPreference("av_camera_picture_size", AV_PHOTO_SIZE_DEFAULT); AV_CAMERA_PICTURE_SIZE = registerIntPreference(app, "av_camera_picture_size", AV_PHOTO_SIZE_DEFAULT);
// camera focus type: // camera focus type:
AV_CAMERA_FOCUS_TYPE = settings.registerIntPreference("av_camera_focus_type", AV_CAMERA_FOCUS_AUTO); AV_CAMERA_FOCUS_TYPE = registerIntPreference(app, "av_camera_focus_type", AV_CAMERA_FOCUS_AUTO);
// camera sound: // camera sound:
AV_PHOTO_PLAY_SOUND = settings.registerBooleanPreference("av_photo_play_sound", true); AV_PHOTO_PLAY_SOUND = registerBooleanPreference(app, "av_photo_play_sound", true);
SHOW_RECORDINGS = settings.registerBooleanPreference("show_recordings", true); SHOW_RECORDINGS = registerBooleanPreference(app, "show_recordings", true);
AV_RECORDER_SPLIT = settings.registerBooleanPreference("av_recorder_split", false); AV_RECORDER_SPLIT = registerBooleanPreference(app, "av_recorder_split", false);
AV_RS_CLIP_LENGTH = settings.registerIntPreference("av_rs_clip_length", CLIP_LENGTH_DEFAULT); AV_RS_CLIP_LENGTH = registerIntPreference(app, "av_rs_clip_length", CLIP_LENGTH_DEFAULT);
AV_RS_STORAGE_SIZE = settings.registerIntPreference("av_rs_storage_size", STORAGE_SIZE_DEFAULT); AV_RS_STORAGE_SIZE = registerIntPreference(app, "av_rs_storage_size", STORAGE_SIZE_DEFAULT);
} }
@Override @Override

View file

@ -1,29 +1,47 @@
package net.osmand.plus.audionotes; package net.osmand.plus.audionotes;
import android.Manifest;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LayerDrawable;
import android.hardware.Camera; import android.hardware.Camera;
import android.media.CamcorderProfile; import android.media.CamcorderProfile;
import android.media.MediaRecorder; import android.media.MediaRecorder;
import android.os.Build; import android.os.Build;
import android.os.StatFs; import android.os.StatFs;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
import android.text.SpannableString;
import android.view.View;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil; import net.osmand.PlatformUtil;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndAppCustomization; import net.osmand.plus.OsmAndAppCustomization;
import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
import net.osmand.plus.settings.BaseSettingsFragment; import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener;
import net.osmand.plus.settings.preferences.ListPreferenceEx; import net.osmand.plus.settings.preferences.ListPreferenceEx;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx; import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.plus.widgets.style.CustomTypefaceSpan;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import java.io.File; import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Locale;
import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AUDIO_BITRATE_DEFAULT; import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AUDIO_BITRATE_DEFAULT;
import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_AUTO; import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_AUTO;
@ -35,10 +53,13 @@ import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_M
import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.NOTES_TAB; import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.NOTES_TAB;
import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.cameraPictureSizeDefault; import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.cameraPictureSizeDefault;
public class MultimediaNotesFragment extends BaseSettingsFragment { public class MultimediaNotesFragment extends BaseSettingsFragment implements CopyAppModePrefsListener, ResetAppModePrefsListener {
public static final int CAMERA_FOR_PHOTO_PARAMS_REQUEST_CODE = 104;
private static final Log log = PlatformUtil.getLog(MultimediaNotesFragment.class); private static final Log log = PlatformUtil.getLog(MultimediaNotesFragment.class);
private static final String CAMERA_PERMISSION = "camera_permission";
private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings"; private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
private static final String RESET_TO_DEFAULT = "reset_to_default"; private static final String RESET_TO_DEFAULT = "reset_to_default";
private static final String OPEN_NOTES = "open_notes"; private static final String OPEN_NOTES = "open_notes";
@ -46,17 +67,8 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
@Override @Override
protected void setupPreferences() { protected void setupPreferences() {
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class); AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
if (plugin != null) { if (plugin != null) {
setupCameraPhotoPrefs(plugin);
Camera cam = openCamera();
if (cam != null) {
setupExternalPhotoCamPref(plugin);
setupCameraPictureSizePref(cam, plugin);
setupCameraFocusTypePref(cam, plugin);
setupPhotoPlaySoundPref(plugin);
cam.release();
}
setupAudioFormatPref(plugin); setupAudioFormatPref(plugin);
setupAudioBitratePref(plugin); setupAudioBitratePref(plugin);
@ -76,13 +88,44 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
} }
} }
private void setupExternalPhotoCamPref(AudioVideoNotesPlugin plugin) { private void setupCameraPhotoPrefs(AudioVideoNotesPlugin plugin) {
Camera cam = openCamera();
setupCameraPermissionPref(cam);
setupExternalPhotoCamPref(cam, plugin);
setupCameraPictureSizePref(cam, plugin);
setupCameraFocusTypePref(cam, plugin);
setupPhotoPlaySoundPref(cam, plugin);
if (cam != null) {
cam.release();
}
}
private void setupCameraPermissionPref(Camera cam) {
Context ctx = getContext();
if (ctx == null) {
return;
}
Preference cameraPermission = findPreference(CAMERA_PERMISSION);
boolean permissionGranted = ActivityCompat.checkSelfPermission(ctx, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED;
cameraPermission.setVisible(cam == null && !permissionGranted);
}
private void setupExternalPhotoCamPref(Camera cam, AudioVideoNotesPlugin plugin) {
SwitchPreferenceEx externalPhotoCam = (SwitchPreferenceEx) findPreference(plugin.AV_EXTERNAL_PHOTO_CAM.getId()); SwitchPreferenceEx externalPhotoCam = (SwitchPreferenceEx) findPreference(plugin.AV_EXTERNAL_PHOTO_CAM.getId());
externalPhotoCam.setDescription(getString(R.string.av_use_external_camera_descr)); externalPhotoCam.setDescription(getString(R.string.av_use_external_camera_descr));
externalPhotoCam.setIcon(getActiveIcon(R.drawable.ic_action_photo_dark)); externalPhotoCam.setIcon(getActiveIcon(R.drawable.ic_action_photo_dark));
externalPhotoCam.setEnabled(cam != null);
} }
private void setupCameraPictureSizePref(Camera cam, AudioVideoNotesPlugin plugin) { private void setupCameraPictureSizePref(Camera cam, AudioVideoNotesPlugin plugin) {
ListPreferenceEx cameraPictureSize = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_PICTURE_SIZE.getId());
cameraPictureSize.setDescription(R.string.av_camera_pic_size_descr);
cameraPictureSize.setIcon(getActiveIcon(R.drawable.ic_action_picture_size));
if (cam == null) {
cameraPictureSize.setEnabled(false);
return;
}
Camera.Parameters parameters = cam.getParameters(); Camera.Parameters parameters = cam.getParameters();
// Photo picture size // Photo picture size
@ -138,18 +181,24 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
String[] entries = itemsPicSizes.toArray(new String[0]); String[] entries = itemsPicSizes.toArray(new String[0]);
Integer[] entryValues = picSizesValues.toArray(new Integer[0]); Integer[] entryValues = picSizesValues.toArray(new Integer[0]);
ListPreferenceEx cameraPictureSize = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_PICTURE_SIZE.getId());
if (entries.length > 0) { if (entries.length > 0) {
cameraPictureSize.setEntries(entries); cameraPictureSize.setEntries(entries);
cameraPictureSize.setEntryValues(entryValues); cameraPictureSize.setEntryValues(entryValues);
cameraPictureSize.setDescription(R.string.av_camera_pic_size_descr);
cameraPictureSize.setIcon(getActiveIcon(R.drawable.ic_action_picture_size));
} else { } else {
cameraPictureSize.setVisible(false); cameraPictureSize.setVisible(false);
} }
} }
private void setupCameraFocusTypePref(Camera cam, AudioVideoNotesPlugin plugin) { private void setupCameraFocusTypePref(Camera cam, AudioVideoNotesPlugin plugin) {
ListPreferenceEx cameraFocusType = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_FOCUS_TYPE.getId());
cameraFocusType.setDescription(R.string.av_camera_focus_descr);
cameraFocusType.setIcon(getActiveIcon(R.drawable.ic_action_camera_focus));
if (cam == null) {
cameraFocusType.setEnabled(false);
return;
}
Camera.Parameters parameters = cam.getParameters(); Camera.Parameters parameters = cam.getParameters();
// focus mode settings // focus mode settings
@ -183,21 +232,19 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
String[] entries = items.toArray(new String[0]); String[] entries = items.toArray(new String[0]);
Integer[] entryValues = itemsValues.toArray(new Integer[0]); Integer[] entryValues = itemsValues.toArray(new Integer[0]);
ListPreferenceEx cameraFocusType = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_FOCUS_TYPE.getId());
if (entries.length > 0) { if (entries.length > 0) {
cameraFocusType.setEntries(entries); cameraFocusType.setEntries(entries);
cameraFocusType.setEntryValues(entryValues); cameraFocusType.setEntryValues(entryValues);
cameraFocusType.setDescription(R.string.av_camera_focus_descr);
cameraFocusType.setIcon(getActiveIcon(R.drawable.ic_action_camera_focus));
} else { } else {
cameraFocusType.setVisible(false); cameraFocusType.setVisible(false);
} }
} }
private void setupPhotoPlaySoundPref(AudioVideoNotesPlugin plugin) { private void setupPhotoPlaySoundPref(Camera cam, AudioVideoNotesPlugin plugin) {
SwitchPreferenceEx photoPlaySound = (SwitchPreferenceEx) findPreference(plugin.AV_PHOTO_PLAY_SOUND.getId()); SwitchPreferenceEx photoPlaySound = (SwitchPreferenceEx) findPreference(plugin.AV_PHOTO_PLAY_SOUND.getId());
photoPlaySound.setDescription(getString(R.string.av_photo_play_sound_descr)); photoPlaySound.setDescription(getString(R.string.av_photo_play_sound_descr));
photoPlaySound.setIcon(getContentIcon(R.drawable.ic_action_music_off)); photoPlaySound.setIcon(getContentIcon(R.drawable.ic_action_music_off));
photoPlaySound.setEnabled(cam != null);
} }
private void setupAudioFormatPref(AudioVideoNotesPlugin plugin) { private void setupAudioFormatPref(AudioVideoNotesPlugin plugin) {
@ -319,14 +366,23 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
storageSize.setEntries(entries); storageSize.setEntries(entries);
storageSize.setEntryValues(entryValues); storageSize.setEntryValues(entryValues);
storageSize.setDescription(R.string.rec_split_storage_size_desc); storageSize.setDescription(R.string.rec_split_storage_size_desc);
storageSize.setIcon(getContentIcon(R.drawable.ic_sdcard));
} else { } else {
storageSize.setVisible(false); storageSize.setVisible(false);
} }
} }
private void setupOpenNotesDescrPref() { private void setupOpenNotesDescrPref() {
Preference nameAndPasswordPref = findPreference("open_notes_description"); String multimediaNotesPath = getString(R.string.multimedia_notes_view_path);
nameAndPasswordPref.setTitle(getText(R.string.multimedia_notes_view_descr)); String multimediaNotesPathDescr = getString(R.string.multimedia_notes_view_descr, multimediaNotesPath);
int startIndex = multimediaNotesPathDescr.indexOf(multimediaNotesPath);
SpannableString titleSpan = new SpannableString(multimediaNotesPathDescr);
Typeface typeface = FontCache.getRobotoMedium(getContext());
titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + multimediaNotesPath.length(), 0);
Preference osmEditsDescription = findPreference("open_notes_description");
osmEditsDescription.setTitle(titleSpan);
} }
private void setupOpenNotesPref() { private void setupOpenNotesPref() {
@ -346,13 +402,26 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
if (OPEN_NOTES.equals(preference.getKey())) { String prefId = preference.getKey();
if (OPEN_NOTES.equals(prefId)) {
OsmAndAppCustomization appCustomization = app.getAppCustomization(); OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity()); Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
app.getSettings().FAVORITES_TAB.set(NOTES_TAB); app.getSettings().FAVORITES_TAB.set(NOTES_TAB);
startActivity(favorites); startActivity(favorites);
return true; return true;
} else if (COPY_PLUGIN_SETTINGS.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
SelectCopyAppModeBottomSheet.showInstance(fragmentManager, this, false, getSelectedAppMode());
}
} else if (RESET_TO_DEFAULT.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
ResetProfilePrefsBottomSheet.showInstance(fragmentManager, prefId, this, false, getSelectedAppMode());
}
} else if (CAMERA_PERMISSION.equals(prefId)) {
requestPermissions(new String[] {Manifest.permission.CAMERA}, CAMERA_FOR_PHOTO_PARAMS_REQUEST_CODE);
} }
return super.onPreferenceClick(preference); return super.onPreferenceClick(preference);
} }
@ -365,4 +434,55 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
return null; return null;
} }
} }
@Override
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {
super.onBindPreferenceViewHolder(preference, holder);
if (CAMERA_PERMISSION.equals(preference.getKey())) {
View selectableView = holder.itemView.findViewById(R.id.selectable_list_item);
if (selectableView != null) {
int color = AndroidUtils.getColorFromAttr(app, R.attr.activity_background_color);
int selectedColor = UiUtilities.getColorWithAlpha(getActiveProfileColor(), 0.3f);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
Drawable bgDrawable = getPaintedIcon(R.drawable.rectangle_rounded, color);
Drawable selectable = getPaintedIcon(R.drawable.ripple_rectangle_rounded, selectedColor);
Drawable[] layers = {bgDrawable, selectable};
AndroidUtils.setBackground(selectableView, new LayerDrawable(layers));
} else {
Drawable bgDrawable = getPaintedIcon(R.drawable.rectangle_rounded, color);
AndroidUtils.setBackground(selectableView, bgDrawable);
}
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == CAMERA_FOR_PHOTO_PARAMS_REQUEST_CODE && grantResults.length > 0
&& permissions.length > 0 && Manifest.permission.CAMERA.equals(permissions[0])) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
updateAllSettings();
} else {
app.showToastMessage(R.string.no_camera_permission);
}
}
}
@Override
public void copyAppModePrefs(ApplicationMode appMode) {
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
if (plugin != null) {
app.getSettings().copyProfilePreferences(appMode, getSelectedAppMode(), plugin.getPreferences());
}
}
@Override
public void resetAppModePrefs(ApplicationMode appMode) {
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
if (plugin != null) {
app.getSettings().resetProfilePreferences(appMode, plugin.getPreferences());
}
}
} }

View file

@ -55,6 +55,11 @@ public class SimpleBottomSheetItem extends BaseBottomSheetItem {
iconView.setImageDrawable(icon); iconView.setImageDrawable(icon);
} }
public void setTitleColorId(@ColorRes int titleColorId) {
this.titleColorId = titleColorId;
titleTv.setTextColor(ContextCompat.getColor(titleTv.getContext(), titleColorId));
}
@Override @Override
public void inflate(Context context, ViewGroup container, boolean nightMode) { public void inflate(Context context, ViewGroup container, boolean nightMode) {
super.inflate(context, container, nightMode); super.inflate(context, container, nightMode);

View file

@ -0,0 +1,225 @@
package net.osmand.plus.development;
import android.content.Intent;
import android.os.Debug;
import android.support.v7.preference.Preference;
import net.osmand.plus.OsmAndLocationSimulation;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.render.NativeOsmandLibrary;
import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.util.SunriseSunset;
import java.text.SimpleDateFormat;
public class DevelopmentSettingsFragment extends BaseSettingsFragment {
private static final String SIMULATE_INITIAL_STARTUP = "simulate_initial_startup";
private static final String SIMULATE_YOUR_LOCATION = "simulate_your_location";
private static final String AGPS_DATA_DOWNLOADED = "agps_data_downloaded";
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private Runnable updateSimulationTitle;
@Override
protected void setupPreferences() {
Preference developmentInfo = findPreference("development_info");
developmentInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
Preference routingCategory = findPreference("routing");
routingCategory.setIconSpaceReserved(false);
setupOpenglRenderPref();
setupSafeModePref();
setupDisableComplexRoutingPref();
setupFastRecalculationPref();
setupOsmLiveForRoutingPref();
setupOsmLiveForPublicTransportPref();
setupSimulateYourLocationPref();
Preference debuggingAndDevelopment = findPreference("debugging_and_development");
debuggingAndDevelopment.setIconSpaceReserved(false);
setupDebugRenderingInfoPref();
setupSimulateInitialStartupPref();
setupShouldShowFreeVersionBannerPref();
setupTestVoiceCommandsPref();
setupLogcatBufferPref();
Preference info = findPreference("info");
info.setIconSpaceReserved(false);
setupGlobalAppAllocatedMemoryPref();
setupNativeAppAllocatedMemoryPref();
setupAgpsDataDownloadedPref();
setupDayNightInfoPref();
}
private void setupOpenglRenderPref() {
SwitchPreferenceEx useOpenglRender = (SwitchPreferenceEx) findPreference(settings.USE_OPENGL_RENDER.getId());
useOpenglRender.setDescription(getString(R.string.use_opengl_render_descr));
useOpenglRender.setIconSpaceReserved(false);
}
private void setupSafeModePref() {
SwitchPreferenceEx safeMode = (SwitchPreferenceEx) findPreference(settings.SAFE_MODE.getId());
if (!Version.isBlackberry(app)) {
safeMode.setDescription(getString(R.string.safe_mode_description));
safeMode.setIconSpaceReserved(false);
// disable the switch if the library cannot be used
if ((NativeOsmandLibrary.isLoaded() && !NativeOsmandLibrary.isSupported()) || settings.NATIVE_RENDERING_FAILED.get()) {
safeMode.setEnabled(false);
safeMode.setChecked(true);
}
} else {
safeMode.setVisible(false);
}
}
private void setupDisableComplexRoutingPref() {
SwitchPreferenceEx disableComplexRouting = (SwitchPreferenceEx) findPreference(settings.DISABLE_COMPLEX_ROUTING.getId());
disableComplexRouting.setDescription(getString(R.string.disable_complex_routing_descr));
disableComplexRouting.setIconSpaceReserved(false);
}
private void setupFastRecalculationPref() {
SwitchPreferenceEx useFastRecalculation = (SwitchPreferenceEx) findPreference(settings.USE_FAST_RECALCULATION.getId());
useFastRecalculation.setDescription(getString(R.string.use_fast_recalculation_desc));
useFastRecalculation.setIconSpaceReserved(false);
}
private void setupOsmLiveForRoutingPref() {
SwitchPreferenceEx useOsmLiveForRouting = (SwitchPreferenceEx) findPreference(settings.USE_OSM_LIVE_FOR_ROUTING.getId());
useOsmLiveForRouting.setDescription(getString(R.string.use_osm_live_routing_description));
useOsmLiveForRouting.setIconSpaceReserved(false);
}
private void setupOsmLiveForPublicTransportPref() {
SwitchPreferenceEx useOsmLiveForPublicTransport = (SwitchPreferenceEx) findPreference(settings.USE_OSM_LIVE_FOR_PUBLIC_TRANSPORT.getId());
useOsmLiveForPublicTransport.setDescription(getString(R.string.use_osm_live_public_transport_description));
useOsmLiveForPublicTransport.setIconSpaceReserved(false);
}
private void setupSimulateYourLocationPref() {
final Preference simulateYourLocation = findPreference(SIMULATE_YOUR_LOCATION);
simulateYourLocation.setIconSpaceReserved(false);
final OsmAndLocationSimulation sim = app.getLocationProvider().getLocationSimulation();
updateSimulationTitle = new Runnable() {
@Override
public void run() {
simulateYourLocation.setSummary(sim.isRouteAnimating() ?
R.string.simulate_your_location_stop_descr : R.string.simulate_your_location_gpx_descr);
}
};
updateSimulationTitle.run();
}
private void setupDebugRenderingInfoPref() {
SwitchPreferenceEx debugRenderingInfo = (SwitchPreferenceEx) findPreference(settings.DEBUG_RENDERING_INFO.getId());
debugRenderingInfo.setDescription(getString(R.string.trace_rendering_descr));
debugRenderingInfo.setIconSpaceReserved(false);
}
private void setupSimulateInitialStartupPref() {
Preference simulateInitialStartup = findPreference(SIMULATE_INITIAL_STARTUP);
simulateInitialStartup.setIconSpaceReserved(false);
}
private void setupShouldShowFreeVersionBannerPref() {
SwitchPreferenceEx shouldShowFreeVersionBanner = (SwitchPreferenceEx) findPreference(settings.SHOULD_SHOW_FREE_VERSION_BANNER.getId());
shouldShowFreeVersionBanner.setDescription(getString(R.string.show_free_version_banner_description));
shouldShowFreeVersionBanner.setIconSpaceReserved(false);
}
private void setupTestVoiceCommandsPref() {
Preference testVoiceCommands = findPreference("test_voice_commands");
testVoiceCommands.setIntent(new Intent(getActivity(), TestVoiceActivity.class));
testVoiceCommands.setIconSpaceReserved(false);
}
private void setupLogcatBufferPref() {
Preference logcatBuffer = findPreference("logcat_buffer");
logcatBuffer.setIntent(new Intent(getActivity(), LogcatActivity.class));
logcatBuffer.setIconSpaceReserved(false);
}
private void setupGlobalAppAllocatedMemoryPref() {
long javaAvailMem = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / (1024 * 1024L);
long javaTotal = Runtime.getRuntime().totalMemory() / (1024 * 1024L);
long dalvikSize = android.os.Debug.getNativeHeapAllocatedSize() / (1024 * 1024L);
Preference globalAppAllocatedMemory = findPreference("global_app_allocated_memory");
globalAppAllocatedMemory.setSummary(getString(R.string.global_app_allocated_memory_descr, javaAvailMem, javaTotal, dalvikSize));
globalAppAllocatedMemory.setIconSpaceReserved(false);
}
private void setupNativeAppAllocatedMemoryPref() {
// ActivityManager activityManager = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
// ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
// activityManager.getMemoryInfo(memoryInfo);
// long totalSize = memoryInfo.availMem / (1024*1024l);
Debug.MemoryInfo mem = new Debug.MemoryInfo();
Debug.getMemoryInfo(mem);
//setEnabled(false) creates bad readability on some devices
//pref.setEnabled(false);
Preference nativeAppAllocatedMemory = findPreference("native_app_allocated_memory");
nativeAppAllocatedMemory.setIconSpaceReserved(false);
nativeAppAllocatedMemory.setSummary(getString(R.string.native_app_allocated_memory_descr
, mem.nativePrivateDirty / 1024, mem.dalvikPrivateDirty / 1024, mem.otherPrivateDirty / 1024
, mem.nativePss / 1024, mem.dalvikPss / 1024, mem.otherPss / 1024));
}
private void setupAgpsDataDownloadedPref() {
Preference agpsDataDownloaded = findPreference("agps_data_downloaded");
agpsDataDownloaded.setSummary(getAgpsDataDownloadedSummary());
agpsDataDownloaded.setIconSpaceReserved(false);
}
private String getAgpsDataDownloadedSummary() {
if (settings.AGPS_DATA_LAST_TIME_DOWNLOADED.get() != 0L) {
return getString(R.string.agps_data_last_downloaded, DATE_FORMAT.format(settings.AGPS_DATA_LAST_TIME_DOWNLOADED.get()));
} else {
return getString(R.string.agps_data_last_downloaded, "--");
}
}
private void setupDayNightInfoPref() {
Preference dayNightInfo = findPreference("day_night_info");
SunriseSunset sunriseSunset = app.getDaynightHelper().getSunriseSunset();
String sunrise = sunriseSunset != null ? DATE_FORMAT.format(sunriseSunset.getSunrise()) : "null";
String sunset = sunriseSunset != null ? DATE_FORMAT.format(sunriseSunset.getSunset()) : "null";
dayNightInfo.setSummary(getString(R.string.day_night_info_description, sunrise, sunset));
dayNightInfo.setIconSpaceReserved(false);
}
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();
if (SIMULATE_YOUR_LOCATION.equals(prefId)) {
updateSimulationTitle.run();
OsmAndLocationSimulation sim = app.getLocationProvider().getLocationSimulation();
sim.startStopRouteAnimation(getActivity(), true, updateSimulationTitle);
return true;
} else if (SIMULATE_INITIAL_STARTUP.equals(prefId)) {
app.getAppInitializer().resetFirstTimeRun();
settings.FIRST_MAP_IS_DOWNLOADED.set(false);
settings.MAPILLARY_FIRST_DIALOG_SHOWN.set(false);
settings.WEBGL_SUPPORTED.set(true);
settings.WIKI_ARTICLE_SHOW_IMAGES_ASKED.set(false);
app.showToastMessage(R.string.shared_string_ok);
return true;
} else if (AGPS_DATA_DOWNLOADED.equals(prefId)) {
if (settings.isInternetConnectionAvailable(true)) {
app.getLocationProvider().redownloadAGPS();
preference.setSummary(getAgpsDataDownloadedSummary());
}
return true;
}
return super.onPreferenceClick(preference);
}
}

View file

@ -125,6 +125,11 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
return SettingsDevelopmentActivity.class; return SettingsDevelopmentActivity.class;
} }
@Override
public Class<? extends BaseSettingsFragment> getSettingsFragment() {
return DevelopmentSettingsFragment.class;
}
@Override @Override
public int getLogoResourceId() { public int getLogoResourceId() {
return R.drawable.ic_plugin_developer; return R.drawable.ic_plugin_developer;

View file

@ -1,17 +1,29 @@
package net.osmand.plus.monitoring; package net.osmand.plus.monitoring;
import android.content.Intent; import android.content.Intent;
import android.graphics.Typeface;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndAppCustomization; import net.osmand.plus.OsmAndAppCustomization;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.myplaces.FavoritesActivity; import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
import net.osmand.plus.settings.BaseSettingsFragment; import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet; import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet;
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.preferences.ListPreferenceEx; import net.osmand.plus.settings.preferences.ListPreferenceEx;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx; import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.plus.widgets.style.CustomTypefaceSpan;
import java.io.Serializable; import java.io.Serializable;
@ -21,7 +33,7 @@ import static net.osmand.plus.OsmandSettings.REC_DIRECTORY;
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS;
public class MonitoringSettingsFragment extends BaseSettingsFragment { public class MonitoringSettingsFragment extends BaseSettingsFragment implements CopyAppModePrefsListener, ResetAppModePrefsListener {
private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings"; private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
private static final String RESET_TO_DEFAULT = "reset_to_default"; private static final String RESET_TO_DEFAULT = "reset_to_default";
@ -37,8 +49,10 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
setupSaveTrackMinSpeedPref(); setupSaveTrackMinSpeedPref();
setupAutoSplitRecordingPref(); setupAutoSplitRecordingPref();
setupDisableRecordingOnceAppKilledPref(); setupDisableRecordingOnceAppKilledPref();
setupSaveHeadingToGpxPref();
setupTrackStorageDirectoryPref(); setupTrackStorageDirectoryPref();
setupShowTripRecNotificationPref();
setupLiveMonitoringPref(); setupLiveMonitoringPref();
setupOpenNotesDescrPref(); setupOpenNotesDescrPref();
@ -87,7 +101,14 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
ListPreferenceEx saveTrackMinDistance = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_DISTANCE.getId()); ListPreferenceEx saveTrackMinDistance = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_DISTANCE.getId());
saveTrackMinDistance.setEntries(entries); saveTrackMinDistance.setEntries(entries);
saveTrackMinDistance.setEntryValues(entryValues); saveTrackMinDistance.setEntryValues(entryValues);
saveTrackMinDistance.setDescription(R.string.save_track_min_distance_descr);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(getString(R.string.monitoring_min_distance_descr));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_distance_descr_side_effect));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_distance_descr_recommendation));
saveTrackMinDistance.setDescription(stringBuilder.toString());
} }
private void setupSaveTrackPrecisionPref() { private void setupSaveTrackPrecisionPref() {
@ -101,7 +122,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
ListPreferenceEx saveTrackPrecision = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_PRECISION.getId()); ListPreferenceEx saveTrackPrecision = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_PRECISION.getId());
saveTrackPrecision.setEntries(entries); saveTrackPrecision.setEntries(entries);
saveTrackPrecision.setEntryValues(entryValues); saveTrackPrecision.setEntryValues(entryValues);
saveTrackPrecision.setDescription(R.string.save_track_precision_descr);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(getString(R.string.monitoring_min_accuracy_descr));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_accuracy_descr_side_effect));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_accuracy_descr_recommendation));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_accuracy_descr_remark));
saveTrackPrecision.setDescription(stringBuilder.toString());
} }
private void setupSaveTrackMinSpeedPref() { private void setupSaveTrackMinSpeedPref() {
@ -117,7 +147,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
ListPreferenceEx saveTrackMinSpeed = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_SPEED.getId()); ListPreferenceEx saveTrackMinSpeed = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_SPEED.getId());
saveTrackMinSpeed.setEntries(entries); saveTrackMinSpeed.setEntries(entries);
saveTrackMinSpeed.setEntryValues(entryValues); saveTrackMinSpeed.setEntryValues(entryValues);
saveTrackMinSpeed.setDescription(R.string.save_track_min_speed_descr);
SpannableStringBuilder stringBuilder = new SpannableStringBuilder(getString(R.string.monitoring_min_speed_descr));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_speed_descr_side_effect));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_speed_descr_recommendation));
stringBuilder.append("\n");
stringBuilder.append(getString(R.string.monitoring_min_speed_descr_remark));
saveTrackMinSpeed.setDescription(stringBuilder.toString());
} }
private void setupAutoSplitRecordingPref() { private void setupAutoSplitRecordingPref() {
@ -130,6 +169,17 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
disableRecordingOnceAppKilled.setDescription(getString(R.string.disable_recording_once_app_killed_descrp)); disableRecordingOnceAppKilled.setDescription(getString(R.string.disable_recording_once_app_killed_descrp));
} }
private void setupSaveHeadingToGpxPref() {
SwitchPreferenceEx saveHeadingToGpx = (SwitchPreferenceEx) findPreference(settings.SAVE_HEADING_TO_GPX.getId());
saveHeadingToGpx.setDescription(getString(R.string.save_heading_descr));
}
private void setupShowTripRecNotificationPref() {
SwitchPreferenceEx showTripRecNotification = (SwitchPreferenceEx) findPreference(settings.SHOW_TRIP_REC_NOTIFICATION.getId());
showTripRecNotification.setDescription(getString(R.string.trip_rec_notification_settings));
showTripRecNotification.setIcon(getContentIcon(R.drawable.ic_action_notification));
}
private void setupTrackStorageDirectoryPref() { private void setupTrackStorageDirectoryPref() {
Integer[] entryValues = new Integer[] {REC_DIRECTORY, MONTHLY_DIRECTORY, DAILY_DIRECTORY}; Integer[] entryValues = new Integer[] {REC_DIRECTORY, MONTHLY_DIRECTORY, DAILY_DIRECTORY};
String[] entries = new String[entryValues.length]; String[] entries = new String[entryValues.length];
@ -151,8 +201,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
} }
private void setupOpenNotesDescrPref() { private void setupOpenNotesDescrPref() {
Preference nameAndPasswordPref = findPreference("open_tracks_description"); String tracksPath = getString(R.string.tracks_view_path);
nameAndPasswordPref.setTitle(getText(R.string.tracks_view_descr)); String tracksPathDescr = getString(R.string.tracks_view_descr, tracksPath);
int startIndex = tracksPathDescr.indexOf(tracksPath);
SpannableString titleSpan = new SpannableString(tracksPathDescr);
Typeface typeface = FontCache.getRobotoMedium(getContext());
titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + tracksPath.length(), 0);
Preference openTracksDescription = findPreference("open_tracks_description");
openTracksDescription.setTitle(titleSpan);
} }
private void setupOpenNotesPref() { private void setupOpenNotesPref() {
@ -172,13 +230,24 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
@Override @Override
public boolean onPreferenceClick(Preference preference) { public boolean onPreferenceClick(Preference preference) {
if (OPEN_TRACKS.equals(preference.getKey())) { String prefId = preference.getKey();
if (OPEN_TRACKS.equals(prefId)) {
OsmAndAppCustomization appCustomization = app.getAppCustomization(); OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity()); Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
app.getSettings().FAVORITES_TAB.set(FavoritesActivity.GPX_TAB); app.getSettings().FAVORITES_TAB.set(FavoritesActivity.GPX_TAB);
startActivity(favorites); startActivity(favorites);
return true; return true;
} else if (COPY_PLUGIN_SETTINGS.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
SelectCopyAppModeBottomSheet.showInstance(fragmentManager, this, false, getSelectedAppMode());
}
} else if (RESET_TO_DEFAULT.equals(prefId)) {
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
ResetProfilePrefsBottomSheet.showInstance(fragmentManager, prefId, this, false, getSelectedAppMode());
}
} }
return super.onPreferenceClick(preference); return super.onPreferenceClick(preference);
} }
@ -199,4 +268,36 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
return true; return true;
} }
@Override
public void onDisplayPreferenceDialog(Preference preference) {
String prefId = preference.getKey();
if (settings.SAVE_TRACK_MIN_DISTANCE.getId().equals(prefId)
|| settings.SAVE_TRACK_PRECISION.getId().equals(prefId)
|| settings.SAVE_TRACK_MIN_SPEED.getId().equals(prefId)) {
FragmentManager fm = getFragmentManager();
if (fm != null) {
ApplicationMode appMode = getSelectedAppMode();
SingleSelectPreferenceBottomSheet.showInstance(fm, prefId, this, false, appMode, true, true);
}
} else {
super.onDisplayPreferenceDialog(preference);
}
}
@Override
public void copyAppModePrefs(ApplicationMode appMode) {
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
app.getSettings().copyProfilePreferences(appMode, getSelectedAppMode(), plugin.getPreferences());
}
}
@Override
public void resetAppModePrefs(ApplicationMode appMode) {
OsmandMonitoringPlugin plugin = OsmandPlugin.getPlugin(OsmandMonitoringPlugin.class);
if (plugin != null) {
app.getSettings().resetProfilePreferences(appMode, plugin.getPreferences());
}
}
} }

View file

@ -63,6 +63,19 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
final List<ApplicationMode> am = ApplicationMode.allPossibleValues(); final List<ApplicationMode> am = ApplicationMode.allPossibleValues();
ApplicationMode.regWidgetVisibility("monitoring", am.toArray(new ApplicationMode[am.size()])); ApplicationMode.regWidgetVisibility("monitoring", am.toArray(new ApplicationMode[am.size()]));
settings = app.getSettings(); settings = app.getSettings();
pluginPreferences.add(settings.SAVE_TRACK_TO_GPX);
pluginPreferences.add(settings.SAVE_TRACK_INTERVAL);
pluginPreferences.add(settings.SAVE_TRACK_MIN_DISTANCE);
pluginPreferences.add(settings.SAVE_TRACK_PRECISION);
pluginPreferences.add(settings.AUTO_SPLIT_RECORDING);
pluginPreferences.add(settings.DISABLE_RECORDING_ONCE_APP_KILLED);
pluginPreferences.add(settings.SAVE_HEADING_TO_GPX);
pluginPreferences.add(settings.SHOW_TRIP_REC_NOTIFICATION);
pluginPreferences.add(settings.TRACK_STORAGE_DIRECTORY);
pluginPreferences.add(settings.LIVE_MONITORING);
pluginPreferences.add(settings.LIVE_MONITORING_URL);
pluginPreferences.add(settings.LIVE_MONITORING_INTERVAL);
pluginPreferences.add(settings.LIVE_MONITORING_MAX_INTERVAL_TO_SEND);
} }
@Override @Override

View file

@ -1,8 +1,10 @@
package net.osmand.plus.osmedit; package net.osmand.plus.osmedit;
import android.content.Intent; import android.content.Intent;
import android.graphics.Typeface;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference; import android.support.v7.preference.Preference;
import android.text.SpannableString;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
@ -10,10 +12,12 @@ import android.widget.TextView;
import net.osmand.plus.OsmAndAppCustomization; import net.osmand.plus.OsmAndAppCustomization;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.helpers.AndroidUiHelper; import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.settings.BaseSettingsFragment; import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.settings.OnPreferenceChanged; import net.osmand.plus.settings.OnPreferenceChanged;
import net.osmand.plus.settings.bottomsheets.OsmLoginDataBottomSheet; import net.osmand.plus.settings.bottomsheets.OsmLoginDataBottomSheet;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx; import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.plus.widgets.style.CustomTypefaceSpan;
public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged { public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged {
@ -22,8 +26,8 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer
@Override @Override
protected void setupPreferences() { protected void setupPreferences() {
Preference vehicleParametersInfo = findPreference("osm_editing_info"); Preference osmEditingInfo = findPreference("osm_editing_info");
vehicleParametersInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark)); osmEditingInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
setupNameAndPasswordPref(); setupNameAndPasswordPref();
setupOfflineEditingPref(); setupOfflineEditingPref();
@ -52,8 +56,16 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer
} }
private void setupOsmEditsDescrPref() { private void setupOsmEditsDescrPref() {
Preference nameAndPasswordPref = findPreference("osm_edits_description"); String osmEditsPath = getString(R.string.osm_edits_view_path);
nameAndPasswordPref.setTitle(getText(R.string.osm_edits_view_descr)); String osmEditsPathDescr = getString(R.string.osm_edits_view_descr, osmEditsPath);
int startIndex = osmEditsPathDescr.indexOf(osmEditsPath);
SpannableString titleSpan = new SpannableString(osmEditsPathDescr);
Typeface typeface = FontCache.getRobotoMedium(getContext());
titleSpan.setSpan(new CustomTypefaceSpan(typeface), startIndex, startIndex + osmEditsPath.length(), 0);
Preference osmEditsDescription = findPreference("osm_edits_description");
osmEditsDescription.setTitle(titleSpan);
} }
private void setupOsmEditsPref() { private void setupOsmEditsPref() {

View file

@ -112,9 +112,8 @@ public class SettingsOsmEditingActivity extends SettingsBaseActivity {
@Override @Override
protected void onPostExecute(OsmBugsUtil.OsmBugResult osmBugResult) { protected void onPostExecute(OsmBugsUtil.OsmBugResult osmBugResult) {
if (osmBugResult.warning != null) { String text = osmBugResult.warning != null ? osmBugResult.warning : context.getString(R.string.osm_authorization_success);
Toast.makeText(context, osmBugResult.warning, Toast.LENGTH_LONG).show(); Toast.makeText(context, text, Toast.LENGTH_LONG).show();
}
} }
} }
} }

View file

@ -103,9 +103,10 @@ public class SelectCopyAppModeBottomSheet extends AppModesBottomSheetDialogFragm
@Override @Override
protected void onRightBottomButtonClick() { protected void onRightBottomButtonClick() {
OsmandApplication app = getMyApplication(); Fragment targetFragment = getTargetFragment();
if (app != null && selectedAppMode != null) { if (selectedAppMode != null && targetFragment instanceof CopyAppModePrefsListener) {
app.getSettings().copyPreferencesFromProfile(selectedAppMode, currentAppMode); CopyAppModePrefsListener listener = (CopyAppModePrefsListener) targetFragment;
listener.copyAppModePrefs(selectedAppMode);
} }
dismiss(); dismiss();
} }
@ -127,4 +128,8 @@ public class SelectCopyAppModeBottomSheet extends AppModesBottomSheetDialogFragm
LOG.error("showInstance", e); LOG.error("showInstance", e);
} }
} }
public interface CopyAppModePrefsListener {
void copyAppModePrefs(ApplicationMode appMode);
}
} }

View file

@ -50,6 +50,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandActionBarActivity; import net.osmand.plus.activities.OsmandActionBarActivity;
import net.osmand.plus.activities.OsmandInAppPurchaseActivity; import net.osmand.plus.activities.OsmandInAppPurchaseActivity;
import net.osmand.plus.audionotes.MultimediaNotesFragment; import net.osmand.plus.audionotes.MultimediaNotesFragment;
import net.osmand.plus.development.DevelopmentSettingsFragment;
import net.osmand.plus.monitoring.MonitoringSettingsFragment; import net.osmand.plus.monitoring.MonitoringSettingsFragment;
import net.osmand.plus.osmedit.OsmEditingFragment; import net.osmand.plus.osmedit.OsmEditingFragment;
import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment; import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment;
@ -90,25 +91,26 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
MAIN_SETTINGS(MainSettingsFragment.TAG, false, R.xml.settings_main_screen, R.layout.global_preference_toolbar), 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), GLOBAL_SETTINGS(GlobalSettingsFragment.class.getName(), false, R.xml.global_settings, R.layout.global_preference_toolbar),
OPEN_STREET_MAP_EDITING(OsmEditingFragment.class.getName(), false, R.xml.osm_editing, R.layout.global_preference_toolbar),
CONFIGURE_PROFILE(ConfigureProfileFragment.class.getName(), true, R.xml.configure_profile, R.layout.profile_preference_toolbar_with_switch), 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), PROXY_SETTINGS(ProxySettingsFragment.class.getName(), false, R.xml.proxy_preferences, R.layout.global_preferences_toolbar_with_switch),
LIVE_MONITORING(LiveMonitoringFragment.class.getName(), false, R.xml.live_monitoring, R.layout.global_preferences_toolbar_with_switch),
GENERAL_PROFILE(GeneralProfileSettingsFragment.class.getName(), true, R.xml.general_profile_settings, R.layout.profile_preference_toolbar_big), GENERAL_PROFILE(GeneralProfileSettingsFragment.class.getName(), true, R.xml.general_profile_settings, R.layout.profile_preference_toolbar_big),
NAVIGATION(NavigationFragment.class.getName(), true, R.xml.navigation_settings_new, 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), 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), 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), 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), VOICE_ANNOUNCES(VoiceAnnouncesFragment.class.getName(), true, R.xml.voice_announces, R.layout.profile_preference_toolbar_with_switch),
ACCESSIBILITY_SETTINGS(AccessibilitySettingsFragment.class.getName(), true, R.xml.accessibility_settings, R.layout.profile_preference_toolbar_big),
MULTIMEDIA_NOTES(MultimediaNotesFragment.class.getName(), true, R.xml.multimedia_notes, R.layout.profile_preference_toolbar_big),
MONITORING_SETTINGS(MonitoringSettingsFragment.class.getName(), true, R.xml.monitoring_settings, R.layout.profile_preference_toolbar_big),
VEHICLE_PARAMETERS(VehicleParametersFragment.class.getName(), true, R.xml.vehicle_parameters, R.layout.profile_preference_toolbar), 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), 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), 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), 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), 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); 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_big),
MONITORING_SETTINGS(MonitoringSettingsFragment.class.getName(), true, R.xml.monitoring_settings, R.layout.profile_preference_toolbar_big),
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_big),
DEVELOPMENT_SETTINGS(DevelopmentSettingsFragment.class.getName(), false, R.xml.development_settings, R.layout.global_preference_toolbar);
public final String fragmentName; public final String fragmentName;
public final boolean profileDependent; public final boolean profileDependent;
@ -309,7 +311,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
ApplicationMode appMode = getSelectedAppMode(); ApplicationMode appMode = getSelectedAppMode();
if (preference instanceof ListPreferenceEx) { if (preference instanceof ListPreferenceEx) {
SingleSelectPreferenceBottomSheet.showInstance(fragmentManager, preference.getKey(), this, false, appMode, currentScreenType.profileDependent); SingleSelectPreferenceBottomSheet.showInstance(fragmentManager, preference.getKey(), this, false, appMode, currentScreenType.profileDependent, false);
} else if (preference instanceof SwitchPreferenceEx) { } else if (preference instanceof SwitchPreferenceEx) {
BooleanPreferenceBottomSheet.showInstance(fragmentManager, preference.getKey(), this, false, appMode, currentScreenType.profileDependent); BooleanPreferenceBottomSheet.showInstance(fragmentManager, preference.getKey(), this, false, appMode, currentScreenType.profileDependent);
} else if (preference instanceof EditTextPreference) { } else if (preference instanceof EditTextPreference) {
@ -695,6 +697,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
p.setKey(b.getId()); p.setKey(b.getId());
p.setSummary(summary); p.setSummary(summary);
p.setLayoutResource(layoutId); p.setLayoutResource(layoutId);
p.setIconSpaceReserved(true);
return p; return p;
} }
@ -708,6 +711,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
p.setTitle(title); p.setTitle(title);
p.setSummary(summary); p.setSummary(summary);
p.setLayoutResource(layoutId); p.setLayoutResource(layoutId);
p.setIconSpaceReserved(true);
return p; return p;
} }
@ -722,6 +726,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
listPreference.setDialogTitle(title); listPreference.setDialogTitle(title);
listPreference.setEntries(names); listPreference.setEntries(names);
listPreference.setEntryValues(values); listPreference.setEntryValues(values);
listPreference.setIconSpaceReserved(true);
if (layoutId != 0) { if (layoutId != 0) {
listPreference.setLayoutResource(layoutId); listPreference.setLayoutResource(layoutId);

View file

@ -41,7 +41,9 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.FontCache; import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin; import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet; import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet; import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener;
import net.osmand.plus.skimapsplugin.SkiMapsPlugin; import net.osmand.plus.skimapsplugin.SkiMapsPlugin;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -55,7 +57,7 @@ import static net.osmand.plus.profiles.EditProfileFragment.OPEN_CONFIG_ON_MAP;
import static net.osmand.plus.profiles.EditProfileFragment.SCREEN_CONFIG; import static net.osmand.plus.profiles.EditProfileFragment.SCREEN_CONFIG;
import static net.osmand.plus.profiles.EditProfileFragment.SELECTED_ITEM; import static net.osmand.plus.profiles.EditProfileFragment.SELECTED_ITEM;
public class ConfigureProfileFragment extends BaseSettingsFragment { public class ConfigureProfileFragment extends BaseSettingsFragment implements CopyAppModePrefsListener, ResetAppModePrefsListener {
public static final String TAG = ConfigureProfileFragment.class.getSimpleName(); public static final String TAG = ConfigureProfileFragment.class.getSimpleName();
@ -147,6 +149,20 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
updateToolbarSwitch(); updateToolbarSwitch();
} }
@Override
public void copyAppModePrefs(ApplicationMode appMode) {
if (appMode != null) {
app.getSettings().copyPreferencesFromProfile(appMode, getSelectedAppMode());
}
}
@Override
public void resetAppModePrefs(ApplicationMode appMode) {
if (appMode != null) {
app.getSettings().resetPreferencesForProfile(appMode);
}
}
private RecyclerView.ItemDecoration createDividerItemDecoration() { private RecyclerView.ItemDecoration createDividerItemDecoration() {
final Drawable dividerLight = new ColorDrawable(ContextCompat.getColor(app, R.color.list_background_color_light)); final Drawable dividerLight = new ColorDrawable(ContextCompat.getColor(app, R.color.list_background_color_light));
final Drawable dividerDark = new ColorDrawable(ContextCompat.getColor(app, R.color.list_background_color_dark)); final Drawable dividerDark = new ColorDrawable(ContextCompat.getColor(app, R.color.list_background_color_dark));

View file

@ -30,6 +30,9 @@ public class LiveMonitoringFragment extends BaseSettingsFragment {
@Override @Override
protected void setupPreferences() { protected void setupPreferences() {
Preference liveMonitoringInfo = findPreference("live_monitoring_info");
liveMonitoringInfo.setIconSpaceReserved(false);
setupLiveMonitoringUrlPref(); setupLiveMonitoringUrlPref();
setupLiveMonitoringIntervalPref(); setupLiveMonitoringIntervalPref();
setupLiveMonitoringBufferPref(); setupLiveMonitoringBufferPref();
@ -86,9 +89,17 @@ public class LiveMonitoringFragment extends BaseSettingsFragment {
} }
private void setupLiveMonitoringUrlPref() { private void setupLiveMonitoringUrlPref() {
ApplicationMode appMode = getSelectedAppMode();
String summary;
if (settings.LIVE_MONITORING_URL.isSetForMode(appMode)) {
summary = settings.LIVE_MONITORING_URL.getModeValue(appMode);
} else {
summary = getString(R.string.shared_string_disabled);
}
EditTextPreferenceEx liveMonitoringUrl = (EditTextPreferenceEx) findPreference(settings.LIVE_MONITORING_URL.getId()); EditTextPreferenceEx liveMonitoringUrl = (EditTextPreferenceEx) findPreference(settings.LIVE_MONITORING_URL.getId());
liveMonitoringUrl.setSummary(settings.LIVE_MONITORING_URL.getModeValue(getSelectedAppMode())); liveMonitoringUrl.setSummary(summary);
liveMonitoringUrl.setDescription(R.string.live_monitoring_m_descr); liveMonitoringUrl.setDescription(R.string.live_monitoring_adress_descr);
liveMonitoringUrl.setIcon(getContentIcon(R.drawable.ic_world_globe_dark)); liveMonitoringUrl.setIcon(getContentIcon(R.drawable.ic_world_globe_dark));
} }

View file

@ -206,7 +206,6 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
switchPreferenceEx.setIcon(getRoutingPrefIcon(p.getId())); switchPreferenceEx.setIcon(getRoutingPrefIcon(p.getId()));
switchPreferenceEx.setSummaryOn(R.string.shared_string_on); switchPreferenceEx.setSummaryOn(R.string.shared_string_on);
switchPreferenceEx.setSummaryOff(R.string.shared_string_off); switchPreferenceEx.setSummaryOff(R.string.shared_string_off);
switchPreferenceEx.setIconSpaceReserved(true);
screen.addPreference(switchPreferenceEx); screen.addPreference(switchPreferenceEx);
} else { } else {
@ -221,7 +220,6 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
ListPreferenceEx listPreferenceEx = (ListPreferenceEx) createListPreferenceEx(pref.getId(), p.getPossibleValueDescriptions(), svlss, title, R.layout.preference_with_descr); ListPreferenceEx listPreferenceEx = (ListPreferenceEx) createListPreferenceEx(pref.getId(), p.getPossibleValueDescriptions(), svlss, title, R.layout.preference_with_descr);
listPreferenceEx.setDescription(description); listPreferenceEx.setDescription(description);
listPreferenceEx.setIcon(getRoutingPrefIcon(p.getId())); listPreferenceEx.setIcon(getRoutingPrefIcon(p.getId()));
listPreferenceEx.setIconSpaceReserved(true);
screen.addPreference(listPreferenceEx); screen.addPreference(listPreferenceEx);
} }

View file

@ -191,13 +191,11 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment {
//AudioManager.USE_DEFAULT_STREAM_TYPE}; //AudioManager.USE_DEFAULT_STREAM_TYPE};
ListPreferenceEx audioStreamGuidance = createListPreferenceEx(settings.AUDIO_STREAM_GUIDANCE.getId(), streamTypes, streamIntTypes, R.string.choose_audio_stream, R.layout.preference_with_descr); ListPreferenceEx audioStreamGuidance = createListPreferenceEx(settings.AUDIO_STREAM_GUIDANCE.getId(), streamTypes, streamIntTypes, R.string.choose_audio_stream, R.layout.preference_with_descr);
audioStreamGuidance.setIconSpaceReserved(true);
getPreferenceScreen().addPreference(audioStreamGuidance); getPreferenceScreen().addPreference(audioStreamGuidance);
} }
private void setupInterruptMusicPref() { private void setupInterruptMusicPref() {
Preference interruptMusicPref = createSwitchPreference(settings.INTERRUPT_MUSIC, R.string.interrupt_music, R.string.interrupt_music_descr, R.layout.preference_switch_with_descr); Preference interruptMusicPref = createSwitchPreference(settings.INTERRUPT_MUSIC, R.string.interrupt_music, R.string.interrupt_music_descr, R.layout.preference_switch_with_descr);
interruptMusicPref.setIconSpaceReserved(true);
getPreferenceScreen().addPreference(interruptMusicPref); getPreferenceScreen().addPreference(interruptMusicPref);
} }

View file

@ -8,7 +8,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.view.ContextThemeWrapper;
import android.view.View; import android.view.View;
import net.osmand.AndroidUtils; import net.osmand.AndroidUtils;
@ -56,13 +55,16 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
final OsmandSettings.BooleanPreference pref = (BooleanPreference) preference; final OsmandSettings.BooleanPreference pref = (BooleanPreference) preference;
final String on = getString(R.string.shared_string_on); final String on = getString(R.string.shared_string_on);
final String off = getString(R.string.shared_string_off); final String off = getString(R.string.shared_string_off);
final int activeColor = AndroidUtils.resolveAttribute(app, R.attr.active_color_basic);
final int disabledColor = AndroidUtils.resolveAttribute(app, android.R.attr.textColorSecondary);
boolean checked = pref.getModeValue(getAppMode()); boolean checked = pref.getModeValue(getAppMode());
final BottomSheetItemWithCompoundButton[] preferenceBtn = new BottomSheetItemWithCompoundButton[1]; final BottomSheetItemWithCompoundButton[] preferenceBtn = new BottomSheetItemWithCompoundButton[1];
preferenceBtn[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder() preferenceBtn[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()
.setChecked(checked) .setChecked(checked)
.setTitle(checked ? on : off) .setTitle(checked ? on : off)
.setCustomView(getCustomButtonView()) .setTitleColorId(checked ? activeColor : disabledColor)
.setCustomView(getCustomButtonView(checked))
.setOnClickListener(new View.OnClickListener() { .setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -71,6 +73,8 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
switchPreference.setChecked(newValue); switchPreference.setChecked(newValue);
preferenceBtn[0].setTitle(newValue ? on : off); preferenceBtn[0].setTitle(newValue ? on : off);
preferenceBtn[0].setChecked(newValue); preferenceBtn[0].setChecked(newValue);
preferenceBtn[0].setTitleColorId(newValue ? activeColor : disabledColor);
updateCustomButtonView(v, newValue);
Fragment target = getTargetFragment(); Fragment target = getTargetFragment();
if (target instanceof OnPreferenceChanged) { if (target instanceof OnPreferenceChanged) {
@ -97,18 +101,24 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
@Override @Override
protected int getDismissButtonTextId() { protected int getDismissButtonTextId() {
return R.string.shared_string_close; return R.string.shared_string_cancel;
} }
private View getCustomButtonView() { private View getCustomButtonView(boolean checked) {
View customView = UiUtilities.getInflater(getContext(), nightMode).inflate(R.layout.bottom_sheet_item_preference_switch, null);
updateCustomButtonView(customView, checked);
return customView;
}
private void updateCustomButtonView(View customView, boolean checked) {
OsmandApplication app = requiredMyApplication(); OsmandApplication app = requiredMyApplication();
View customView = View.inflate(new ContextThemeWrapper(app, themeRes), R.layout.bottom_sheet_item_preference_switch, null);
View buttonView = customView.findViewById(R.id.button_container); View buttonView = customView.findViewById(R.id.button_container);
int colorRes = getAppMode().getIconColorInfo().getColor(nightMode); int colorRes = getAppMode().getIconColorInfo().getColor(nightMode);
int color = getResolvedColor(colorRes); int color = checked ? getResolvedColor(colorRes) : AndroidUtils.getColorFromAttr(app, R.attr.divider_color_basic);
int bgColor = UiUtilities.getColorWithAlpha(color, 0.1f); int bgColor = UiUtilities.getColorWithAlpha(color, checked ? 0.1f : 0.5f);
int selectedColor = UiUtilities.getColorWithAlpha(color, 0.3f); int selectedColor = UiUtilities.getColorWithAlpha(color, checked ? 0.3f : 0.5f);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
int bgResId = R.drawable.rectangle_rounded_right; int bgResId = R.drawable.rectangle_rounded_right;
@ -123,8 +133,6 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
Drawable bgDrawable = app.getUIUtilities().getPaintedIcon(bgResId, bgColor); Drawable bgDrawable = app.getUIUtilities().getPaintedIcon(bgResId, bgColor);
AndroidUtils.setBackground(buttonView, bgDrawable); AndroidUtils.setBackground(buttonView, bgDrawable);
} }
return customView;
} }
private SwitchPreferenceEx getSwitchPreferenceEx() { private SwitchPreferenceEx getSwitchPreferenceEx() {

View file

@ -6,17 +6,20 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentManager;
import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.LongDescriptionItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.settings.OnPreferenceChanged; import net.osmand.plus.settings.OnPreferenceChanged;
import net.osmand.plus.settings.preferences.EditTextPreferenceEx; import net.osmand.plus.settings.preferences.EditTextPreferenceEx;
import net.osmand.util.Algorithms; import net.osmand.util.Algorithms;
import studio.carbonylgroup.textfieldboxes.TextFieldBoxes;
public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet { public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet {
public static final String TAG = EditTextPreferenceBottomSheet.class.getSimpleName(); public static final String TAG = EditTextPreferenceBottomSheet.class.getSimpleName();
@ -41,13 +44,15 @@ public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet {
text = editTextPreference.getText(); text = editTextPreference.getText();
} }
editText = new EditText(ctx); View view = UiUtilities.getInflater(ctx, nightMode).inflate(R.layout.preference_edit_text_box, null);
editText = view.findViewById(R.id.edit_text);
editText.setText(text); editText.setText(text);
items.add(new SimpleBottomSheetItem.Builder().setCustomView(editText).create()); items.add(new SimpleBottomSheetItem.Builder().setCustomView(view).create());
String description = editTextPreference.getDescription(); String description = editTextPreference.getDescription();
if (!Algorithms.isEmpty(description)) { if (!Algorithms.isEmpty(description)) {
items.add(new LongDescriptionItem(description)); TextFieldBoxes textFieldBoxes = view.findViewById(R.id.text_field_box);
textFieldBoxes.setHelperText(description);
} }
} }
@ -59,7 +64,7 @@ public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet {
@Override @Override
protected int getDismissButtonTextId() { protected int getDismissButtonTextId() {
return R.string.shared_string_close; return R.string.shared_string_cancel;
} }
@Override @Override

View file

@ -12,7 +12,6 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.UiUtilities; import net.osmand.plus.UiUtilities;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
@ -71,9 +70,10 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
@Override @Override
protected void onRightBottomButtonClick() { protected void onRightBottomButtonClick() {
OsmandApplication app = getMyApplication(); Fragment targetFragment = getTargetFragment();
if (app != null) { if (targetFragment instanceof ResetAppModePrefsListener) {
app.getSettings().resetPreferencesForProfile(getAppMode()); ResetAppModePrefsListener listener = (ResetAppModePrefsListener) targetFragment;
listener.resetAppModePrefs(getAppMode());
} }
dismiss(); dismiss();
} }
@ -100,4 +100,8 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
return false; return false;
} }
} }
public interface ResetAppModePrefsListener {
void resetAppModePrefs(ApplicationMode appMode);
}
} }

View file

@ -12,8 +12,9 @@ import net.osmand.AndroidUtils;
import net.osmand.plus.ApplicationMode; import net.osmand.plus.ApplicationMode;
import net.osmand.plus.R; import net.osmand.plus.R;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem; import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemTitleWithDescrAndButton;
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.LongDescriptionItem; import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem; import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.settings.OnPreferenceChanged; import net.osmand.plus.settings.OnPreferenceChanged;
import net.osmand.plus.settings.preferences.ListPreferenceEx; import net.osmand.plus.settings.preferences.ListPreferenceEx;
@ -24,10 +25,14 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
public static final String TAG = SingleSelectPreferenceBottomSheet.class.getSimpleName(); public static final String TAG = SingleSelectPreferenceBottomSheet.class.getSimpleName();
private static final String SELECTED_ENTRY_INDEX_KEY = "selected_entry_index_key"; private static final String SELECTED_ENTRY_INDEX_KEY = "selected_entry_index_key";
private static final String USE_COLLAPSIBLE_DESCRIPTION = "use_collapsible_description";
private static final int COLLAPSED_DESCRIPTION_LINES = 4;
private ListPreferenceEx listPreference; private ListPreferenceEx listPreference;
private int selectedEntryIndex = -1; private int selectedEntryIndex = -1;
private boolean descriptionExpanded;
private boolean collapsibleDescription;
@Override @Override
public void createMenuItems(Bundle savedInstanceState) { public void createMenuItems(Bundle savedInstanceState) {
@ -36,8 +41,13 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
if (ctx == null || listPreference == null || listPreference.getEntries() == null || listPreference.getEntryValues() == null) { if (ctx == null || listPreference == null || listPreference.getEntries() == null || listPreference.getEntryValues() == null) {
return; return;
} }
Bundle args = getArguments();
if (args != null && args.containsKey(USE_COLLAPSIBLE_DESCRIPTION)) {
collapsibleDescription = args.getBoolean(USE_COLLAPSIBLE_DESCRIPTION);
}
if (savedInstanceState != null) { if (savedInstanceState != null) {
selectedEntryIndex = savedInstanceState.getInt(SELECTED_ENTRY_INDEX_KEY); selectedEntryIndex = savedInstanceState.getInt(SELECTED_ENTRY_INDEX_KEY);
collapsibleDescription = savedInstanceState.getBoolean(USE_COLLAPSIBLE_DESCRIPTION);
} else { } else {
selectedEntryIndex = listPreference.findIndexOfValue(listPreference.getValue()); selectedEntryIndex = listPreference.findIndexOfValue(listPreference.getValue());
} }
@ -47,7 +57,7 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
String description = listPreference.getDescription(); String description = listPreference.getDescription();
if (!Algorithms.isEmpty(description)) { if (!Algorithms.isEmpty(description)) {
items.add(new LongDescriptionItem(description)); buildDescriptionItem(ctx, description);
} }
String[] entries = listPreference.getEntries(); String[] entries = listPreference.getEntries();
@ -83,11 +93,12 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
public void onSaveInstanceState(Bundle outState) { public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
outState.putInt(SELECTED_ENTRY_INDEX_KEY, selectedEntryIndex); outState.putInt(SELECTED_ENTRY_INDEX_KEY, selectedEntryIndex);
outState.putBoolean(USE_COLLAPSIBLE_DESCRIPTION, collapsibleDescription);
} }
@Override @Override
protected int getDismissButtonTextId() { protected int getDismissButtonTextId() {
return R.string.shared_string_close; return R.string.shared_string_cancel;
} }
@Override @Override
@ -125,11 +136,41 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
return (ListPreferenceEx) getPreference(); return (ListPreferenceEx) getPreference();
} }
public static boolean showInstance(@NonNull FragmentManager fragmentManager, String key, Fragment target, private void buildDescriptionItem(Context ctx, String description) {
boolean usedOnMap, @Nullable ApplicationMode appMode, boolean profileDependent) { if (collapsibleDescription) {
final BottomSheetItemTitleWithDescrAndButton[] preferenceDescription = new BottomSheetItemTitleWithDescrAndButton[1];
preferenceDescription[0] = (BottomSheetItemTitleWithDescrAndButton) new BottomSheetItemTitleWithDescrAndButton.Builder()
.setButtonTitle(getString(R.string.shared_string_read_more))
.setButtonTextColor(AndroidUtils.resolveAttribute(ctx, R.attr.active_color_basic))
.setOnButtonClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
descriptionExpanded = !descriptionExpanded;
int maxLines = descriptionExpanded ? Integer.MAX_VALUE : COLLAPSED_DESCRIPTION_LINES;
preferenceDescription[0].setDescriptionMaxLines(maxLines);
setupHeightAndBackground(getView());
}
})
.setDescriptionMaxLines(COLLAPSED_DESCRIPTION_LINES)
.setDescription(description)
.setLayoutId(R.layout.bottom_sheet_item_with_expandable_descr)
.create();
items.add(preferenceDescription[0]);
} else {
BaseBottomSheetItem preferenceDescription = new BottomSheetItemWithDescription.Builder()
.setDescription(description)
.setLayoutId(R.layout.bottom_sheet_item_preference_descr)
.create();
items.add(preferenceDescription);
}
}
public static boolean showInstance(@NonNull FragmentManager fragmentManager, String key, Fragment target, boolean usedOnMap,
@Nullable ApplicationMode appMode, boolean profileDependent, boolean collapsibleDescription) {
try { try {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString(PREFERENCE_ID, key); args.putString(PREFERENCE_ID, key);
args.putBoolean(USE_COLLAPSIBLE_DESCRIPTION, collapsibleDescription);
SingleSelectPreferenceBottomSheet fragment = new SingleSelectPreferenceBottomSheet(); SingleSelectPreferenceBottomSheet fragment = new SingleSelectPreferenceBottomSheet();
fragment.setArguments(args); fragment.setArguments(args);