diff --git a/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml b/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml
index b66a1ec2f7..04f0ab1d4c 100644
--- a/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml
+++ b/OsmAnd/res/layout/bottom_sheet_item_preference_descr.xml
@@ -11,7 +11,6 @@
android:paddingTop="@dimen/bottom_sheet_image_text_margin_start"
android:paddingRight="@dimen/content_padding"
android:paddingBottom="@dimen/gpx_small_text_margin"
- android:textColor="?android:textColorPrimary"
- android:textSize="@dimen/default_desc_text_size"
+ android:textAppearance="@style/TextAppearance.ListItemTitle"
app:typeface="@string/font_roboto_regular"
tools:text="@string/auto_zoom_map_descr" />
\ No newline at end of file
diff --git a/OsmAnd/res/layout/divider_half_item.xml b/OsmAnd/res/layout/divider_half_item.xml
new file mode 100644
index 0000000000..5414a81807
--- /dev/null
+++ b/OsmAnd/res/layout/divider_half_item.xml
@@ -0,0 +1,8 @@
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/osm_login_data.xml b/OsmAnd/res/layout/osm_login_data.xml
index aca7353f6a..26dbdd85e5 100644
--- a/OsmAnd/res/layout/osm_login_data.xml
+++ b/OsmAnd/res/layout/osm_login_data.xml
@@ -5,7 +5,8 @@
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/content_padding"
- android:paddingRight="@dimen/content_padding">
+ android:paddingRight="@dimen/content_padding"
+ android:paddingBottom="@dimen/route_info_list_text_padding">
diff --git a/OsmAnd/res/layout/preference_button.xml b/OsmAnd/res/layout/preference_button.xml
index 948c7daaee..a89464d4ef 100644
--- a/OsmAnd/res/layout/preference_button.xml
+++ b/OsmAnd/res/layout/preference_button.xml
@@ -14,25 +14,15 @@
android:minHeight="@dimen/bottom_sheet_list_item_height"
tools:background="?android:attr/selectableItemBackground">
-
-
-
-
-
+ android:layout_marginLeft="@dimen/content_padding"
+ android:layout_marginRight="@dimen/content_padding"
+ tools:src="@drawable/ic_action_car_dark"
+ tools:tint="?colorAccent" />
+ tools:text="Button text" />
diff --git a/OsmAnd/res/layout/preference_description.xml b/OsmAnd/res/layout/preference_description.xml
new file mode 100644
index 0000000000..9b01ab7d37
--- /dev/null
+++ b/OsmAnd/res/layout/preference_description.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/preference_edit_text_box.xml b/OsmAnd/res/layout/preference_edit_text_box.xml
new file mode 100644
index 0000000000..900752ee14
--- /dev/null
+++ b/OsmAnd/res/layout/preference_edit_text_box.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/preference_permission.xml b/OsmAnd/res/layout/preference_permission.xml
new file mode 100644
index 0000000000..d793433529
--- /dev/null
+++ b/OsmAnd/res/layout/preference_permission.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/preference_with_descr.xml b/OsmAnd/res/layout/preference_with_descr.xml
index f9e01e34a9..3ed18db7ae 100644
--- a/OsmAnd/res/layout/preference_with_descr.xml
+++ b/OsmAnd/res/layout/preference_with_descr.xml
@@ -11,28 +11,20 @@
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:minHeight="@dimen/setting_list_item_large_height"
tools:background="?android:attr/selectableItemBackground">
-
-
-
-
-
+ 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:tint="@color/active_color_primary_light" />
diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml
index f2d8671bba..933c75c9cf 100644
--- a/OsmAnd/res/values-ar/strings.xml
+++ b/OsmAnd/res/values-ar/strings.xml
@@ -3351,7 +3351,6 @@
تتيح لك مشاركة الموقع الحالي باستخدام تسجيل الرحلة.
تعقب عبر الانترنت
دقة التسجيل
- يمكنك العثور على جميع ملاحظاتك في القائمة — أماكني المفضلة — ملاحظات
ملاحظات الفيديو
ملاحظات الصورة
إعادة حساب الطريق
@@ -3362,7 +3361,5 @@
OSM
سترى الأيقونة فقط أثناء الملاحة أو أثناء التحرك.
معدل
- يمكنك العثور على جميع المسارات المسجلة الخاصة بك في القائمة - مكاني - المسارات أو في مجلد أوسماند باستخدام مدير الملفات.
- يمكنك عرض جميع التعديلات التي قمت بإلغاء تحميلها أو أخطاء نظام التشغيل في القائمة - الأماكن الخاصة بي - تعديلات OSM. لا يتم عرض النقاط التي تم تحميلها في أوسماند.
تظهر أيقونة الخريطة فقط على الخريطة ، وتتغير أثناء التنقل إلى أيقونة التنقل.
\ No newline at end of file
diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml
index 87ab71cdc0..f97a44ade5 100644
--- a/OsmAnd/res/values-ca/strings.xml
+++ b/OsmAnd/res/values-ca/strings.xml
@@ -3444,19 +3444,19 @@ Abasta l\'àrea: %1$s x %2$s
Permet compartir la ubicació actual utilitzant l\'enregistrament de viatges.
Seguiment en línia
Precisió de registre
- Pots trobar totes les teves notes a Menú — Els meus llocs — Notes
+ Pots trobar totes les teves notes a %1$s
Notes de vídeo
Notes de fotos
OSM
Inclou la direcció
Desa l\'orientació a cada fita mentre es fa un enregistrament.
- Podeu trobar els vostres enregistraments a Menú — Els meus llocs — Traces o, amb un gestor de fitxers, al directori d\'OsmAnd .
+ Podeu trobar els vostres enregistraments a %1$s o, amb un gestor de fitxers, al directori d\'OsmAnd .
Recàlcul de la ruta
Anunci
Nom d\'usuari i contrasenya
Aquesta configuració del connector és global i afecta tots els perfils.
Edició d\'OpenStreetMap
- 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.
+ Podeu veure totes les vostres edicions no enviades o els errors OSM a %1$s. Els punts enviats no es mostren a OsmAnd.
Només veureu la icona mentre navegueu o us mogueu.
La icona de mapa només es mostra al mapa i es canvia a la icona de navegació quan durant aquesta.
Aquí podeu veure i compartir els enregistraments de l\'aplicació
diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml
index b29a0e5b52..6bab01067d 100644
--- a/OsmAnd/res/values-da/strings.xml
+++ b/OsmAnd/res/values-da/strings.xml
@@ -3443,8 +3443,8 @@ Repræsenterer område: %1$s x %2$s
Tillader at dele den aktuelle placering ved hjælp af tur-optagelse.
Online sporing
Lognøjagtighed
- Find alle optagede spor i Menu - Foretrukne - Spor eller i OsmAnd mappen vha. filhåndtering.
- Find alle noter i Menu - Foretrukne - Noter
+ Find alle optagede spor i %1$s eller i OsmAnd mappen vha. filhåndtering.
+ Find alle noter i %1$s
Video noter
Foto noter
Genberegning af rute
@@ -3452,7 +3452,7 @@ Repræsenterer område: %1$s x %2$s
Brugernavn og adgangskode
Indstillinger for udvidelsen er globale, og gælder for alle profiler.
OpenStreetMap redigering
- Se alle ikke overførte redigeringer eller OSM fejl i Menu - Foretrukne - OSM-redigeringer. Overførte punkter vises ikke i OsmAnd.
+ Se alle ikke overførte redigeringer eller OSM fejl i %1$s. Overførte punkter vises ikke i OsmAnd.
OSM
Ikonet vises kun under navigation eller under bevægelse.
Kortikon vises kun på kortet og skifter under navigation til navigationsikon.
diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml
index f0e10fd40b..1a762b81f2 100644
--- a/OsmAnd/res/values-eo/strings.xml
+++ b/OsmAnd/res/values-eo/strings.xml
@@ -3413,8 +3413,8 @@ Indikas lokon: %1$s x %2$s"
Kunhavigi vian nunan pozicion per registrado de kurso.
Perreta spurado
Precizo de registrado
- Vi povas trovi ĉiujn registritajn spurojn per la menuo → “miaj ejoj” → “spuroj” aŭ en la dosierujo OsmAnd (uzu dosier‑esplorilon).
- Vi povas trovi ĉiujn notojn per la menuo → “miaj ejoj” → “notoj”.
+ Vi povas trovi ĉiujn registritajn spurojn per la %1$s aŭ en la dosierujo OsmAnd (uzu dosier‑esplorilon).
+ Vi povas trovi ĉiujn notojn per la %1$s.
Videaj notoj
Fotaj notoj
Rekalkuli kurson
@@ -3423,7 +3423,7 @@ Indikas lokon: %1$s x %2$s"
Uzantnomo kaj pasvorto
Agordoj pri tiu ĉi kromprogramo influas al ĉiuj profiloj.
OpenStreetMap-redaktilo
- Vi povas vidi ĉiujn viajn nesenditajn redaktojn kaj rimarkojn per la menuo → “miaj ejoj” → “OSM‑redaktoj”. Senditaj punktoj malaperos el OsmAnd.
+ Vi povas vidi ĉiujn viajn nesenditajn redaktojn kaj rimarkojn per la %1$s. Senditaj punktoj malaperos el OsmAnd.
OSM
La emblemo montriĝos nur dum navigi aŭ dum moviĝi.
Map‑emblemo montriĝas nur dum foliumi mapon kaj ŝanĝiĝas dum navigi al la emblemo de navigo.
diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml
index 273ea20904..b757bbf163 100644
--- a/OsmAnd/res/values-es-rAR/strings.xml
+++ b/OsmAnd/res/values-es-rAR/strings.xml
@@ -3445,8 +3445,8 @@ Lon %2$s
Permite compartir la ubicación actual utilizando la grabación del viaje.
Seguimiento en línea
Precisión de registro
- Puedes encontrar todas tus trazas grabadas en «Menú — Mi sitios — Trazas» o en la carpeta OsmAnd usando el administrador de archivos.
- Puedes encontrar todas tus notas en «Menú — Mis sitios — Notas»
+ Puedes encontrar todas tus trazas grabadas en «%1$s» o en la carpeta OsmAnd usando el administrador de archivos.
+ Puedes encontrar todas tus notas en «%1$s»
Notas de video
Notas fotográficas
Recálculo de la ruta
@@ -3454,7 +3454,7 @@ Lon %2$s
Nombre de usuario y contraseña
Los ajustes de este complemento es global y se aplica a todos los perfiles.
Edición de OpenStreetMap
- 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.
+ Puedes ver todas tus ediciones no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd.
OSM
Sólo verás el icono durante la navegación o mientras te mueves.
El icono del mapa aparece sólo en el mapa y cambia mientras se navega hacia el icono de navegación.
diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml
index 194ff8d16f..6cc331d621 100644
--- a/OsmAnd/res/values-es-rUS/strings.xml
+++ b/OsmAnd/res/values-es-rUS/strings.xml
@@ -3439,8 +3439,8 @@ Lon %2$s
Permite compartir la ubicación actual utilizando la grabación del viaje.
Seguimiento en línea
Precisión de registro
- Puedes encontrar todas tus trazas grabadas en «Menú — Mi sitios — Trazas» o en la carpeta OsmAnd usando el administrador de archivos.
- Puedes encontrar todas tus notas en «Menú — Mis sitios — Notas»
+ Puedes encontrar todas tus trazas grabadas en «%1$s» o en la carpeta OsmAnd usando el administrador de archivos.
+ Puedes encontrar todas tus notas en «%1$s»
Notas de video
Notas fotográficas
Recálculo de la ruta
@@ -3448,7 +3448,7 @@ Lon %2$s
Nombre de usuario y contraseña
Los ajustes de este complemento es global y se aplica a todos los perfiles.
Edición de OpenStreetMap
- 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.
+ Puedes ver todas tus ediciones no subidas o errores de OSM en «%1$s». Los puntos subidos no se muestran en OsmAnd.
OSM
Sólo verás el icono durante la navegación o mientras te mueves.
El icono del mapa aparece sólo en el mapa y cambia mientras se navega hacia el icono de navegación.
diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml
index 76ae2ae3c9..b3dbc04ba7 100644
--- a/OsmAnd/res/values-es/strings.xml
+++ b/OsmAnd/res/values-es/strings.xml
@@ -3430,8 +3430,8 @@
Te permite compartir la ubicación actual utilizando la grabación del viaje.
Seguimiento en línea
Precisión de registro
- Puedes encontrar todas las trazas grabadas en Menú — Mis sitios — Trazas o en la carpeta OsmAnd utilizando el administrador de archivos.
- Puedes encontrar todas tus notas en Menú - Mis sitios - Notas
+ Puedes encontrar todas las trazas grabadas en %1$s o en la carpeta OsmAnd utilizando el administrador de archivos.
+ Puedes encontrar todas tus notas en %1$s
Notas de video
Notas de foto
Recálculo de la ruta
@@ -3439,7 +3439,7 @@
Nombre de usuario y clave
La configuración de este complemento es global y se aplica a todos los perfiles.
Edición de OpenStreetMap
- 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.
+ Puedes ver todas las ediciones y errores de osm no enviadas en %1$s. Los puntos enviados no se muestran en OsmAnd.
OSM
Verás el icono sólo durante la navegación o mientras te estés moviendo.
El icono del mapa solo aparece en el mapa y cambia durante la navegación al icono de navegación.
diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml
index a72c3f8aac..d2cc546d0c 100644
--- a/OsmAnd/res/values-et/strings.xml
+++ b/OsmAnd/res/values-et/strings.xml
@@ -3365,8 +3365,8 @@
Lubab sul jagada praegust asukohta kasutades reisi salvestamist.
Veebis jälgimine
Logimise täpsus
- Kõik oma salvestatud rajad leiad Menüü- Minu koht - Rajad või OsmAd kataloogist failihalduri abil.
- Kõik oma märkmed leiad Menüü - Minu kohad - Märkmed
+ Kõik oma salvestatud rajad leiad %1$s või OsmAd kataloogist failihalduri abil.
+ Kõik oma märkmed leiad %1$s
Video märkmed
Foto märkmed
Teekonna ümberarvutamine
@@ -3374,7 +3374,7 @@
Kasutajanimi ja salasõna
Selle lisa seaded kehtivad kogu rakenduses ja rakenduvad kõikidele profiilidele.
OpenStreetMap muutmine
- Kõiki üleslaadimata muudatusi või osm vigu saad vaadata menüüs Menüü - Minu kohad - OSM muudatused. Üleslaaditud punkte OsmAnd ei kuva.
+ Kõiki üleslaadimata muudatusi või osm vigu saad vaadata menüüs %1$s. Üleslaaditud punkte OsmAnd ei kuva.
OSM
Ikooni näed ainult navigeerimise või liikumise ajal.
Kaardiikoon kuvatakse ainult kaardil ja muutub navigeerimise ajal navigeerimise ikooniks.
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index e0b4a97498..42f6dac2f5 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -3407,8 +3407,8 @@ représentant la zone : %1$s x %2$s
Permet de partager votre position actuelle grâce à l\'enregistrement du trajet.
Suivi en ligne
Précision de l\'enregistrement
- Retrouvez toutes vos traces enregistrées dans le Menu : Mon emplacement > Traces ou dans le dossier OsmAnd via votre gestionnaire de fichiers.
- Retrouvez toutes vos notes dans le menu : Mon emplacement > Notes
+ Retrouvez toutes vos traces enregistrées dans le %1$s ou dans le dossier OsmAnd via votre gestionnaire de fichiers.
+ Retrouvez toutes vos notes dans le %1$s
Notes vidéo
Notes photo
Recalcul de l\'itinéraire
@@ -3416,7 +3416,7 @@ représentant la zone : %1$s x %2$s
Nom d\'utilisateur et mot de passe
Ces paramètres de greffon sont globaux et s\'appliquent à tous les profils.
Édition OpenStreetMap
- Vous pouvez consulter toutes vos modifications non envoyées comme vos bugs OSM dans le menu : Mes emplacements > Modifications OSM. Les points envoyés ne s\'affichent plus dans OsmAnd.
+ 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.
OSM
Vous ne verrez l\'icône que lors de la navigation ou en déplacement.
L \'icône Carte n\'apparaît que sur la carte et est remplacée par l\'icône Navigation lors de la navigation.
diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml
index 1e5bc70295..6c9e395110 100644
--- a/OsmAnd/res/values-gl/strings.xml
+++ b/OsmAnd/res/values-gl/strings.xml
@@ -3466,8 +3466,8 @@ Lon %2$s
Permite compartir a localización actual empregando a gravación da viaxe.
Seguimento en liña
Precisión de rexistro
- Podes atopar todas as túas pistas gravadas en Menú — Os meus lugares — Pista ou no cartafol OsmAnd empregando o xestor de ficheiros.
- Podes atopar todas as túas notas en Menú - Os meus lugares - Notas
+ Podes atopar todas as túas pistas gravadas en %1$s ou no cartafol OsmAnd empregando o xestor de ficheiros.
+ Podes atopar todas as túas notas en %1$s
Notas de vídeo
Notas de imaxe
Recálculo da ruta
@@ -3475,7 +3475,7 @@ Lon %2$s
Nome de usuario e contrasinal
A configuración deste engadido é global e se aplica a todos os perfís.
Edición do OpenStreetMap
- 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.
+ 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.
OSM
Ollarás a icona só durante a navegación ou mentres esteas a moverte.
A icona do mapa só aparece no mapa e muda durante a navegación á icona de navegación.
diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml
index 50c132dbfc..554b63d85d 100644
--- a/OsmAnd/res/values-he/strings.xml
+++ b/OsmAnd/res/values-he/strings.xml
@@ -3424,8 +3424,6 @@
לאפשר לך לשתף את המיקום הנוכחי באמצעות הקלטת המסלול.
מעקב מקוון
דיוק תיעוד ביומן
- באפשרותך למצוא את כל המסלול שהקלטת בתפריט - המיקום שלי - מסלולים או בתיקייה של OsmAnd בעזרת מנהל קבצים.
- באפשרותך למצוא את כל ההערות שכתבת תחת תפריט - המיקומים שלי - פתקים
הערות וידאו
הערות בתמונות
חישוב מסלול מחדש
@@ -3433,7 +3431,6 @@
שם משתמש וססמה
הגדרות התוסף הזה הן גלובליות וחלות על כל הפרופילים.
עריכה של OpenStreetMap
- באפשרותך לצפות בכל העריכות שטרם העלית דרך התפריט - המקומות שלי - עריכות OSM. הנקודות שהועלו לא מופיעות ב־OsmAnd.
OSM
הסמל יופיע רק בזמן הניווט או בזמן תזוזה.
סמל המפה מופיע במפה בלבד והוא מתחלף בעת הניווט לסמל הניווט.
diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml
index 0ed369e2c8..40a2e61c33 100644
--- a/OsmAnd/res/values-hu/strings.xml
+++ b/OsmAnd/res/values-hu/strings.xml
@@ -3434,8 +3434,8 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
Lehetővé teszi, hogy az útvonal rögzítésével megossza aktuális pozícióját.
Online nyomvonalrögzítés
Naplózás pontossága
- Az összes rögzített nyomvonal megtalálható a Menü > Saját helyek > Nyomvonalaim helyen vagy a fájlkezelővel az OsmAnd mappában.
- Az összes jegyzetét megtalálja a Menü > Saját helyek > Jegyzetek helyen
+ Az összes rögzített nyomvonal megtalálható a %1$s helyen vagy a fájlkezelővel az OsmAnd mappában.
+ Az összes jegyzetét megtalálja a %1$s helyen
Videojegyzetek
Fényképes jegyzetek
Útvonal újraszámítása
@@ -3443,7 +3443,7 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
Felhasználónév és jelszó
Ezek a bővítménybeállítások globálisak, és minden profilra vonatkoznak.
OpenStreetMap-szerkesztés
- Az összes még fel nem töltött szerkesztés vagy OSM-hiba megtalálható a Menü > Saját helyek > OSM-szerkesztések helyen. A már feltöltött pontok nem láthatók az OsmAndban.
+ 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.
OSM
Az ikon csak navigáció vagy mozgás közben lesz látható.
A térképikon csak a térképen jelenik meg, navigáció közben pedig navigációs ikonra vált.
diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml
index 0c0d80ab11..fc00ff1325 100644
--- a/OsmAnd/res/values-it/strings.xml
+++ b/OsmAnd/res/values-it/strings.xml
@@ -3432,8 +3432,8 @@ Rappresenta l\'area: %1$s x %2$s
Permette di condividere la posizione corrente utilizzando la registrazione del viaggio.
Tracciamento online
Precisione di registrazione
- Puoi trovare tutte le tue tracce registrate in Menu - I miei luoghi - Le mie tracce o nella cartella OsmAd utilizzando il file manager.
- Puoi trovare tutte le tue note in Menu - I miei luoghi - Note
+ Puoi trovare tutte le tue tracce registrate in %1$s o nella cartella OsmAd utilizzando il file manager.
+ Puoi trovare tutte le tue note in %1$s
Note video
Note fotografiche
Ricalcolo del percorso
diff --git a/OsmAnd/res/values-large/sizes.xml b/OsmAnd/res/values-large/sizes.xml
index 58975895e0..13ae7b9b65 100644
--- a/OsmAnd/res/values-large/sizes.xml
+++ b/OsmAnd/res/values-large/sizes.xml
@@ -237,4 +237,7 @@
21dp
+ 108dp
+ 108dp
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml
index 6c04639bce..5414b0c8dc 100644
--- a/OsmAnd/res/values-nb/strings.xml
+++ b/OsmAnd/res/values-nb/strings.xml
@@ -3441,8 +3441,8 @@
Tillater deg å dele nåværende plassering ved bruk av turopptak.
Nettbasert sporing
Loggingsnøyaktighet
- Du kan finne alle dine innspilte spor i Meny → Mitt sted → Spor, eller i OsmAnd-mappen.
- Du finner alle dine notater i Meny → Mine steder → Notater
+ Du kan finne alle dine innspilte spor i %1$s, eller i OsmAnd-mappen.
+ Du finner alle dine notater i %1$sr
Videonotater
Bildenotater
Ruteomberegning
@@ -3450,7 +3450,7 @@
Brukernavn og passord
Innstillinger av dette programtillegget har innvirkning på alle profiler.
OpenStreetMap-redigering
- Du kan vise alle dine uopplastede redigeringer eller OSM-feil i Meny → Mine steder → OSM-redigeringer. Opplastede punkter viser ikke i OsmAnd.
+ Du kan vise alle dine uopplastede redigeringer eller OSM-feil i %1$s. Opplastede punkter viser ikke i OsmAnd.
Du vil se ikonet kun under navigasjon eller bevegelse.
Kartikon vises kun på kartet, og endrer seg under navigasjon til navigasjonsikonet.
\ No newline at end of file
diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml
index a1e94caf47..dedea85c89 100644
--- a/OsmAnd/res/values-nl/strings.xml
+++ b/OsmAnd/res/values-nl/strings.xml
@@ -3311,8 +3311,8 @@ voor Gebied: %1$s x %2$s
Laat u toe uw positie te delen dankzij reisopname.
Online volgen
Opnamenauwkeurigheid
- U kan al uw opgenomen tracks terugvinden bij Menu - Mijn plaatsen - Tracks of in OsmAnd-map met een bestand verkenner.
- U kan al uw notities terugvinden bij Menu - Mijn plaatsen - Notities
+ U kan al uw opgenomen tracks terugvinden bij %1$s of in OsmAnd-map met een bestand verkenner.
+ U kan al uw notities terugvinden bij %1$s
Videonotities
Fotonotities
Route herberekening
@@ -3320,7 +3320,7 @@ voor Gebied: %1$s x %2$s
Gebruikersnaam en wachtwoord
Deze plugin instellingen zijn globaal en hebben betrekking op alle profielen.
OpenStreetMap Bewerking
- 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.
+ U kan al uw niet-geüploade bewerkingen of osm fouten zien in %1$s. Geüploade punten ziet u niet in OsmAnd.
OSM
U zal het icoon enkel zien tijdens het navigeren of bewegen.
Kaarticoon verschijnt op de kaart en wijzigt slechts bij het navigeren in het navigatie-icoon.
diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml
index 6d68a49f8a..a2047351a4 100644
--- a/OsmAnd/res/values-pt-rBR/strings.xml
+++ b/OsmAnd/res/values-pt-rBR/strings.xml
@@ -3421,8 +3421,8 @@ Pôr do Sol: %2$s
Permite compartilhar a localização atual usando a gravação de viagem.
Rastreamento online
Precisão de registro
- Você pode encontrar todas as suas faixas gravadas em Menu - Meu lugar - Faixas ou na pasta OsmAd usando o gerenciador de arquivos.
- Você pode encontrar todas as suas anotações em Menu - Meus lugares - Notas
+ Você pode encontrar todas as suas faixas gravadas em %1$ss ou na pasta OsmAd usando o gerenciador de arquivos.
+ Você pode encontrar todas as suas anotações em %1$s
Notas de vídeo
Notas fotográficas
Recálculo da rota
@@ -3430,7 +3430,7 @@ Pôr do Sol: %2$s
Usuário e senha
As configurações deste plug-in são globais e se aplicam a todos os perfis.
Edição de OpenStreetMap
- 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.
+ Você pode ver todos os erros de osm do editor carregado em %1$s. Os pontos enviados não são exibidos no OsmAnd.
OSM
Você verá o ícone apenas enquanto estiver navegando ou em movimento.
O ícone do mapa aparece apenas no mapa e é alterado enquanto estiver navegando para o ícone de navegação.
diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml
index 75101a1860..105e112e12 100644
--- a/OsmAnd/res/values-sc/strings.xml
+++ b/OsmAnd/res/values-sc/strings.xml
@@ -3434,8 +3434,8 @@ Pro praghere iscrie su còdighe intreu
Ti permitit de cumpartzire sa positzione atuale impreende sa registratzione de su biàgiu.
Arrastamentu in lìnia
Pretzisione de registratzione
- Podes agatare totu sas rastas registradas tuas in Menù — Logos meos — Rastas o in sa cartella de OsmAnd impreende su gestore de documentos.
- Podes agatare totu sas notas tuas in Menù — Logos meos — Notas
+ Podes agatare totu sas rastas registradas tuas in %1$s o in sa cartella de OsmAnd impreende su gestore de documentos.
+ Podes agatare totu sas notas tuas in %1$s
Vìdeo-notas
Foto-notas
Ricàlculu de s\'àndala
@@ -3443,7 +3443,7 @@ Pro praghere iscrie su còdighe intreu
Nùmene impreadore e crae
Sas impostatziones de s\'estensione sunt globales, e si aplicant a totu sos profilos.
Modìfica de OpenStreetMap
- 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.
+ 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.
OSM
As a bìdere s\'icona petzi durante sa navigatzione o su movimentu.
S\'icona de sa mapa aparit in sa mapa ebbia, e divenit s\'icona de navigatzione durante sa navigatzione.
diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml
index 69f417ec0f..2771fc070f 100644
--- a/OsmAnd/res/values-tr/strings.xml
+++ b/OsmAnd/res/values-tr/strings.xml
@@ -3385,8 +3385,6 @@
Seyahat kaydını kullanarak geçerli konumunuzu paylaşmaya izin verin.
Çevrimiçi takip etme
Kayıt tutma doğruluğu
- Kaydedilen tüm yol-izlerinizi Menü - Benim yerim - Yol-izleri içinde veya dosya yöneticisini kullanarak OsmAnd klasöründe bulabilirsiniz.
- Tüm notlarınızı Menü - Yerlerim - Notlar bölümünde bulabilirsiniz
Video notları
Fotoğraf notları
Rotanın yeniden hesaplanması
@@ -3394,7 +3392,7 @@
Kullanıcı adı ve parola
Bu eklenti ayarları globaldir ve tüm profiller için geçerlidir.
OpenStreetMap Düzenleme
- 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.
+ 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.
OSM
Simgeyi yalnızca navigasyon sırasında veya hareket halindeyken göreceksiniz.
Harita simgesi yalnızca haritada görünür ve navigasyon esnasında navigasyon simgesine dönüşür.
diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml
index bc2f7d167b..cb248d64a6 100644
--- a/OsmAnd/res/values-uk/strings.xml
+++ b/OsmAnd/res/values-uk/strings.xml
@@ -3425,8 +3425,8 @@
Дозволяє ділитися поточним місцезнаходженням, використовуючи запис поїздки.
Мережеве відстеження
Точність часопису
- Ви можете знайти всі записи в Меню - Мої місця - Треки або в теці OsmAnd за допомогою файлового провідника.
- Ви можете знайти всі свої примітки в Меню - Мої місця - Примітки
+ Ви можете знайти всі записи в %1$s або в теці OsmAnd за допомогою файлового провідника.
+ Ви можете знайти всі свої примітки в %1$s
Відеопримітки
Світлинопримітки
Перерахунок маршруту
@@ -3434,7 +3434,7 @@
Ім\'я користувача і пароль
Налаштування цього втулка є всеохопними та стосуються всіх профілів.
OpenStreetMap редагування
- Ви можете переглянути всі не завантажені зміни або помилки в OSM в Меню - Мої місця - Правки OSM. Завантажені точки не відображаються в OsmAnd.
+ Ви можете переглянути всі не завантажені зміни або помилки в OSM в %1$s. Завантажені точки не відображаються в OsmAnd.
OSM
Ви побачите значок тільки під час навігації або під час переміщення.
Образок мапи відображається лише на мапі та змінюється під час навігації до образка навігації.
diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml
index b145dcc9ab..5d0d6d0049 100644
--- a/OsmAnd/res/values-zh-rTW/strings.xml
+++ b/OsmAnd/res/values-zh-rTW/strings.xml
@@ -3422,8 +3422,6 @@
允許您使用旅程錄製來分享目前的位置。
線上追蹤
記錄精度
- 您可以在選單 → 我的收藏 → 軌跡或使用檔案管理員在 OsmAnd 的資料夾中找到您所有已紀錄的軌跡。
- 您可以在選單 → 我的收藏 → 註記中找到您所有的註記
視訊註記
照片註記
路徑重新計算
@@ -3431,7 +3429,6 @@
使用者名稱與密碼
此外掛程式設定是全域設定,並會套用到所有設定檔。
開放街圖編輯
- 您可以在選單 → 我的收藏 → OSM 編輯中檢視您所有未上傳的編輯或開放街圖的問題。已上傳的點不會在 OsmAnd 中顯示。
OSM
僅在導航或移動時,您才會看到該圖示。
地圖圖示只會顯示在地圖上,並會在導航時換成導航圖示。
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index 0c433a3535..0719147898 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -350,5 +350,7 @@
64dp
18dp
+ 72dp
+ 72dp
\ No newline at end of file
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 8501b508a1..0400e15f62 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -11,9 +11,37 @@
Thx - Hardy
-->
+ Permission is required to use this option.
Check and share detailed logs of the application
No routing rules in \'%1$s\'. Please choose another file.
Select a supported %1$s extension file instead.
+ 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.
+ 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.
+ 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.
+ 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".
+ 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.
+ 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.
+ Recommendation: It is hard to predict what will be recorded and what not, it may be best to turn this filter off.
+ 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.
+ 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.
+ 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.
+ 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.
+ Time buffer
+ Tracking interval
+ Web address
+ Specify the web address with parameter syntax: lat={0}, lon={1}, timestamp={2}, hdop={3}, altitude={4}, speed={5}, bearing={6}.
+ Notification
+ Minimum speed
+ Minimum accuracy
+ Minimum displacement
+ Menu — My places — Tracks
+ Menu — My places — Notes
+ Menu — My places — OSM Edits
+ Reset plugin settings to default
+ Recorder split
+ Use system app
+ Camera shutter sound
+ Authorization is successful
Import from file
Import routing file
Import profile
@@ -24,8 +52,8 @@
Allows sharing current location using trip recording.
Online tracking
Logging accuracy
- Your recorded tracks are in \'Menu\' → \'My place\' → \'Tracks\', or the OsmAnd folder.
- Your OSM notes are in \'Menu\' → \'My places\' → \'OSM edits\'.
+ Your recorded tracks are in %1$s, or the OsmAnd folder.
+ Your OSM notes are in %1$s.
Video notes
Photo notes
Route recalculation
@@ -33,7 +61,7 @@
Username and password
These settings apply to all profiles.
OSM editing
- View your edits or OSM bugs not yet uploaded in \'Menu\' → \'My places\' — \'OSM edits\'. Uploaded points will not show any more.
+ View your edits or OSM bugs not yet uploaded in %1$s. Uploaded points will not show any more.
OSM
Icon only shown while navigating or moving.
Map icon only shown on the map.
diff --git a/OsmAnd/res/xml/accessibility_settings.xml b/OsmAnd/res/xml/accessibility_settings.xml
index c11ba73e18..f69a4fcabf 100644
--- a/OsmAnd/res/xml/accessibility_settings.xml
+++ b/OsmAnd/res/xml/accessibility_settings.xml
@@ -97,7 +97,7 @@
android:key="reset_to_default"
android:layout="@layout/preference_button"
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" />
\ No newline at end of file
diff --git a/OsmAnd/res/xml/development_settings.xml b/OsmAnd/res/xml/development_settings.xml
new file mode 100644
index 0000000000..6382759667
--- /dev/null
+++ b/OsmAnd/res/xml/development_settings.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/xml/live_monitoring.xml b/OsmAnd/res/xml/live_monitoring.xml
index 32352e5b6b..61c76a9fd1 100644
--- a/OsmAnd/res/xml/live_monitoring.xml
+++ b/OsmAnd/res/xml/live_monitoring.xml
@@ -6,7 +6,7 @@
@@ -14,21 +14,21 @@
diff --git a/OsmAnd/res/xml/monitoring_settings.xml b/OsmAnd/res/xml/monitoring_settings.xml
index 993ea0ea10..ffcc2df3f4 100644
--- a/OsmAnd/res/xml/monitoring_settings.xml
+++ b/OsmAnd/res/xml/monitoring_settings.xml
@@ -36,19 +36,19 @@
+
+
@@ -76,6 +83,18 @@
tools:icon="@drawable/ic_action_folder"
tools:summary="Not selected" />
+
+
+
+
@@ -104,14 +123,14 @@
tools:icon="@drawable/ic_action_folder" />
+
+
+ android:title="@string/multimedia_rec_split_title" />
@@ -126,14 +133,14 @@
tools:icon="@drawable/ic_action_folder" />
diff --git a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
index d95064493d..1eb0cea4f1 100644
--- a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
+++ b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
@@ -7,6 +7,7 @@ import android.support.annotation.NonNull;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.settings.BaseSettingsFragment;
@@ -27,6 +28,16 @@ public class AccessibilityPlugin extends OsmandPlugin {
public AccessibilityPlugin(OsmandApplication 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
diff --git a/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java b/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
index 6e1868124f..86b1711a0f 100644
--- a/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
+++ b/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
@@ -1,17 +1,25 @@
package net.osmand.access;
+import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference;
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.access.AccessibilityMode;
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.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.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 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() {
boolean accessibilityEnabled = app.accessibilityEnabledForMode(getSelectedAppMode());
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++) {
Preference preference = screen.getPreference(i);
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);
}
}
diff --git a/OsmAnd/src/net/osmand/aidl/ConnectedApp.java b/OsmAnd/src/net/osmand/aidl/ConnectedApp.java
index 112c533175..b207bd853c 100644
--- a/OsmAnd/src/net/osmand/aidl/ConnectedApp.java
+++ b/OsmAnd/src/net/osmand/aidl/ConnectedApp.java
@@ -171,7 +171,8 @@ public class ConnectedApp implements Comparable {
if (layer != null) {
TextInfoWidget control = createWidgetControl(mapActivity, widget.getId());
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,
widget.getMenuTitle(), "aidl_widget_" + widget.getId(), false, widget.getOrder());
if (!mapActivity.getMapLayers().getMapWidgetRegistry().isVisible(widgetInfo.key)) {
diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
index 51d652e7db..2c98608e76 100644
--- a/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
+++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java
@@ -40,6 +40,7 @@ import net.osmand.plus.AppInitializer.AppInitializeListener;
import net.osmand.plus.AppInitializer.InitEvents;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.ContextMenuAdapter;
+import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.GPXDatabase.GpxDataItem;
import net.osmand.plus.GpxSelectionHelper;
@@ -318,7 +319,8 @@ public class OsmandAidlApi {
ApplicationMode.regWidgetVisibility(widget.getId(), (ApplicationMode[]) null);
TextInfoWidget control = connectedApp.createWidgetControl(mapActivity, widgetId);
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,
menuIconId, widget.getMenuTitle(), "aidl_widget_" + widgetId,
false, widget.getOrder());
diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
index 9aa4551a84..a5094f2361 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
@@ -57,6 +57,8 @@ public abstract class OsmandPlugin {
private static List allPlugins = new ArrayList();
private static final Log LOG = PlatformUtil.getLog(OsmandPlugin.class);
+ protected List pluginPreferences = new ArrayList<>();
+
private boolean active;
private String installURL = null;
@@ -81,6 +83,10 @@ public abstract class OsmandPlugin {
return null;
}
+ public List getPreferences() {
+ return pluginPreferences;
+ }
+
public String getPrefsDescription() {
return null;
}
@@ -628,4 +634,46 @@ public abstract class OsmandPlugin {
p.addMyPlacesTab(favoritesActivity, mTabs, intent);
}
}
-}
+
+ protected OsmandSettings.CommonPreference registerBooleanPreference(OsmandApplication app, String prefId, boolean defValue) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerBooleanPreference(prefId, defValue);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+
+ private OsmandSettings.CommonPreference registerBooleanAccessibilityPreference(OsmandApplication app, String prefId, boolean defValue) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerBooleanAccessibilityPreference(prefId, defValue);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+
+ protected OsmandSettings.CommonPreference registerStringPreference(OsmandApplication app, String prefId, String defValue) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerStringPreference(prefId, defValue);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+
+ protected OsmandSettings.CommonPreference registerIntPreference(OsmandApplication app, String prefId, int defValue) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerIntPreference(prefId, defValue);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+
+ protected OsmandSettings.CommonPreference registerLongPreference(OsmandApplication app, String prefId, long defValue) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerLongPreference(prefId, defValue);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+
+ protected OsmandSettings.CommonPreference registerFloatPreference(OsmandApplication app, String prefId, float defValue) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerFloatPreference(prefId, defValue);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+
+ protected OsmandSettings.CommonPreference registerEnumIntPreference(OsmandApplication app, String prefId, Enum defaultValue, Enum[] values, Class clz) {
+ OsmandSettings.CommonPreference preference = app.getSettings().registerEnumIntPreference(prefId, defaultValue, values, clz);
+ pluginPreferences.add(preference);
+ return preference;
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
index 32bd59b209..4137fd479d 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
@@ -410,25 +410,25 @@ public class OsmandSettings {
}
public boolean copyPreferencesFromProfile(ApplicationMode modeFrom, ApplicationMode modeTo) {
+ return copyProfilePreferences(modeFrom, modeTo, new ArrayList(registeredPreferences.values()));
+ }
+
+ public boolean copyProfilePreferences(ApplicationMode modeFrom, ApplicationMode modeTo, List profilePreferences) {
SettingsEditor settingsEditor = settingsAPI.edit(getProfilePreferences(modeTo));
- for (OsmandPreference pref : registeredPreferences.values()) {
+ for (OsmandPreference pref : profilePreferences) {
if (pref instanceof CommonPreference && !((CommonPreference) pref).global) {
CommonPreference profilePref = (CommonPreference) pref;
- if (profilePref.isSetForMode(modeFrom) || profilePref.hasDefaultValueForMode(modeFrom)) {
- Object copiedValue = profilePref.getModeValue(modeFrom);
- if (copiedValue instanceof String) {
- settingsEditor.putString(pref.getId(), (String) copiedValue);
- } else if (copiedValue instanceof Boolean) {
- settingsEditor.putBoolean(pref.getId(), (Boolean) copiedValue);
- } else if (copiedValue instanceof Float) {
- settingsEditor.putFloat(pref.getId(), (Float) copiedValue);
- } else if (copiedValue instanceof Integer) {
- settingsEditor.putInt(pref.getId(), (Integer) copiedValue);
- } else if (copiedValue instanceof Long) {
- settingsEditor.putLong(pref.getId(), (Long) copiedValue);
- }
- } else {
- settingsEditor.remove(pref.getId());
+ Object copiedValue = profilePref.getModeValue(modeFrom);
+ if (copiedValue instanceof String) {
+ settingsEditor.putString(pref.getId(), (String) copiedValue);
+ } else if (copiedValue instanceof Boolean) {
+ settingsEditor.putBoolean(pref.getId(), (Boolean) copiedValue);
+ } else if (copiedValue instanceof Float) {
+ settingsEditor.putFloat(pref.getId(), (Float) copiedValue);
+ } else if (copiedValue instanceof Integer) {
+ settingsEditor.putInt(pref.getId(), (Integer) copiedValue);
+ } else if (copiedValue instanceof Long) {
+ settingsEditor.putLong(pref.getId(), (Long) copiedValue);
}
}
}
@@ -439,6 +439,16 @@ public class OsmandSettings {
return settingsAPI.edit(getProfilePreferences(mode)).clear().commit();
}
+ public boolean resetProfilePreferences(ApplicationMode mode, List 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;
// this value string is synchronized with settings_pref.xml preference name
@@ -1107,6 +1117,16 @@ public class OsmandSettings {
return p;
}
+ @SuppressWarnings("unchecked")
+ public CommonPreference registerBooleanAccessibilityPreference(String id, boolean defValue) {
+ if (registeredPreferences.containsKey(id)) {
+ return (CommonPreference) registeredPreferences.get(id);
+ }
+ BooleanPreference p = new BooleanAccessibilityPreference(id, defValue);
+ registeredPreferences.put(id, p);
+ return p;
+ }
+
@SuppressWarnings("unchecked")
public CommonPreference registerStringPreference(String id, String defValue) {
if (registeredPreferences.containsKey(id)) {
@@ -1147,6 +1167,16 @@ public class OsmandSettings {
return p;
}
+ @SuppressWarnings("unchecked")
+ public CommonPreference registerEnumIntPreference(String id, Enum defaultValue, Enum[] values, Class clz) {
+ if (registeredPreferences.containsKey(id)) {
+ return (CommonPreference) registeredPreferences.get(id);
+ }
+ EnumIntPreference p = new EnumIntPreference(id, defaultValue, values);
+ registeredPreferences.put(id, p);
+ return p;
+ }
+
public final CommonPreference RULER_MODE = new EnumIntPreference<>("ruler_mode", RulerMode.FIRST, RulerMode.values()).makeGlobal();
public final OsmandPreference SHOW_COMPASS_CONTROL_RULER = new BooleanPreference("show_compass_ruler", true).makeGlobal();
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
index 36e8bcc4f2..4b08add243 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
@@ -51,7 +51,6 @@ import net.osmand.plus.ContextMenuAdapter.ItemClickListener;
import net.osmand.plus.ContextMenuItem;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
-import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.CommonPreference;
import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.R;
@@ -537,27 +536,26 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
public AudioVideoNotesPlugin(OsmandApplication app) {
this.app = app;
- OsmandSettings settings = app.getSettings();
ApplicationMode.regWidgetVisibility("audionotes", (ApplicationMode[]) null);
- AV_EXTERNAL_RECORDER = settings.registerBooleanPreference("av_external_recorder", false);
- AV_EXTERNAL_PHOTO_CAM = settings.registerBooleanPreference("av_external_cam", true);
- AV_VIDEO_FORMAT = settings.registerIntPreference("av_video_format", VIDEO_OUTPUT_MP4);
- AV_VIDEO_QUALITY = settings.registerIntPreference("av_video_quality", VIDEO_QUALITY_DEFAULT);
- AV_AUDIO_FORMAT = settings.registerIntPreference("av_audio_format", AUDIO_FORMAT_DEFAULT);
- AV_AUDIO_BITRATE = settings.registerIntPreference("av_audio_bitrate", AUDIO_BITRATE_DEFAULT);
- AV_DEFAULT_ACTION = settings.registerIntPreference("av_default_action", AV_DEFAULT_ACTION_CHOOSE);
+ AV_EXTERNAL_RECORDER = registerBooleanPreference(app, "av_external_recorder", false);
+ AV_EXTERNAL_PHOTO_CAM = registerBooleanPreference(app, "av_external_cam", true);
+ AV_VIDEO_FORMAT = registerIntPreference(app, "av_video_format", VIDEO_OUTPUT_MP4);
+ AV_VIDEO_QUALITY = registerIntPreference(app, "av_video_quality", VIDEO_QUALITY_DEFAULT);
+ AV_AUDIO_FORMAT = registerIntPreference(app, "av_audio_format", AUDIO_FORMAT_DEFAULT);
+ AV_AUDIO_BITRATE = registerIntPreference(app, "av_audio_bitrate", AUDIO_BITRATE_DEFAULT);
+ AV_DEFAULT_ACTION = registerIntPreference(app, "av_default_action", AV_DEFAULT_ACTION_CHOOSE);
// 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:
- 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:
- 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_RS_CLIP_LENGTH = settings.registerIntPreference("av_rs_clip_length", CLIP_LENGTH_DEFAULT);
- AV_RS_STORAGE_SIZE = settings.registerIntPreference("av_rs_storage_size", STORAGE_SIZE_DEFAULT);
+ AV_RECORDER_SPLIT = registerBooleanPreference(app, "av_recorder_split", false);
+ AV_RS_CLIP_LENGTH = registerIntPreference(app, "av_rs_clip_length", CLIP_LENGTH_DEFAULT);
+ AV_RS_STORAGE_SIZE = registerIntPreference(app, "av_rs_storage_size", STORAGE_SIZE_DEFAULT);
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java
index 6447ed34e6..a83ea40136 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java
@@ -1,29 +1,47 @@
package net.osmand.plus.audionotes;
+import android.Manifest;
+import android.content.Context;
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.media.CamcorderProfile;
import android.media.MediaRecorder;
import android.os.Build;
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.PreferenceViewHolder;
+import android.text.SpannableString;
+import android.view.View;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
+import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndAppCustomization;
import net.osmand.plus.OsmandPlugin;
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.bottomsheets.ResetProfilePrefsBottomSheet;
+import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet.ResetAppModePrefsListener;
import net.osmand.plus.settings.preferences.ListPreferenceEx;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+import net.osmand.plus.widgets.style.CustomTypefaceSpan;
import org.apache.commons.logging.Log;
import java.io.File;
-import java.text.MessageFormat;
import java.util.ArrayList;
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.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.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 String CAMERA_PERMISSION = "camera_permission";
private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
private static final String RESET_TO_DEFAULT = "reset_to_default";
private static final String OPEN_NOTES = "open_notes";
@@ -46,17 +67,8 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
@Override
protected void setupPreferences() {
AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
-
if (plugin != null) {
-
- Camera cam = openCamera();
- if (cam != null) {
- setupExternalPhotoCamPref(plugin);
- setupCameraPictureSizePref(cam, plugin);
- setupCameraFocusTypePref(cam, plugin);
- setupPhotoPlaySoundPref(plugin);
- cam.release();
- }
+ setupCameraPhotoPrefs(plugin);
setupAudioFormatPref(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());
externalPhotoCam.setDescription(getString(R.string.av_use_external_camera_descr));
externalPhotoCam.setIcon(getActiveIcon(R.drawable.ic_action_photo_dark));
+ externalPhotoCam.setEnabled(cam != null);
}
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();
// Photo picture size
@@ -138,18 +181,24 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
String[] entries = itemsPicSizes.toArray(new String[0]);
Integer[] entryValues = picSizesValues.toArray(new Integer[0]);
- ListPreferenceEx cameraPictureSize = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_PICTURE_SIZE.getId());
if (entries.length > 0) {
cameraPictureSize.setEntries(entries);
cameraPictureSize.setEntryValues(entryValues);
- cameraPictureSize.setDescription(R.string.av_camera_pic_size_descr);
- cameraPictureSize.setIcon(getActiveIcon(R.drawable.ic_action_picture_size));
} else {
cameraPictureSize.setVisible(false);
}
}
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();
// focus mode settings
@@ -183,21 +232,19 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
String[] entries = items.toArray(new String[0]);
Integer[] entryValues = itemsValues.toArray(new Integer[0]);
- ListPreferenceEx cameraFocusType = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_FOCUS_TYPE.getId());
if (entries.length > 0) {
cameraFocusType.setEntries(entries);
cameraFocusType.setEntryValues(entryValues);
- cameraFocusType.setDescription(R.string.av_camera_focus_descr);
- cameraFocusType.setIcon(getActiveIcon(R.drawable.ic_action_camera_focus));
} else {
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());
photoPlaySound.setDescription(getString(R.string.av_photo_play_sound_descr));
photoPlaySound.setIcon(getContentIcon(R.drawable.ic_action_music_off));
+ photoPlaySound.setEnabled(cam != null);
}
private void setupAudioFormatPref(AudioVideoNotesPlugin plugin) {
@@ -319,14 +366,23 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
storageSize.setEntries(entries);
storageSize.setEntryValues(entryValues);
storageSize.setDescription(R.string.rec_split_storage_size_desc);
+ storageSize.setIcon(getContentIcon(R.drawable.ic_sdcard));
} else {
storageSize.setVisible(false);
}
}
private void setupOpenNotesDescrPref() {
- Preference nameAndPasswordPref = findPreference("open_notes_description");
- nameAndPasswordPref.setTitle(getText(R.string.multimedia_notes_view_descr));
+ String multimediaNotesPath = getString(R.string.multimedia_notes_view_path);
+ 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() {
@@ -346,13 +402,26 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
@Override
public boolean onPreferenceClick(Preference preference) {
- if (OPEN_NOTES.equals(preference.getKey())) {
+ String prefId = preference.getKey();
+ if (OPEN_NOTES.equals(prefId)) {
OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
app.getSettings().FAVORITES_TAB.set(NOTES_TAB);
startActivity(favorites);
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);
}
@@ -365,4 +434,55 @@ public class MultimediaNotesFragment extends BaseSettingsFragment {
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());
+ }
+ }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/base/bottomsheetmenu/SimpleBottomSheetItem.java b/OsmAnd/src/net/osmand/plus/base/bottomsheetmenu/SimpleBottomSheetItem.java
index 338e2b0f23..4a4c9746fd 100644
--- a/OsmAnd/src/net/osmand/plus/base/bottomsheetmenu/SimpleBottomSheetItem.java
+++ b/OsmAnd/src/net/osmand/plus/base/bottomsheetmenu/SimpleBottomSheetItem.java
@@ -55,6 +55,11 @@ public class SimpleBottomSheetItem extends BaseBottomSheetItem {
iconView.setImageDrawable(icon);
}
+ public void setTitleColorId(@ColorRes int titleColorId) {
+ this.titleColorId = titleColorId;
+ titleTv.setTextColor(ContextCompat.getColor(titleTv.getContext(), titleColorId));
+ }
+
@Override
public void inflate(Context context, ViewGroup container, boolean nightMode) {
super.inflate(context, container, nightMode);
diff --git a/OsmAnd/src/net/osmand/plus/development/DevelopmentSettingsFragment.java b/OsmAnd/src/net/osmand/plus/development/DevelopmentSettingsFragment.java
new file mode 100644
index 0000000000..9a33485b29
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/development/DevelopmentSettingsFragment.java
@@ -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);
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
index 1e3d2a983d..976e09ecf1 100644
--- a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
@@ -125,6 +125,11 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
return SettingsDevelopmentActivity.class;
}
+ @Override
+ public Class extends BaseSettingsFragment> getSettingsFragment() {
+ return DevelopmentSettingsFragment.class;
+ }
+
@Override
public int getLogoResourceId() {
return R.drawable.ic_plugin_developer;
diff --git a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java
index 3d29e9bb13..a9c18346c0 100644
--- a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java
@@ -1,17 +1,29 @@
package net.osmand.plus.monitoring;
import android.content.Intent;
+import android.graphics.Typeface;
import android.support.v4.app.FragmentManager;
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.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
+import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.myplaces.FavoritesActivity;
+import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
+import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet.CopyAppModePrefsListener;
import net.osmand.plus.settings.BaseSettingsFragment;
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.SwitchPreferenceEx;
+import net.osmand.plus.widgets.style.CustomTypefaceSpan;
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.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 RESET_TO_DEFAULT = "reset_to_default";
@@ -37,8 +49,10 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
setupSaveTrackMinSpeedPref();
setupAutoSplitRecordingPref();
setupDisableRecordingOnceAppKilledPref();
+ setupSaveHeadingToGpxPref();
setupTrackStorageDirectoryPref();
+ setupShowTripRecNotificationPref();
setupLiveMonitoringPref();
setupOpenNotesDescrPref();
@@ -87,7 +101,14 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
ListPreferenceEx saveTrackMinDistance = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_DISTANCE.getId());
saveTrackMinDistance.setEntries(entries);
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() {
@@ -101,7 +122,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
ListPreferenceEx saveTrackPrecision = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_PRECISION.getId());
saveTrackPrecision.setEntries(entries);
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() {
@@ -117,7 +147,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
ListPreferenceEx saveTrackMinSpeed = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_SPEED.getId());
saveTrackMinSpeed.setEntries(entries);
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() {
@@ -130,6 +169,17 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
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() {
Integer[] entryValues = new Integer[] {REC_DIRECTORY, MONTHLY_DIRECTORY, DAILY_DIRECTORY};
String[] entries = new String[entryValues.length];
@@ -151,8 +201,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
}
private void setupOpenNotesDescrPref() {
- Preference nameAndPasswordPref = findPreference("open_tracks_description");
- nameAndPasswordPref.setTitle(getText(R.string.tracks_view_descr));
+ String tracksPath = getString(R.string.tracks_view_path);
+ 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() {
@@ -172,13 +230,24 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
@Override
public boolean onPreferenceClick(Preference preference) {
- if (OPEN_TRACKS.equals(preference.getKey())) {
+ String prefId = preference.getKey();
+ if (OPEN_TRACKS.equals(prefId)) {
OsmAndAppCustomization appCustomization = app.getAppCustomization();
Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
app.getSettings().FAVORITES_TAB.set(FavoritesActivity.GPX_TAB);
startActivity(favorites);
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);
}
@@ -199,4 +268,36 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment {
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());
+ }
+ }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
index 7a4aacb035..42f395deb2 100644
--- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
@@ -63,6 +63,19 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
final List am = ApplicationMode.allPossibleValues();
ApplicationMode.regWidgetVisibility("monitoring", am.toArray(new ApplicationMode[am.size()]));
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
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java
index f2240fa74f..b7c4bd5aaa 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java
@@ -1,8 +1,10 @@
package net.osmand.plus.osmedit;
import android.content.Intent;
+import android.graphics.Typeface;
import android.support.v4.app.FragmentManager;
import android.support.v7.preference.Preference;
+import android.text.SpannableString;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
@@ -10,10 +12,12 @@ import android.widget.TextView;
import net.osmand.plus.OsmAndAppCustomization;
import net.osmand.plus.R;
import net.osmand.plus.helpers.AndroidUiHelper;
+import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.settings.OnPreferenceChanged;
import net.osmand.plus.settings.bottomsheets.OsmLoginDataBottomSheet;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+import net.osmand.plus.widgets.style.CustomTypefaceSpan;
public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged {
@@ -22,8 +26,8 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer
@Override
protected void setupPreferences() {
- Preference vehicleParametersInfo = findPreference("osm_editing_info");
- vehicleParametersInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
+ Preference osmEditingInfo = findPreference("osm_editing_info");
+ osmEditingInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
setupNameAndPasswordPref();
setupOfflineEditingPref();
@@ -52,8 +56,16 @@ public class OsmEditingFragment extends BaseSettingsFragment implements OnPrefer
}
private void setupOsmEditsDescrPref() {
- Preference nameAndPasswordPref = findPreference("osm_edits_description");
- nameAndPasswordPref.setTitle(getText(R.string.osm_edits_view_descr));
+ String osmEditsPath = getString(R.string.osm_edits_view_path);
+ 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() {
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java b/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java
index b313bd124d..7b876200ac 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java
@@ -112,9 +112,8 @@ public class SettingsOsmEditingActivity extends SettingsBaseActivity {
@Override
protected void onPostExecute(OsmBugsUtil.OsmBugResult osmBugResult) {
- if (osmBugResult.warning != null) {
- Toast.makeText(context, osmBugResult.warning, Toast.LENGTH_LONG).show();
- }
+ String text = osmBugResult.warning != null ? osmBugResult.warning : context.getString(R.string.osm_authorization_success);
+ Toast.makeText(context, text, Toast.LENGTH_LONG).show();
}
}
-}
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/profiles/SelectCopyAppModeBottomSheet.java b/OsmAnd/src/net/osmand/plus/profiles/SelectCopyAppModeBottomSheet.java
index fa497fcb92..2e8024e0ea 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/SelectCopyAppModeBottomSheet.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/SelectCopyAppModeBottomSheet.java
@@ -103,9 +103,10 @@ public class SelectCopyAppModeBottomSheet extends AppModesBottomSheetDialogFragm
@Override
protected void onRightBottomButtonClick() {
- OsmandApplication app = getMyApplication();
- if (app != null && selectedAppMode != null) {
- app.getSettings().copyPreferencesFromProfile(selectedAppMode, currentAppMode);
+ Fragment targetFragment = getTargetFragment();
+ if (selectedAppMode != null && targetFragment instanceof CopyAppModePrefsListener) {
+ CopyAppModePrefsListener listener = (CopyAppModePrefsListener) targetFragment;
+ listener.copyAppModePrefs(selectedAppMode);
}
dismiss();
}
@@ -127,4 +128,8 @@ public class SelectCopyAppModeBottomSheet extends AppModesBottomSheetDialogFragm
LOG.error("showInstance", e);
}
}
+
+ public interface CopyAppModePrefsListener {
+ void copyAppModePrefs(ApplicationMode appMode);
+ }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
index 67333b2068..5a8610e9a2 100644
--- a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
@@ -50,6 +50,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandActionBarActivity;
import net.osmand.plus.activities.OsmandInAppPurchaseActivity;
import net.osmand.plus.audionotes.MultimediaNotesFragment;
+import net.osmand.plus.development.DevelopmentSettingsFragment;
import net.osmand.plus.monitoring.MonitoringSettingsFragment;
import net.osmand.plus.osmedit.OsmEditingFragment;
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),
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),
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),
NAVIGATION(NavigationFragment.class.getName(), true, R.xml.navigation_settings_new, R.layout.profile_preference_toolbar),
COORDINATES_FORMAT(CoordinatesFormatFragment.class.getName(), true, R.xml.coordinates_format, R.layout.profile_preference_toolbar),
ROUTE_PARAMETERS(RouteParametersFragment.class.getName(), true, R.xml.route_parameters, R.layout.profile_preference_toolbar),
SCREEN_ALERTS(ScreenAlertsFragment.class.getName(), true, R.xml.screen_alerts, R.layout.profile_preference_toolbar_with_switch),
VOICE_ANNOUNCES(VoiceAnnouncesFragment.class.getName(), true, R.xml.voice_announces, R.layout.profile_preference_toolbar_with_switch),
- 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),
MAP_DURING_NAVIGATION(MapDuringNavigationFragment.class.getName(), true, R.xml.map_during_navigation, R.layout.profile_preference_toolbar),
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch),
DATA_STORAGE(DataStorageFragment.class.getName(), false, R.xml.data_storage, R.layout.global_preference_toolbar),
DIALOGS_AND_NOTIFICATIONS_SETTINGS(DialogsAndNotificationsSettingsFragment.class.getName(), false, R.xml.dialogs_and_notifications_preferences, R.layout.global_preferences_toolbar_with_switch),
- PROFILE_APPEARANCE(ProfileAppearanceFragment.TAG, true, R.xml.profile_appearance, R.layout.profile_preference_toolbar);
+ 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 boolean profileDependent;
@@ -309,7 +311,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
ApplicationMode appMode = getSelectedAppMode();
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) {
BooleanPreferenceBottomSheet.showInstance(fragmentManager, preference.getKey(), this, false, appMode, currentScreenType.profileDependent);
} else if (preference instanceof EditTextPreference) {
@@ -695,6 +697,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
p.setKey(b.getId());
p.setSummary(summary);
p.setLayoutResource(layoutId);
+ p.setIconSpaceReserved(true);
return p;
}
@@ -708,6 +711,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
p.setTitle(title);
p.setSummary(summary);
p.setLayoutResource(layoutId);
+ p.setIconSpaceReserved(true);
return p;
}
@@ -722,6 +726,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
listPreference.setDialogTitle(title);
listPreference.setEntries(names);
listPreference.setEntryValues(values);
+ listPreference.setIconSpaceReserved(true);
if (layoutId != 0) {
listPreference.setLayoutResource(layoutId);
diff --git a/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java
index ea40709d09..f3c11e3819 100644
--- a/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java
@@ -41,7 +41,9 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
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.ResetAppModePrefsListener;
import net.osmand.plus.skimapsplugin.SkiMapsPlugin;
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.SELECTED_ITEM;
-public class ConfigureProfileFragment extends BaseSettingsFragment {
+public class ConfigureProfileFragment extends BaseSettingsFragment implements CopyAppModePrefsListener, ResetAppModePrefsListener {
public static final String TAG = ConfigureProfileFragment.class.getSimpleName();
@@ -147,6 +149,20 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
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() {
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));
diff --git a/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java b/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java
index 14a266dab4..33a1a0ab1e 100644
--- a/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java
@@ -30,6 +30,9 @@ public class LiveMonitoringFragment extends BaseSettingsFragment {
@Override
protected void setupPreferences() {
+ Preference liveMonitoringInfo = findPreference("live_monitoring_info");
+ liveMonitoringInfo.setIconSpaceReserved(false);
+
setupLiveMonitoringUrlPref();
setupLiveMonitoringIntervalPref();
setupLiveMonitoringBufferPref();
@@ -86,9 +89,17 @@ public class LiveMonitoringFragment extends BaseSettingsFragment {
}
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());
- liveMonitoringUrl.setSummary(settings.LIVE_MONITORING_URL.getModeValue(getSelectedAppMode()));
- liveMonitoringUrl.setDescription(R.string.live_monitoring_m_descr);
+ liveMonitoringUrl.setSummary(summary);
+ liveMonitoringUrl.setDescription(R.string.live_monitoring_adress_descr);
liveMonitoringUrl.setIcon(getContentIcon(R.drawable.ic_world_globe_dark));
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java
index 5214ff217b..b4b71d82d0 100644
--- a/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/RouteParametersFragment.java
@@ -206,7 +206,6 @@ public class RouteParametersFragment extends BaseSettingsFragment implements OnP
switchPreferenceEx.setIcon(getRoutingPrefIcon(p.getId()));
switchPreferenceEx.setSummaryOn(R.string.shared_string_on);
switchPreferenceEx.setSummaryOff(R.string.shared_string_off);
- switchPreferenceEx.setIconSpaceReserved(true);
screen.addPreference(switchPreferenceEx);
} 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.setDescription(description);
listPreferenceEx.setIcon(getRoutingPrefIcon(p.getId()));
- listPreferenceEx.setIconSpaceReserved(true);
screen.addPreference(listPreferenceEx);
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java b/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java
index a1b7554778..3fb6daaff8 100644
--- a/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/VoiceAnnouncesFragment.java
@@ -191,13 +191,11 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment {
//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);
- audioStreamGuidance.setIconSpaceReserved(true);
getPreferenceScreen().addPreference(audioStreamGuidance);
}
private void setupInterruptMusicPref() {
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);
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/BooleanPreferenceBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/BooleanPreferenceBottomSheet.java
index 4424caf406..d49becc246 100644
--- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/BooleanPreferenceBottomSheet.java
+++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/BooleanPreferenceBottomSheet.java
@@ -8,7 +8,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
-import android.view.ContextThemeWrapper;
import android.view.View;
import net.osmand.AndroidUtils;
@@ -56,13 +55,16 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
final OsmandSettings.BooleanPreference pref = (BooleanPreference) preference;
final String on = getString(R.string.shared_string_on);
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());
final BottomSheetItemWithCompoundButton[] preferenceBtn = new BottomSheetItemWithCompoundButton[1];
preferenceBtn[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()
.setChecked(checked)
.setTitle(checked ? on : off)
- .setCustomView(getCustomButtonView())
+ .setTitleColorId(checked ? activeColor : disabledColor)
+ .setCustomView(getCustomButtonView(checked))
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -71,6 +73,8 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
switchPreference.setChecked(newValue);
preferenceBtn[0].setTitle(newValue ? on : off);
preferenceBtn[0].setChecked(newValue);
+ preferenceBtn[0].setTitleColorId(newValue ? activeColor : disabledColor);
+ updateCustomButtonView(v, newValue);
Fragment target = getTargetFragment();
if (target instanceof OnPreferenceChanged) {
@@ -97,18 +101,24 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
@Override
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();
- View customView = View.inflate(new ContextThemeWrapper(app, themeRes), R.layout.bottom_sheet_item_preference_switch, null);
View buttonView = customView.findViewById(R.id.button_container);
int colorRes = getAppMode().getIconColorInfo().getColor(nightMode);
- int color = getResolvedColor(colorRes);
- int bgColor = UiUtilities.getColorWithAlpha(color, 0.1f);
- int selectedColor = UiUtilities.getColorWithAlpha(color, 0.3f);
+ int color = checked ? getResolvedColor(colorRes) : AndroidUtils.getColorFromAttr(app, R.attr.divider_color_basic);
+ int bgColor = UiUtilities.getColorWithAlpha(color, checked ? 0.1f : 0.5f);
+ int selectedColor = UiUtilities.getColorWithAlpha(color, checked ? 0.3f : 0.5f);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
int bgResId = R.drawable.rectangle_rounded_right;
@@ -123,8 +133,6 @@ public class BooleanPreferenceBottomSheet extends BasePreferenceBottomSheet {
Drawable bgDrawable = app.getUIUtilities().getPaintedIcon(bgResId, bgColor);
AndroidUtils.setBackground(buttonView, bgDrawable);
}
-
- return customView;
}
private SwitchPreferenceEx getSwitchPreferenceEx() {
diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java
index 0938a0548b..81f6675afb 100644
--- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java
+++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/EditTextPreferenceBottomSheet.java
@@ -6,17 +6,20 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
+import android.view.View;
import android.widget.EditText;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
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.settings.OnPreferenceChanged;
import net.osmand.plus.settings.preferences.EditTextPreferenceEx;
import net.osmand.util.Algorithms;
+import studio.carbonylgroup.textfieldboxes.TextFieldBoxes;
+
public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet {
public static final String TAG = EditTextPreferenceBottomSheet.class.getSimpleName();
@@ -41,13 +44,15 @@ public class EditTextPreferenceBottomSheet extends BasePreferenceBottomSheet {
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);
- items.add(new SimpleBottomSheetItem.Builder().setCustomView(editText).create());
+ items.add(new SimpleBottomSheetItem.Builder().setCustomView(view).create());
String description = editTextPreference.getDescription();
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
protected int getDismissButtonTextId() {
- return R.string.shared_string_close;
+ return R.string.shared_string_cancel;
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java
index 14fdb63b30..5bbfa9f31a 100644
--- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java
+++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java
@@ -12,7 +12,6 @@ import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import net.osmand.plus.ApplicationMode;
-import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
@@ -71,9 +70,10 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
@Override
protected void onRightBottomButtonClick() {
- OsmandApplication app = getMyApplication();
- if (app != null) {
- app.getSettings().resetPreferencesForProfile(getAppMode());
+ Fragment targetFragment = getTargetFragment();
+ if (targetFragment instanceof ResetAppModePrefsListener) {
+ ResetAppModePrefsListener listener = (ResetAppModePrefsListener) targetFragment;
+ listener.resetAppModePrefs(getAppMode());
}
dismiss();
}
@@ -100,4 +100,8 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
return false;
}
}
+
+ public interface ResetAppModePrefsListener {
+ void resetAppModePrefs(ApplicationMode appMode);
+ }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/SingleSelectPreferenceBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/SingleSelectPreferenceBottomSheet.java
index 2d28911855..833276f3cb 100644
--- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/SingleSelectPreferenceBottomSheet.java
+++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/SingleSelectPreferenceBottomSheet.java
@@ -12,8 +12,9 @@ import net.osmand.AndroidUtils;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.R;
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.simpleitems.LongDescriptionItem;
+import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithDescription;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.settings.OnPreferenceChanged;
import net.osmand.plus.settings.preferences.ListPreferenceEx;
@@ -24,10 +25,14 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
public static final String TAG = SingleSelectPreferenceBottomSheet.class.getSimpleName();
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 int selectedEntryIndex = -1;
+ private boolean descriptionExpanded;
+ private boolean collapsibleDescription;
@Override
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) {
return;
}
+ Bundle args = getArguments();
+ if (args != null && args.containsKey(USE_COLLAPSIBLE_DESCRIPTION)) {
+ collapsibleDescription = args.getBoolean(USE_COLLAPSIBLE_DESCRIPTION);
+ }
if (savedInstanceState != null) {
selectedEntryIndex = savedInstanceState.getInt(SELECTED_ENTRY_INDEX_KEY);
+ collapsibleDescription = savedInstanceState.getBoolean(USE_COLLAPSIBLE_DESCRIPTION);
} else {
selectedEntryIndex = listPreference.findIndexOfValue(listPreference.getValue());
}
@@ -47,7 +57,7 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
String description = listPreference.getDescription();
if (!Algorithms.isEmpty(description)) {
- items.add(new LongDescriptionItem(description));
+ buildDescriptionItem(ctx, description);
}
String[] entries = listPreference.getEntries();
@@ -83,11 +93,12 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(SELECTED_ENTRY_INDEX_KEY, selectedEntryIndex);
+ outState.putBoolean(USE_COLLAPSIBLE_DESCRIPTION, collapsibleDescription);
}
@Override
protected int getDismissButtonTextId() {
- return R.string.shared_string_close;
+ return R.string.shared_string_cancel;
}
@Override
@@ -125,11 +136,41 @@ public class SingleSelectPreferenceBottomSheet extends BasePreferenceBottomSheet
return (ListPreferenceEx) getPreference();
}
- public static boolean showInstance(@NonNull FragmentManager fragmentManager, String key, Fragment target,
- boolean usedOnMap, @Nullable ApplicationMode appMode, boolean profileDependent) {
+ private void buildDescriptionItem(Context ctx, String description) {
+ 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 {
Bundle args = new Bundle();
args.putString(PREFERENCE_ID, key);
+ args.putBoolean(USE_COLLAPSIBLE_DESCRIPTION, collapsibleDescription);
SingleSelectPreferenceBottomSheet fragment = new SingleSelectPreferenceBottomSheet();
fragment.setArguments(args);