diff --git a/OsmAnd/res/layout/fragment_measurement_tool.xml b/OsmAnd/res/layout/fragment_measurement_tool.xml
new file mode 100644
index 0000000000..47dfee7ff8
--- /dev/null
+++ b/OsmAnd/res/layout/fragment_measurement_tool.xml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-az/strings.xml b/OsmAnd/res/values-az/strings.xml
index 639f760254..c726bdf5a1 100644
--- a/OsmAnd/res/values-az/strings.xml
+++ b/OsmAnd/res/values-az/strings.xml
@@ -922,10 +922,10 @@
İngiliscə (Birləşmiş Krallıq)
Afrikanca
Albanca
- Bask dili
+ Baskca
Macarca (rəsmi)
- İndoneziya dili
- Koreya dili
+ İndonezcə
+ Koreyaca
Təyinat nöqtəsi seçin
Pullu yollardan yayın
Asfaltsız yollardan yayın
@@ -973,7 +973,7 @@
Mapillary-ni aç
Bu məkan üçün şəkillərimiz yoxdur
Proqramın endirimləri haqqında e-poçt siyahımıza abunə olun və əlavə 3 xəritə endirməsi əldə edin!
- Dəniz dərinliyi konturlarını aldığınız üçün təşəkkürlər!
+ Dəniz dərinliyi konturlarını aldığınız üçün təşəkkür edirik!
Dəniz dərinliyi konturları
Dəniz dərinliyi cənub yarımkürəsində göstərilir
Dəniz dərinliyi konturları
@@ -1050,7 +1050,7 @@
Amerika yol atlası
Yollardan yayın…
Pullu yollardan yayın
- Son nöqtə ən yaxın yoldan çox uzaqdadır.
+ Son nöqtə ən yaxın yoldan çox uzaqdır.
Naviqasiya zamanı mövqeni yollara bərkit
Yola bərkit
Asfaltsız yollardan yayın
@@ -1658,4 +1658,40 @@
Yaradılmış OSM POI
Şəffaf çəhrayı
Bir çox ölkələrdə (Almaniya, Fransa, İtaliya və s.) sürət kamerası xəbərdarlıqlarının istifadə edilməsinə qanunla icazə verilmir. Qanunu pozarsanız, OsmAnd heç bir məsuliyyət daşımır. Yalnız bu xüsusiyyətdən istifadəyə icazə varsa, Bəli düyməsinə toxunun.
+ Malayalamca
+ Suahilicə
+ Boşnakca
+ Bolqarca
+ Katalanca
+ Xorvatca
+ Danimarkaca
+ Kannadaca
+ Latışca
+ Litvaca
+ Marathicə
+ Norveçcə
+ Polyakca
+ Serbcə
+ Serbcə (Latın)
+ Slovakca
+ Slovencə
+ Yüksək dəqiqlikli ekran
+ Nəqliyyat nəticələri (təyinat nöqtəsi yoxdur):
+ Nəqliyyat nəticələri (təyinat nöqtəsinə {0}):
+ Nəqliyyat axtarışını sıfırla
+ Qeyd edilən səs
+ Vektor xəritələr yüklənməyib
+ Offlayn vektor xəritələr
+ Dayanacaqda nəqliyyat axtar
+ Marşrut detalları
+ Yadda saxlanacaq favorit nöqtələr yoxdur
+ Favoritlər OsmAnd ilə paylaşılıb
+ GPX yüklənərkən səhv baş verdi
+ Trafik məlumatları üçün Yandex-ə təşəkkürlər.
+ Yandex trafik
+ Marşrut
+ OSM qeydlər (onlayn)
+ Hazırki xəritə mərkəzinin yaxınında axtar
+ Marşrutlar
+ Dayanacaq
diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml
index 90e4aba12d..616fad3067 100644
--- a/OsmAnd/res/values-cs/strings.xml
+++ b/OsmAnd/res/values-cs/strings.xml
@@ -2554,7 +2554,7 @@ Pokud potřebujete pomoci s aplikací OsmAnd, prosím kontaktujte naši podporu
Kopcovitý
Méně kopcovitý
Rovinatý
- Preferovat hlavní silnice
+ Kratší trasy
Vyvážený
Preferovat vedlejší silnice
Priorita terénu: rovinatý nebo kopcovitý
@@ -2676,4 +2676,19 @@ Pokud potřebujete pomoci s aplikací OsmAnd, prosím kontaktujte naši podporu
Max/Min
Min/Max
+ Pokračovat/Pozastavit navigaci
+ Stiskněte toto tlačítko na pozastavení navigace, nebo pokračování pokud je pozastavená.
+ Zobrazit zprávu o ukončení navigace
+ Spustit/Ukončit navigaci
+ Stiskněte toto tlačítko pro spuštění navigace, nebo zastavení, pokud již byla spuštěna.
+ "\\022 Modul Mapillary se snímky ulic
+\n
+\n • Pravítko pro měření vzdálenosti
+\n
+\n • Intervaly rozdělení GPX s detailními informacemi o trase
+\n
+\n • další vylepšení a opravy chyb
+\n
+\n"
+ Průhledná růžová
diff --git a/OsmAnd/res/values-da/phrases.xml b/OsmAnd/res/values-da/phrases.xml
index af7b515856..6e1555523a 100644
--- a/OsmAnd/res/values-da/phrases.xml
+++ b/OsmAnd/res/values-da/phrases.xml
@@ -3497,7 +3497,7 @@
Dyr accepteres
Formål
-Vilde dyr og planter
+Vilde dyr
Heste
Pattedyr
Fisk
diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml
index a8f2d79cf4..aac0f3655c 100644
--- a/OsmAnd/res/values-da/strings.xml
+++ b/OsmAnd/res/values-da/strings.xml
@@ -705,7 +705,7 @@ OSM er et i fællesskab drevet, globalt offentligt domæne kortlægningsprojekt.
Arealanvendelse
Mad og drikke
- Talevejledning er ikke tilgængelig. Gå til \'Indstillinger\' → \'Generelt\' → \'Talevejledning\' og vælg eller hent en talevejledning.
+ Talevejledning er ikke tilgængelig. Gå til \'Indstillinger\' → \'Navigation\' → \'Talevejledning\' og vælg eller hent en talevejledning.
{0} emner valgt
Hentet
Hurtigste rute
@@ -2449,7 +2449,7 @@ Hvis du ønsker at støtte OsmAnd og OSM, er dette en god måde at gøre det p
Vis jule-interessepunkter (IP)?
Minimumshastighed for logning
Filter: Angiv minimumshastighed før et punkt logges
- Logning ved minimum bevægelse
+ Logning ved minimum forskydning
Filter: Indstil minimumsafstand fra sidste position før et punkt logges
Mindste nøjagtighed for logning
Filter: Indstil minimum nøjagtighed før et punkt logges
@@ -2723,7 +2723,7 @@ Tidligere destination bliver sidste mellemliggende punkt.
i %1$s
Oversigt
Animér position
- Aktiver kort panorering animation af position under navigation
+ Aktiver panorering af positionen under navigation
Gruppenavn
Skift farve
Rediger navn
@@ -2779,7 +2779,7 @@ Tidligere destination bliver sidste mellemliggende punkt.
Indtast brugernavn
Se billeder tilføjet af en bestemt bruger.
Brugernavn
- Filtrer billeder efter indsender eller dato. Filter gælder kun for højere zoom.
+ Filtrer billeder efter indsender eller dato. Filter gælder kun for højere zoomniveauer.
Se billeder tilføjet i en bestemt periode.
Genindlæs
Genindlæs kortbrikker for at se opdaterede data.
@@ -2811,7 +2811,7 @@ Tidligere destination bliver sidste mellemliggende punkt.
Start/stop navigation
Tryk på knappen for at starte navigation eller stoppe, hvis den allerede var begyndt.
Tidsbuffer til online sporing
- Angiv en tidsbuffer til at opbevare steder, når der ingen forbindelse er
+ Angiv en buffer for hvor lang tid positioner skal gemmes, når der ingen internetforbindelse er
Prøv igen
Internetforbindelse er nødvendig for at se fotos fra Mapillary
diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml
index d0f51d5cfd..be17a94000 100644
--- a/OsmAnd/res/values-es-rAR/strings.xml
+++ b/OsmAnd/res/values-es-rAR/strings.xml
@@ -225,7 +225,7 @@ Lon %2$s
Activar modo reposo del GPS
Guarda ahora la traza actual en la SD
Guardar traza GPX actual
- Intervalo de guardado
+ Intervalo de registro
Indicaciones por voz
Activar Proxy HTTP
Puerto Proxy
@@ -517,14 +517,14 @@ Se aprecia la participación activa, y las contribuciones pueden hacerse directa
El servicio de fondo, aún está funcionando. ¿Quieres pararlo también?
¿Parar modo reposo del GPS?
Elige el intervalo de registro para la grabación de trazas general (activar mediante el control de grabación GPX en el mapa)
- Intervalo general de guardado
+ Intervalo de registro general
Intervalo de activación del GPS
Guardar traza en archivo GPX
Registro de trazas bajo demanda
Registra la ubicación en un archivo GPX, pudiendo des/activarlo usando el control de grabación GPX en la pantalla del mapa
Guardar la traza automáticamente durante la navegación
Una traza GPX se guardará automáticamente en la carpeta de trazas durante la navegación
- Intervalo de guardado durante navegación
+ Intervalo de registro durante navegación
Elige el intervalo de registro de trazas durante la navegación
Elige las indicaciones por voz para la navegación
Configura un Proxy HTTP para todas las peticiones de red
@@ -2063,7 +2063,7 @@ Se aprecia la participación activa, y las contribuciones pueden hacerse directa
Elegir marcador del mapa
Otros marcadores
Subir anónimamente
- Mostrar transparencia en barra de búsqueda
+ Mostrar barra de transparencia en el mapa
Puedes subir informes de problemas anónimos o usar tu perfil de OpenStreetMap.org.
Subir problema(s) del mapa
Donaciones
@@ -2694,8 +2694,8 @@ Proporciona un código completo
Mostrar diálogo de Finalizar navegación
Iniciar/Parar navegación
Pulsa este botón para iniciar la navegación, o para finalizarla si ya se había iniciado.
- Tiempo del búfer para la seguimiento en línea
- Especifica el tiempo del búfer para mantener lugares para enviar sin conexión
+ Tiempo del búfer para el seguimiento en línea
+ Especifica el tiempo que el búfer mantendrá los lugares para enviar sin conexión
Debes tener conexión a Internet para ver fotos de Mapillary
Reintentar
diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml
index c72c9b9353..c4fda2bfab 100644
--- a/OsmAnd/res/values-es-rUS/strings.xml
+++ b/OsmAnd/res/values-es-rUS/strings.xml
@@ -225,7 +225,7 @@ Lon %2$s
Activar modo reposo del GPS
Guarda ahora la traza actual en la SD
Guardar traza GPX actual
- Intervalo de guardado
+ Intervalo de registro
Indicaciones por voz
Activar Proxy HTTP
Puerto Proxy
@@ -517,14 +517,14 @@ Se aprecia la participación activa, y las contribuciones pueden hacerse directa
El servicio de fondo, aún está funcionando. ¿Quieres pararlo también?
¿Parar modo reposo del GPS?
Elige el intervalo de registro para la grabación de trazas general (activar mediante el control de grabación GPX en el mapa)
- Intervalo general de guardado
+ Intervalo de registro general
Intervalo de activación del GPS
Guardar traza en archivo GPX
Registro de trazas bajo demanda
Registra la ubicación en un archivo GPX, pudiendo des/activarlo usando el control de grabación GPX en la pantalla del mapa
Guardar la traza automáticamente durante la navegación
Una traza GPX se guardará automáticamente en la carpeta de trazas durante la navegación
- Intervalo de guardado durante navegación
+ Intervalo de registro durante navegación
Elige el intervalo de registro de trazas durante la navegación
Elige las indicaciones por voz para la navegación
Configura un Proxy HTTP para todas las peticiones de red
@@ -2088,7 +2088,7 @@ Si amas a OsmAnd, OSM y quieres apoyarlos, esta es una perfecta manera de hacerl
Elegir marcador del mapa
Otros marcadores
Subir anónimamente
- Mostrar transparencia en barra de búsqueda
+ Mostrar barra de transparencia en el mapa
Puedes subir informes de problemas anónimos o usar tu perfil de OpenStreetMap.org.
Subir problema(s) del mapa
Recalcular ruta
@@ -2696,7 +2696,7 @@ Proporciona un código completo
Iniciar/Parar navegación
Pulsa este botón para iniciar la navegación, o para finalizarla si ya se había iniciado.
Tiempo del búfer para el seguimiento en línea
- Especifica el tiempo del búfer para mantener lugares para enviar sin conexión
+ Especifica el tiempo que el búfer mantendrá los lugares para enviar sin conexión
Debes tener conexión a Internet para ver fotos de Mapillary
Reintentar
diff --git a/OsmAnd/res/values-eu/phrases.xml b/OsmAnd/res/values-eu/phrases.xml
index a6e37ce697..421f84a7e4 100644
--- a/OsmAnd/res/values-eu/phrases.xml
+++ b/OsmAnd/res/values-eu/phrases.xml
@@ -2198,4 +2198,7 @@
Esklusako atea
Itsas oharra
Pilote
+ Wikia bosnieraz
+ Hormako begiztak
+ Ahalmena
diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml
index 18dec8ae9e..1ec9435053 100644
--- a/OsmAnd/res/values-eu/strings.xml
+++ b/OsmAnd/res/values-eu/strings.xml
@@ -2746,4 +2746,6 @@ Area honi dagokio: %1$s x %2$s
Sakatu boti hau nabigazioa hasteko, edo gelditzeko hasita bazegoen.
Lineako jarraipenaren denbora-bufferra
Zehaztu bidaltzeke dauden kokalekuak gordetzeko denbora-buffer bat
-
+ Internet behar duzu Mapillary-ko argazkiak ikusteko
+ Saiatu berriro
+
diff --git a/OsmAnd/res/values-gl/phrases.xml b/OsmAnd/res/values-gl/phrases.xml
index 986c772c83..ac40f618c0 100644
--- a/OsmAnd/res/values-gl/phrases.xml
+++ b/OsmAnd/res/values-gl/phrases.xml
@@ -1428,4 +1428,6 @@
Pagamentos por SMS
Non acepta pagamentos por SMS
OV-Chipkaart
+ Cafetaría
+ Tipo
diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml
index e52d171814..24d9ae896e 100644
--- a/OsmAnd/res/values-gl/strings.xml
+++ b/OsmAnd/res/values-gl/strings.xml
@@ -1,4 +1,5 @@
-O nome do punto favorito xa está usado; foi cambiado a %1$s para evitar os duplicados.
+
+O nome do punto favorito xa está usado; foi cambiado a %1$s para evitar os duplicados.
Configurar o tamaño da letra no mapa.
Tamaño da letra
Límite de velocidade
@@ -2494,7 +2495,7 @@ Pódese pechar esta vista desactivándoa aquí ou cambiando o «Estilo de mapa»
Distancia total
Empregar datos de elevación
Engadido
- Para ver as liñas de nivel no mapa hai que comprar e instalar un engadido
+ Para ver as liñas de nivel no mapa hai que comprar e instalar o engadido Liñas de Nivel
Esquema de cores
Permitir acceso privado
Permitir acceso a zonas privadas
@@ -2505,10 +2506,45 @@ Pódese pechar esta vista desactivándoa aquí ou cambiando o «Estilo de mapa»
Bérber
Kannada
Instalar
- Mellorar a cobertura con Mapillary
+ Mellorar a cobertura de fotos con Mapillary
Abrir Mapillary
- Podes facer as túas propias fotos ou serie de fotos e engadilas a esta localización do mapa.
-\n
-\nPara facer isto, tes que instalar a aplicación Mapillary dende Google Play.
- Fotos en liña
-
\ No newline at end of file
+ Podes facer as túas propias fotos ou serie de fotos e engadilas a este lugar do mapa.
+\n
+\nPara facer isto, hai que instalar a aplicación Mapillary dende Google Play.
+ Fotos da rede
+ Retomar/Deter a navegación
+ Prema neste botón para deter a navegación, ou para retomala se xa estaba detida.
+ Iniciar/Rematar a navegación
+ Prema neste botón para iniciar a navegación, ou para detela se xa estaba iniciada.
+ Almacenar as pistas gravadas en cartafoles mensuais
+ Almacenar as pistas gravadas en sub-cartafoles segundo o mes de gravación (como 2017-01).
+ Restaurar
+ Recargar
+ Recargar as teselas para ver datos actualizados.
+ Caché de teselas
+ O nome de usuario é incorrecto!
+ A
+ Desde
+ Ver as imaxes engadidas nun período determinado.
+ Datas
+ Escriba o nome de usuario
+ Ver as imaxes engadidas por un usuario determinado.
+ Nome de usuario
+ Pode filtrar as imaxes por quen as enviou ou pola data. Os filtros só se aplican na ampliación próxima.
+ Permisos
+ O OsmAnd non pode importar o ficheiro. Comprobe se o OsmAnd ten permiso para ler o ficheiro neste sitio.
+ Distancia corrixida
+ Imaxe de Mapillary
+ Engadir fotos
+ Non dispomos de fotos deste lugar
+ Trebello de Mapillary
+ Mapillary
+ Reiniciar a busca
+ Aumentar o radio de busca
+ Non se atopou nada :(
+ Mostrar/Agochar as notas de OSM
+ Mostrar as notas de OSM
+ Agochar as notas de OSM
+ Ordenado por distancia
+ Buscar nos favoritos
+
diff --git a/OsmAnd/res/values-large/sizes.xml b/OsmAnd/res/values-large/sizes.xml
index b1a4c09402..375e91283d 100644
--- a/OsmAnd/res/values-large/sizes.xml
+++ b/OsmAnd/res/values-large/sizes.xml
@@ -39,7 +39,7 @@
3dp
3dp
- 4dp
+ 3dp
3dp
diff --git a/OsmAnd/res/values-lv/strings.xml b/OsmAnd/res/values-lv/strings.xml
index 5d9e86ed8f..f05748152f 100644
--- a/OsmAnd/res/values-lv/strings.xml
+++ b/OsmAnd/res/values-lv/strings.xml
@@ -1,4 +1,5 @@
-Spraudņu pārvaldnieks
+
+Spraudņu pārvaldnieks
Spraudņi papildina aplikācijas iespējas un piešķir tai papildus funkcionalitāti
Spraudņi
@@ -2399,13 +2400,13 @@ failu(s)?
Jums nav instalētas nevienas bezsaistes kartes. Izvēlieties kartes no saraksta vai lejuielādējiet tās caur izvēlni - %1$s.
Izvēlieties citu reģionu
Meklē karti…
- Nosakot jūsu atrašanās vietu, OsmAnd piedāvā sekojošas kartes lejupielādei.
+ OsmAnd noteiks jūsu atrašanos un piedāvās lejupielādēt šī reģiona karti.
Atrašanās vieta nav zināma
Nav interneta savienojuma
Nepieciešams lejupielādēt kartes.
Meklē atrašanās vietu…
Brīvā vieta
- OsmAnd datu glabātuve (kartēm, trekiem, u.t.t.): %1$s.
+ OsmAnd datu uzglabāšanas vieta (kartēm, maršrutiem u.c.): %1$s.
Dot atļauju
Atļaut noteikt vietu
Veidojiet maršrutus un atklājiet jaunas vietas bez interneta savienojuma
@@ -2958,4 +2959,4 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
Mapillary bilde
OsmAnd nevar importēt failu. Pārliecinieties vai OsmAnd ir atļauja nolasīt failu dotajā mapē.
Atļaujas
-
\ No newline at end of file
+
diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml
index 97ed42fb4e..631f6f5353 100644
--- a/OsmAnd/res/values-nl/strings.xml
+++ b/OsmAnd/res/values-nl/strings.xml
@@ -2234,7 +2234,7 @@ Lengtegraad:\t\t%2$s
Je kan gedownloade updates verwijderen en terugkeren naar de originele kaart
Periode toevoegen
Weg geblokkeerd
- Selekteer
+ Selecteer
Verslag voor:
Gegevens niet beschikbaar
Ondergrondse objecten
@@ -2863,4 +2863,4 @@ Van bijna alle landen is een kaart te downloaden: van Afghanistan tot Zimbabwe,
Data
Geef gebruikersnaam
Gebruikersnaam
-
\ No newline at end of file
+
diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml
index bd5cf1fc02..a14989f25c 100644
--- a/OsmAnd/res/values-sk/strings.xml
+++ b/OsmAnd/res/values-sk/strings.xml
@@ -2815,4 +2815,6 @@ Zodpovedá oblasti: %1$s x %2$s
Min/Max
Časový zásobník pre online sledovanie
Zadajte čas pokiaľ budú udržované pozície na odoslanie kým nie je pripojenie
-
+ Na zobrazovanie fotografií z Mapillary potrebujete pripojenie na Internet
+ Skúsiť znova
+
diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml
index 1a678b1e52..994849a740 100644
--- a/OsmAnd/res/values-sl/strings.xml
+++ b/OsmAnd/res/values-sl/strings.xml
@@ -2654,9 +2654,9 @@ Koda predstavlja območje: %1$s x %2$s
Gričevnato
Manj gričevnato
Ravninsko
- Hitro
+ Krajše poti
Pretehtano
- Varno
+ Vodi po stranpoteh
Prednostna izbira terena: ravninsko ali gričevnato
Izbor razgibanosti terena
Ne pošiljaj statističnih podatkov uporabe programa
@@ -2798,4 +2798,11 @@ Koda predstavlja območje: %1$s x %2$s
\n
\n
Prosojna rožnata
-
+ Pritisnite gumb, če želite začasno zaustaviti navigacijo ali pa jo nadaljevati, če je gumb že pritisnjen.
+ Pokaži pogovorno okno končanja navigacije
+ "Pritisnite gumb, če želite začeti navigacijo ali pa jo zaustaviti, če je že začeta."
+ Časovni medpomnilnik za spletno sledenje
+ Določitev časovnega medpomnilnika za ohranjanje trenutnega mesta pri pošiljanju brez povezave
+ Za ogled slik prek Mapillary je zahtevana omrežna povezava
+ Poskusi znova
+
diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml
index fa2ff70842..f70dd19a4d 100644
--- a/OsmAnd/res/values-uk/strings.xml
+++ b/OsmAnd/res/values-uk/strings.xml
@@ -44,9 +44,9 @@
"Цей втулок надає можливість отримати доступ до багатьох типів онлайн (так званих растрових) мап, від попередньо створених квадратів OpenStreetMap (на кшталт стилю Mapnik) до супутникових знімків та спеціальних шарів, таких як погодні, кліматичні та геологічні мапи, шари рельєфу й т.і.
-\n
-\nБудь яка з цих мап може використовуватись як основна мапа в OsmAnd, або як покриття чи підкладка до іншої основної мапи (наприклад стандартна оффлайнова мапа OsmAnd). Для того, щоб зробити більш помітною будь-яку мапу-підкладку, певні елементи векторної мапи OsmAnd можна легко сховати через меню \'Налаштування Мапи\'.
-\n
+\n
+\nБудь яка з цих мап може використовуватись як основна мапа в OsmAnd, або як покриття чи підкладка до іншої основної мапи (наприклад стандартна оффлайнова мапа OsmAnd). Для того, щоб зробити більш помітною будь-яку мапу-підкладку, певні елементи векторної мапи OsmAnd можна легко сховати через меню „Налаштування Мапи“.
+\n
\nКвадрати мап можна отримувати безпосередньо з онлайн-джерел або підготувати їх для оффлайнового використання (та вручну скопіювати в теку даних OsmAnd) у вигляді бази даних SQLite, яку можна створити за допомогою різноманітних сторонніх інструментів підготовки мап."
Показує налаштування для активації навігації та запису маршрутів в фоновому режимі (екран вимкнено), періодично активуючи GPS.
Втулок містить налаштування допоміжних можливостей. Він дозволяє налаштувати швидкість відтворення голосових підказок, налаштування спрямовування екрану під час навігації, використання трекболу для масштабування, або використання перетворення тексту в голос, скажімо, для сповіщення про ваше поточне місцезнаходження.
@@ -665,7 +665,7 @@
Закрити
Дані завантажуються…
Зчитування даних…
- Помилка у роботі програми. Лог-файл знаходиться тут {0}. Будь ласка, напишіть розробнику про помилку (з вкладеним лог-файлом).
+ Помилка у роботі програми. Файл журналу знаходиться тут {0}. Будь ласка, напишіть розробнику про помилку (з вкладеним журнальним файлом).
Збереження GPX треків на SD…
Закінчено
@@ -2934,12 +2934,12 @@
Макс./мін.
Мін/макс
- \\022 Втулок Mapillary з вуличними зображеннями
-\n
-\n • Віджет-лінійка для вимірювання дистанцій
-\n
-\n • Розділені GPX-інтервали з докладною інформацією про Ваш трек
-\n
+ • Втулок Mapillary з вуличними зображеннями
+\n
+\n • Віджет-лінійка для вимірювання дистанцій
+\n
+\n • Розділені GPX-інтервали з докладною інформацією про Ваш трек
+\n
\n • Інші поліпшення й виправлення помилок
\n
\n
@@ -2951,4 +2951,6 @@
Натисніть цю кнопку, щоб запустити навігацію або зупинити її, якщо вона вже була запущена.
Час буферизації для онлайн-стеження
Задає час буферизації для збереження місць для відправки в автономному режимі
-
+ Вам потрібен Інтернет для перегляду фотографій від Mapillary
+ Повторити
+
diff --git a/OsmAnd/res/values-zh-rCN/strings.xml b/OsmAnd/res/values-zh-rCN/strings.xml
index e0b6a19278..2edc103915 100644
--- a/OsmAnd/res/values-zh-rCN/strings.xml
+++ b/OsmAnd/res/values-zh-rCN/strings.xml
@@ -1099,7 +1099,7 @@
GPS 唤醒间隔
我的最爱信息
停止模拟您的位置
- 使用模拟计算一个路线或记录为 GPX
+ 使用计算得到的路线或者一条 GPX 记录模拟您的位置
查询地址
GPS 文件附位置注解
位置
@@ -1540,9 +1540,9 @@
丘陵
低丘陵
平地
- 速度
+ 更短的路径
平衡
- 安全
+ 偏好背街小路
首选的地形︰ 平坦或丘陵
坡度
添加新文件夹
@@ -1587,7 +1587,7 @@
已录制
记录
等高线的色彩调配
- 记录运动检测
+ 最低位移记录阈值
过滤器:从最后位置的一个点设置最短距离用以记录
记录最小的精确度
过滤器:设置记录一个点的最小精度
@@ -1671,9 +1671,9 @@
磁方位
相对方位
当您离开道路时不重新计算路线
- 当您离正确的道路很远,阻止自动路线重新估算
- 不要改变错误方向的路线
- 当你正朝着错误的方向行进,防止自动路线重新计算
+ 当您偏离预设路线时,阻止自动路线重新估算
+ 向反方向行驶时不要重新计算路线
+ 当你朝着反方向行驶时,防止自动路线重新计算
智能自动播报
只在指引到目标点已被改变了才通知
自动播报周期
@@ -1888,7 +1888,7 @@
观看
注解
滑雪场
- "%1$s 可用 "
+ %1$s 可用
滑雪道修整
为了显示滑雪地图,需要下载特别的离线地图
为了显示航海地图,需要下载特别的离线地图
@@ -2036,20 +2036,20 @@
\n
\n长按在地图上查看"
自动启动转弯指引
- "子轨迹:%1$s "
- "路标:%1$s "
- "距离:%1$s(%2$s 个点) "
- "开始时间:%1$tF,%1$tT "
- "结束时间:%1$tF,%1$tT "
- "平均速度:%1$s "
- "最大速度:%1$s "
+ 子轨迹:%1$s
+ 航点:%1$s
+ 距离:%1$s(%2$s 个点)
+ 开始时间:%1$tF,%1$tT
+ 结束时间:%1$tF,%1$tT
+ 平均速度:%1$s
+ 最大速度:%1$s
平均海拔高度:%1$s
高度范围:%1$s
下坡/上坡:%1$s
时间跨度:%1$s
时间移动:%1$s
区段
- " %1$s 的标点"
+ %1$s 的标点
标点 %1$s
%1$s
\n路线标点 %2$s
@@ -2105,9 +2105,9 @@
已连接的设备
会话令牌: %1$s
正在等待授权…
- "位置已发送 %1$d(缓冲区 %2$d) "
- "建立的连接: %1$s "
- "OsMo 连接问题: "
+ 位置已发送 %1$d(缓冲区 %2$d)
+ 连接已建立: %1$s
+ OsMo 连接问题:
独特的设备 id
计算两点之间的路线
重新启动 OsMo 会话
@@ -2212,7 +2212,7 @@
航空器
要删除 %1$d 个 OSM 更新。是否确定?
请先计算路线
- "模拟使用计算的路线 "
+ 使用计算的路线进行模拟
模拟使用 GPX 轨迹
这条路线可能太长,无法推算。如果在10分钟内没有结果,请添加中继节点。
不自动缩放
@@ -2620,7 +2620,7 @@
日期
查看特定用户添加的图像。
查看特定时期内添加的图像。
- 您可以根据用户名或日期过滤图像。
+ 您可以根据提交者或日期过滤图像。过滤器仅在高比例尺放大时产生作用。
重新载入
重置
按月将记录的轨迹存放在文件夹中
@@ -2633,4 +2633,19 @@
%2$d 中的 %1$d
移动时间
最小/最大
+ 继续/暂停导航
+ 点击该按钮以暂停导航,或者在已暂停时恢复导航。
+ 显示导航完成对话框
+ 开始/结束导航
+ 点击该按钮以开始导航,或者在导航已经开始的情况下结束导航。
+ \\022 带有街道等级图像的 Mapillary 插件
+\n
+\n• 用于距离测量的量尺小部件
+\n
+\n • GPX 切分间隔,带有您的路径的详细信息
+\n
+\n • 其它改进和问题修复
+\n
+\n
+ 半透明粉红色
diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml
index 35f81f6605..194da21f92 100644
--- a/OsmAnd/res/values-zh-rTW/strings.xml
+++ b/OsmAnd/res/values-zh-rTW/strings.xml
@@ -1494,7 +1494,7 @@ OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式
顯示自行車路線
地圖上優先的語言
- 本地名稱
+ 當地的名稱
斯瓦希里
希伯來
往前
@@ -1506,7 +1506,7 @@ OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式
停止 GPX 記錄
開始新區段
波斯
- 在地圖標簽上優先的語言(如果優先的語言無法使用,將會切換成英文或本地名稱)
+ 在地圖標簽上優先的語言(如果優先的語言無法使用,將會切換成英文或當地名稱)
如果已啟用了 GPX 記錄,傳送軌跡資料到指定的 web 服務。
保持
中止
@@ -2804,4 +2804,6 @@ OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式
按此按鈕開始導航如果已經開始,則停止導航。
用於線上追蹤的緩衝時間
指定一段緩衝時間以保持位置,而無需連接發送
-
+ 您需要網際網路才能從 Mapillary 檢視照片
+ 重試
+
diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml
index eee5a0487a..5860d32a21 100644
--- a/OsmAnd/res/values/sizes.xml
+++ b/OsmAnd/res/values/sizes.xml
@@ -89,7 +89,7 @@
2dp
2dp
- 3dp
+ 2dp
1dp
1dp
320dp
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 8313ae2912..63db5a2b13 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,6 +9,7 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
+ Measurement tool
Resume/Pause Navigation
Press this button to pause the navigation, or to resume it if it was already paused.
Show Finish navigation dialog
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index c31fa952b9..f23d2bd064 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -436,6 +436,12 @@ public class OsmandApplication extends MultiDexApplication {
}
}
});
+ builder.setNeutralButton(R.string.shared_string_do_not_use, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+ osmandSettings.VOICE_PROVIDER.set(OsmandSettings.VOICE_PROVIDER_NOT_USE);
+ }
+ });
builder.setView(view);
builder.show();
diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
index 324cc191ed..3345a8e46f 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
@@ -178,7 +178,7 @@ public abstract class OsmandPlugin {
allPlugins.add(srtm);
} else {
if (marketEnabled) {
- srtm.setInstallURL(Version.marketPrefix(app) + id);
+ srtm.setInstallURL(Version.getUrlWithUtmRef(app, id));
allPlugins.add(srtm);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/Version.java b/OsmAnd/src/net/osmand/plus/Version.java
index b7408d5f5a..5600d8c073 100644
--- a/OsmAnd/src/net/osmand/plus/Version.java
+++ b/OsmAnd/src/net/osmand/plus/Version.java
@@ -13,7 +13,7 @@ public class Version {
private final static String FREE_VERSION_NAME = "net.osmand";
private final static String FREE_DEV_VERSION_NAME = "net.osmand.dev";
private final static String SHERPAFY_VERSION_NAME = "net.osmand.sherpafy";
-
+ private final static String UTM_REF = "&referrer=utm_source%3Dosmand";
public static boolean isGpsStatusEnabled(OsmandApplication ctx) {
return isGooglePlayEnabled(ctx) && !isBlackberry(ctx);
@@ -31,10 +31,14 @@ public class Version {
if (isAmazonEnabled(ctx)) {
return "amzn://apps/android?p=";
} else if (isGooglePlayEnabled(ctx)) {
- return "market://search?q=pname:";
+ return "market://details?id=";
}
return "https://osmand.net/apps?id=";
}
+
+ public static String getUrlWithUtmRef(OsmandApplication ctx, String appName) {
+ return marketPrefix(ctx) + appName + UTM_REF;
+ }
private static boolean isAmazonEnabled(OsmandApplication ctx) {
return ctx.getString(R.string.versionFeatures).contains("+amazon");
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 1898c46b29..c67aaab288 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -754,7 +754,11 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
public void dismissCardDialog() {
- getSupportFragmentManager().popBackStack(ContextMenuCardDialogFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
+ try {
+ getSupportFragmentManager().popBackStack(ContextMenuCardDialogFragment.TAG, FragmentManager.POP_BACK_STACK_INCLUSIVE);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
index f14528cb0f..19a617f998 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java
@@ -48,6 +48,7 @@ import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
import net.osmand.plus.dialogs.FavoriteDialogs;
import net.osmand.plus.download.IndexItem;
import net.osmand.plus.liveupdates.OsmLiveActivity;
+import net.osmand.plus.measurementtool.MeasurementToolFragment;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
import net.osmand.plus.routing.RoutingHelper;
@@ -695,6 +696,21 @@ public class MapActivityActions implements DialogProvider {
}
}).createItem());
+ optionsMenuHelper.addItem(new ContextMenuItem.ItemBuilder().setTitleId(R.string.measurement_tool, mapActivity)
+ .setIcon(R.drawable.ic_action_ruler)
+ .setListener(new ContextMenuAdapter.ItemClickListener() {
+ @Override
+ public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int position, boolean isChecked) {
+ MeasurementToolFragment fragment = new MeasurementToolFragment();
+ mapActivity.getSupportFragmentManager()
+ .beginTransaction()
+ .add(R.id.bottomFragmentContainer, fragment, MeasurementToolFragment.TAG)
+ .addToBackStack(MeasurementToolFragment.TAG)
+ .commitAllowingStateLoss();
+ return true;
+ }
+ }).createItem());
+
optionsMenuHelper.addItem(new ItemBuilder().setTitleId(R.string.get_directions, mapActivity)
.setIcon(R.drawable.ic_action_gdirections_dark)
.setListener(new ContextMenuAdapter.ItemClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java
index 2cad2d725d..37b8949691 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java
@@ -28,6 +28,7 @@ import net.osmand.plus.R;
import net.osmand.plus.SQLiteTileSource;
import net.osmand.plus.activities.MapActivity.ShowQuickSearchMode;
import net.osmand.plus.helpers.GpxUiHelper;
+import net.osmand.plus.measurementtool.MeasurementToolLayer;
import net.osmand.plus.poi.PoiFiltersHelper;
import net.osmand.plus.poi.PoiUIFilter;
import net.osmand.plus.quickaction.QuickActionRegistry;
@@ -88,6 +89,7 @@ public class MapActivityLayers {
private DownloadedRegionsLayer downloadedRegionsLayer;
private MapWidgetRegistry mapWidgetRegistry;
private QuickActionRegistry quickActionRegistry;
+ private MeasurementToolLayer measurementToolLayer;
private StateChangedListener transparencyListener;
@@ -148,6 +150,9 @@ public class MapActivityLayers {
// 4. favorites layer
mFavouritesLayer = new FavouritesLayer();
mapView.addLayer(mFavouritesLayer, 4);
+ // 4.6 measurement tool layer
+ measurementToolLayer = new MeasurementToolLayer();
+ mapView.addLayer(measurementToolLayer, 4.6f);
// 5. transport layer
transportStopsLayer = new TransportStopsLayer(activity);
mapView.addLayer(transportStopsLayer, 5);
@@ -583,6 +588,10 @@ public class MapActivityLayers {
return mFavouritesLayer;
}
+ public MeasurementToolLayer getMeasurementToolLayer() {
+ return measurementToolLayer;
+ }
+
public MapTextLayer getMapTextLayer() {
return mapTextLayer;
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/ShareDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/ShareDialog.java
index f147eef5be..300f9641d5 100644
--- a/OsmAnd/src/net/osmand/plus/activities/actions/ShareDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/actions/ShareDialog.java
@@ -198,8 +198,7 @@ public class ShareDialog {
builder.setPositiveButton(activity.getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix((OsmandApplication) activity.getApplication())
- + ZXING_BARCODE_SCANNER_COMPONENT));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.getUrlWithUtmRef((OsmandApplication) activity.getApplication(), ZXING_BARCODE_SCANNER_COMPONENT)));
try {
activity.startActivity(intent);
} catch (ActivityNotFoundException e) {
diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java b/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java
index 9a3ac4cc7b..d49079edd0 100644
--- a/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java
+++ b/OsmAnd/src/net/osmand/plus/activities/actions/StartGPSStatus.java
@@ -26,7 +26,6 @@ import net.osmand.AndroidUtils;
import net.osmand.plus.R;
import net.osmand.plus.Version;
import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.views.OsmandMapTileView;
public class StartGPSStatus extends OsmAndAction {
@@ -178,7 +177,7 @@ public class StartGPSStatus extends OsmAndAction {
builder.setPositiveButton(mapActivity.getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.marketPrefix(getMyApplication()) + g.appName));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.getUrlWithUtmRef(getMyApplication(), g.appName)));
try {
mapActivity.startActivity(intent);
} catch (ActivityNotFoundException e) {
diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java
index bd14cffd7a..78cfa17da5 100644
--- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java
+++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java
@@ -1,6 +1,7 @@
package net.osmand.plus.base;
import android.content.Context;
+import android.os.AsyncTask;
import android.support.v4.util.Pair;
import android.view.WindowManager;
@@ -150,28 +151,45 @@ public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLoc
return movingToMyLocation;
}
+ private void detectDrivingRegion(final LatLon latLon) {
+
+ new AsyncTask() {
+
+ @Override
+ protected BinaryMapDataObject doInBackground(LatLon... latLons) {
+ try {
+ if (latLons != null && latLons.length > 0) {
+ return app.getRegions().findBinaryMapDataObject(latLons[0]);
+ }
+ } catch (IOException e) {
+ // ignore
+ }
+ return null;
+ }
+
+ @Override
+ protected void onPostExecute(BinaryMapDataObject o) {
+ if (o != null) {
+ String fullName = app.getRegions().getFullName(o);
+ WorldRegion worldRegion = app.getRegions().getRegionData(fullName);
+ if (worldRegion != null) {
+ app.setupDrivingRegion(worldRegion);
+ }
+ }
+ }
+
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, latLon);
+ }
+
@Override
public void updateLocation(Location location) {
myLocation = location;
showViewAngle = false;
if (location != null) {
locationProvider = location.getProvider();
- if (settings.DRIVING_REGION_AUTOMATIC.get() && !drivingRegionUpdated) {
- try {
- BinaryMapDataObject o = app.getRegions().findBinaryMapDataObject(
- new LatLon(location.getLatitude(), location.getLongitude()));
- if (o != null) {
- String fullName = app.getRegions().getFullName(o);
- WorldRegion worldRegion = app.getRegions().getRegionData(fullName);
- if (worldRegion != null) {
- app.setupDrivingRegion(worldRegion);
- }
- }
- drivingRegionUpdated = true;
-
- } catch (IOException e) {
- // ignore
- }
+ if (settings.DRIVING_REGION_AUTOMATIC.get() && !drivingRegionUpdated && !app.isApplicationInitializing()) {
+ drivingRegionUpdated = true;
+ detectDrivingRegion(new LatLon(location.getLatitude(), location.getLongitude()));
}
}
if (mapView != null) {
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java
index bd7d2f5b1e..bb372f91f9 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java
@@ -86,7 +86,7 @@ public class DashRateUsFragment extends DashBaseFragment {
return;
case USER_LIKES_APP:
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
- Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
+ Uri uri = Uri.parse(Version.getUrlWithUtmRef(getMyApplication(), getActivity().getPackageName()));
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(goToMarket);
break;
diff --git a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java
index 93a12ec345..b6c437d614 100644
--- a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java
+++ b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java
@@ -115,7 +115,7 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
return;
case USER_LIKES_APP:
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
- Uri uri = Uri.parse(Version.marketPrefix(getMyApplication()) + getActivity().getPackageName());
+ Uri uri = Uri.parse(Version.getUrlWithUtmRef(getMyApplication(), getActivity().getPackageName()));
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(goToMarket);
break;
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
index 919f666165..55ff51d757 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java
@@ -248,7 +248,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo
} else {
app.logEvent(this, "paid_version_redirect");
Intent intent = new Intent(Intent.ACTION_VIEW,
- Uri.parse(Version.marketPrefix(app) + "net.osmand.plus"));
+ Uri.parse(Version.getUrlWithUtmRef(app, "net.osmand.plus")));
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
index 4e2c3013a0..3b029993df 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
@@ -381,7 +381,7 @@ public class DownloadIndexesThread {
builder.setPositiveButton(R.string.button_upgrade_osmandplus, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:net.osmand.plus"));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Version.getUrlWithUtmRef(app, "net.osmand.plus")));
try {
ctx.startActivity(intent);
} catch (ActivityNotFoundException e) {
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java b/OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java
index 36cb5733b3..4a7ec8f60d 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadValidationManager.java
@@ -224,8 +224,7 @@ public class DownloadValidationManager {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(Intent.ACTION_VIEW,
- Uri.parse(Version.marketPrefix(getMyApplication())
- + "net.osmand.plus"));
+ Uri.parse(Version.getUrlWithUtmRef(getMyApplication(), "net.osmand.plus")));
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
diff --git a/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java b/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java
index 8bd107fff7..a159d4bb6f 100644
--- a/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/download/ui/DataStoragePlaceDialogFragment.java
@@ -17,6 +17,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
+import net.osmand.IProgress;
import net.osmand.plus.OnDismissDialogFragmentListener;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
@@ -24,6 +25,7 @@ import net.osmand.plus.R;
import net.osmand.plus.base.BottomSheetDialogFragment;
import net.osmand.plus.dashboard.DashChooseAppDirFragment;
import net.osmand.plus.download.DownloadActivity;
+import net.osmand.plus.download.DownloadIndexesThread;
import java.io.File;
@@ -196,11 +198,22 @@ public class DataStoragePlaceDialogFragment extends BottomSheetDialogFragment {
return sz;
}
+ private void checkAssets() {
+ getMyApplication().getResourceManager().checkAssets(IProgress.EMPTY_PROGRESS, true);
+ }
+
+ private void updateDownloadIndexes() {
+ DownloadIndexesThread downloadIndexesThread = getMyApplication().getDownloadThread();
+ downloadIndexesThread.runReloadIndexFilesSilent();
+ }
+
private View.OnClickListener deviceMemoryOnClickListener =
new View.OnClickListener() {
@Override
public void onClick(View v) {
saveFilesLocation(deviceStorageType, deviceStorage, getActivity());
+ checkAssets();
+ updateDownloadIndexes();
isInterestedInFirstTime = false;
dismiss();
}
@@ -211,6 +224,8 @@ public class DataStoragePlaceDialogFragment extends BottomSheetDialogFragment {
@Override
public void onClick(View v) {
saveFilesLocation(sharedStorageType, sharedStorage, getActivity());
+ checkAssets();
+ updateDownloadIndexes();
isInterestedInFirstTime = false;
dismiss();
}
@@ -221,6 +236,8 @@ public class DataStoragePlaceDialogFragment extends BottomSheetDialogFragment {
@Override
public void onClick(View v) {
boolean res = saveFilesLocation(cardStorageType, cardStorage, getActivity());
+ checkAssets();
+ updateDownloadIndexes();
isInterestedInFirstTime = false;
if (res) {
dismiss();
diff --git a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java
index 44987b5ba3..c8abbd7808 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/DiscountHelper.java
@@ -147,7 +147,7 @@ public class DiscountHelper {
int i = url.indexOf("osmand-market-app:");
if (i != -1) {
String appName = url.substring(i + 18);
- return Version.marketPrefix(app) + appName;
+ return Version.getUrlWithUtmRef(app, appName);
}
}
return url;
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
index db9c5d808b..defbcb878b 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenu.java
@@ -305,6 +305,9 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
appModeChanged = false;
if (needAcquireMenuController) {
+ if (menuController != null) {
+ menuController.setMapContextMenu(null);
+ }
if (!acquireMenuController(restorePrevious)) {
active = false;
clearSelectedObject(object);
@@ -380,6 +383,13 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
}
}
+ public void rebuildMenu() {
+ WeakReference fragmentRef = findMenuFragment();
+ if (fragmentRef != null) {
+ fragmentRef.get().rebuildMenu();
+ }
+ }
+
public void showOrUpdate(LatLon latLon, PointDescription pointDescription, Object object) {
if (isVisible() && this.object != null && this.object.equals(object)) {
update(latLon, pointDescription, object);
@@ -526,6 +536,7 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
}
menuController = MenuController.getMenuController(mapActivity, latLon, pointDescription, object, MenuType.STANDARD);
if (menuController.setActive(true)) {
+ menuController.setMapContextMenu(this);
if (menuData != null && (object != menuData.getObject())
&& (menuController.hasBackAction() || menuData.hasBackAction())) {
historyStack.add(menuData);
@@ -598,17 +609,20 @@ public class MapContextMenu extends MenuTitleController implements StateChangedL
public void onSingleTapOnMap() {
if (menuController == null || !menuController.handleSingleTapOnMap()) {
- hide();
- if (mapActivity.getMapLayers().getMapQuickActionLayer().isLayerOn())
+ updateMapCenter(null);
+ close();
+ if (mapActivity.getMapLayers().getMapQuickActionLayer().isLayerOn()) {
mapActivity.getMapLayers().getMapQuickActionLayer().refreshLayer();
+ }
}
}
@Override
public void onSearchAddressDone() {
WeakReference fragmentRef = findMenuFragment();
- if (fragmentRef != null)
+ if (fragmentRef != null) {
fragmentRef.get().refreshTitle();
+ }
if (searchDoneAction != null) {
if (searchDoneAction.dlg != null) {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
index 31c250c646..ad152e32db 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MapContextMenuFragment.java
@@ -67,12 +67,6 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
ImageView fabView;
private MapContextMenu menu;
- private TitleButtonController leftTitleButtonController;
- private TitleButtonController rightTitleButtonController;
- private TitleButtonController topRightTitleButtonController;
- private TitleButtonController leftDownloadButtonController;
- private TitleButtonController rightDownloadButtonController;
- private TitleProgressController titleProgressController;
private int menuTopViewHeight;
private int menuTopShadowHeight;
@@ -107,6 +101,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
private float skipHalfScreenStateLimit;
private int screenOrientation;
+ private boolean created;
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override
@@ -130,14 +125,6 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
nightMode = menu.isNightMode();
mainView = view.findViewById(R.id.context_menu_main);
- leftTitleButtonController = menu.getLeftTitleButtonController();
- rightTitleButtonController = menu.getRightTitleButtonController();
- topRightTitleButtonController = menu.getTopRightTitleButtonController();
-
- leftDownloadButtonController = menu.getLeftDownloadButtonController();
- rightDownloadButtonController = menu.getRightDownloadButtonController();
- titleProgressController = menu.getTitleProgressController();
-
map = getMapActivity().getMapView();
RotatedTileBox box = map.getCurrentRotatedTileBox().copy();
customMapCenter = menu.getMapCenter() != null;
@@ -162,71 +149,77 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
// Left title button
final Button leftTitleButton = (Button) view.findViewById(R.id.title_button);
- if (leftTitleButtonController != null) {
- leftTitleButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
+ leftTitleButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleButtonController leftTitleButtonController = menu.getLeftTitleButtonController();
+ if (leftTitleButtonController != null) {
leftTitleButtonController.buttonPressed();
}
- });
- }
+ }
+ });
// Right title button
final Button rightTitleButton = (Button) view.findViewById(R.id.title_button_right);
- if (rightTitleButtonController != null) {
- rightTitleButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
+ rightTitleButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleButtonController rightTitleButtonController = menu.getRightTitleButtonController();
+ if (rightTitleButtonController != null) {
rightTitleButtonController.buttonPressed();
}
- });
- }
+ }
+ });
// Left download button
final Button leftDownloadButton = (Button) view.findViewById(R.id.download_button_left);
- if (leftDownloadButtonController != null) {
- leftDownloadButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
+ leftDownloadButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleButtonController leftDownloadButtonController = menu.getLeftDownloadButtonController();
+ if (leftDownloadButtonController != null) {
leftDownloadButtonController.buttonPressed();
}
- });
- }
+ }
+ });
// Right download button
final Button rightDownloadButton = (Button) view.findViewById(R.id.download_button_right);
- if (rightDownloadButtonController != null) {
- rightDownloadButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
+ rightDownloadButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleButtonController rightDownloadButtonController = menu.getRightDownloadButtonController();
+ if (rightDownloadButtonController != null) {
rightDownloadButtonController.buttonPressed();
}
- });
- }
+ }
+ });
// Top Right title button
final Button topRightTitleButton = (Button) view.findViewById(R.id.title_button_top_right);
- if (topRightTitleButtonController != null) {
- topRightTitleButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
+ topRightTitleButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleButtonController topRightTitleButtonController = menu.getTopRightTitleButtonController();
+ if (topRightTitleButtonController != null) {
topRightTitleButtonController.buttonPressed();
}
- });
- }
+ }
+ });
// Progress bar
- if (titleProgressController != null) {
- final ImageView progressButton = (ImageView) view.findViewById(R.id.progressButton);
- progressButton.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark,
- !nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
- progressButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
+ final ImageView progressButton = (ImageView) view.findViewById(R.id.progressButton);
+ progressButton.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_remove_dark,
+ !nightMode ? R.color.icon_color : R.color.dashboard_subheader_text_dark));
+ progressButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ TitleProgressController titleProgressController = menu.getTitleProgressController();
+ if (titleProgressController != null) {
titleProgressController.buttonPressed();
}
- });
- }
+ }
+ });
menu.updateData();
updateButtonsAndProgress();
@@ -471,6 +464,7 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
//getMapActivity().getMapLayers().getMapControlsLayer().setControlsClickable(false);
+ created = true;
return view;
}
@@ -583,6 +577,13 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
private void updateButtonsAndProgress() {
if (view != null) {
+ TitleButtonController leftTitleButtonController = menu.getLeftTitleButtonController();
+ TitleButtonController rightTitleButtonController = menu.getRightTitleButtonController();
+ TitleButtonController topRightTitleButtonController = menu.getTopRightTitleButtonController();
+ TitleButtonController leftDownloadButtonController = menu.getLeftDownloadButtonController();
+ TitleButtonController rightDownloadButtonController = menu.getRightDownloadButtonController();
+ TitleProgressController titleProgressController = menu.getTitleProgressController();
+
// Title buttons
boolean showTitleButtonsContainer = (leftTitleButtonController != null || rightTitleButtonController != null);
final View titleButtonsContainer = view.findViewById(R.id.title_button_container);
@@ -848,12 +849,39 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
line2LineHeight = line2.getLineHeight();
line2MeasuredHeight = line2.getMeasuredHeight();
}
+
+ int dp16 = dpToPx(16f);
+ int titleButtonHeight = 0;
+ View titleButtonContainer = view.findViewById(R.id.title_button_container);
+ if (titleButtonContainer.getVisibility() == View.VISIBLE) {
+ titleButtonHeight = titleButtonContainer.getMeasuredHeight() - dp16;
+ if (titleButtonHeight < 0) {
+ titleButtonHeight = 0;
+ }
+ }
+ int downloadButtonsHeight = 0;
+ View downloadButtonsContainer = view.findViewById(R.id.download_buttons_container);
+ if (downloadButtonsContainer.getVisibility() == View.VISIBLE) {
+ downloadButtonsHeight = downloadButtonsContainer.getMeasuredHeight() - dp16;
+ if (downloadButtonsHeight < 0) {
+ downloadButtonsHeight = 0;
+ }
+ }
+ int titleProgressHeight = 0;
+ View titleProgressContainer = view.findViewById(R.id.title_progress_container);
+ if (titleProgressContainer.getVisibility() == View.VISIBLE) {
+ titleProgressHeight = titleProgressContainer.getMeasuredHeight() - dp16;
+ if (titleProgressHeight < 0) {
+ titleProgressHeight = 0;
+ }
+ }
+
if (menuTopViewHeight != 0) {
int titleHeight = line1.getLineCount() * line1.getLineHeight() + line2LineCount * line2LineHeight + menuTitleTopBottomPadding;
if (titleHeight < line1.getMeasuredHeight() + line2MeasuredHeight) {
titleHeight = line1.getMeasuredHeight() + line2MeasuredHeight;
}
- newMenuTopViewHeight = menuTopViewHeightExcludingTitle + titleHeight;
+ newMenuTopViewHeight = menuTopViewHeightExcludingTitle + titleHeight + titleButtonHeight + downloadButtonsHeight + titleProgressHeight;
dy = Math.max(0, newMenuTopViewHeight - menuTopViewHeight - (newMenuTopShadowAllHeight - menuTopShadowAllHeight));
} else {
menuTopViewHeightExcludingTitle = newMenuTopViewHeight - line1.getMeasuredHeight() - line2MeasuredHeight;
@@ -1268,9 +1296,11 @@ public class MapContextMenuFragment extends Fragment implements DownloadEvents {
}
public void updateMenu() {
- menu.updateData();
- updateButtonsAndProgress();
- runLayoutListener();
+ if (created) {
+ menu.updateData();
+ updateButtonsAndProgress();
+ runLayoutListener();
+ }
}
private MapActivity getMapActivity() {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
index ee9ed33d97..c858409ee6 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java
@@ -1,6 +1,7 @@
package net.osmand.plus.mapcontextmenu;
import android.graphics.drawable.Drawable;
+import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.View.OnClickListener;
@@ -86,6 +87,7 @@ public abstract class MenuController extends BaseMenuController {
MULTI_LINE
}
+ protected MapContextMenu mapContextMenu;
protected MenuBuilder builder;
private int currentMenuState;
private MenuType menuType = MenuType.STANDARD;
@@ -117,6 +119,10 @@ public abstract class MenuController extends BaseMenuController {
this.builder.setLight(isLight());
}
+ public void setMapContextMenu(MapContextMenu mapContextMenu) {
+ this.mapContextMenu = mapContextMenu;
+ }
+
public void build(View rootView) {
for (OsmandPlugin plugin : OsmandPlugin.getEnabledPlugins()) {
if (plugin.isMenuControllerSupported(this.getClass())) {
@@ -531,114 +537,137 @@ public abstract class MenuController extends BaseMenuController {
}
}
- public void buildMapDownloadButton(LatLon latLon) {
- int point31x = MapUtils.get31TileNumberX(latLon.getLongitude());
- int point31y = MapUtils.get31TileNumberY(latLon.getLatitude());
+ public void buildMapDownloadButton(final LatLon latLon) {
+ new AsyncTask() {
- ResourceManager rm = getMapActivity().getMyApplication().getResourceManager();
- OsmandRegions osmandRegions = rm.getOsmandRegions();
-
- List mapDataObjects = null;
- try {
- mapDataObjects = osmandRegions.queryBbox(point31x, point31x, point31y, point31y);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- if (mapDataObjects != null) {
- Iterator it = mapDataObjects.iterator();
- while (it.hasNext()) {
- BinaryMapDataObject o = it.next();
- if (o.getTypes() != null) {
- boolean isRegion = true;
- for (int i = 0; i < o.getTypes().length; i++) {
- TagValuePair tp = o.getMapIndex().decodeType(o.getTypes()[i]);
- if ("boundary".equals(tp.value)) {
- isRegion = false;
- break;
- }
- }
- if (!isRegion || !osmandRegions.contain(o, point31x, point31y)) {
- it.remove();
- }
- }
- }
+ ResourceManager rm;
+ OsmandRegions osmandRegions;
String selectedFullName = "";
- double smallestArea = -1;
- downloadMapDataObject = null;
- for (BinaryMapDataObject o : mapDataObjects) {
- String downloadName = osmandRegions.getDownloadName(o);
- if (!Algorithms.isEmpty(downloadName)) {
- boolean downloaded = checkIfObjectDownloaded(rm, downloadName);
- if (downloaded) {
- downloadMapDataObject = null;
- break;
- } else {
- String fullName = osmandRegions.getFullName(o);
- WorldRegion region = osmandRegions.getRegionData(fullName);
- if (region != null && region.isRegionMapDownload()) {
- double area = OsmandRegions.getArea(o);
- if (smallestArea == -1) {
- smallestArea = area;
- selectedFullName = fullName;
- downloadMapDataObject = o;
- } else if (area < smallestArea) {
- smallestArea = area;
- selectedFullName = fullName;
- downloadMapDataObject = o;
+
+ @Override
+ protected void onPreExecute() {
+ rm = getMapActivity().getMyApplication().getResourceManager();
+ osmandRegions = rm.getOsmandRegions();
+ }
+
+ @Override
+ protected BinaryMapDataObject doInBackground(Void... voids) {
+
+ int point31x = MapUtils.get31TileNumberX(latLon.getLongitude());
+ int point31y = MapUtils.get31TileNumberY(latLon.getLatitude());
+
+ List mapDataObjects = null;
+ try {
+ mapDataObjects = osmandRegions.queryBbox(point31x, point31x, point31y, point31y);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ BinaryMapDataObject binaryMapDataObject = null;
+ if (mapDataObjects != null) {
+ Iterator it = mapDataObjects.iterator();
+ while (it.hasNext()) {
+ BinaryMapDataObject o = it.next();
+ if (o.getTypes() != null) {
+ boolean isRegion = true;
+ for (int i = 0; i < o.getTypes().length; i++) {
+ TagValuePair tp = o.getMapIndex().decodeType(o.getTypes()[i]);
+ if ("boundary".equals(tp.value)) {
+ isRegion = false;
+ break;
+ }
+ }
+ if (!isRegion || !osmandRegions.contain(o, point31x, point31y)) {
+ it.remove();
+ }
+ }
+ }
+ double smallestArea = -1;
+ for (BinaryMapDataObject o : mapDataObjects) {
+ String downloadName = osmandRegions.getDownloadName(o);
+ if (!Algorithms.isEmpty(downloadName)) {
+ boolean downloaded = checkIfObjectDownloaded(rm, downloadName);
+ if (downloaded) {
+ binaryMapDataObject = null;
+ break;
+ } else {
+ String fullName = osmandRegions.getFullName(o);
+ WorldRegion region = osmandRegions.getRegionData(fullName);
+ if (region != null && region.isRegionMapDownload()) {
+ double area = OsmandRegions.getArea(o);
+ if (smallestArea == -1) {
+ smallestArea = area;
+ selectedFullName = fullName;
+ binaryMapDataObject = o;
+ } else if (area < smallestArea) {
+ smallestArea = area;
+ selectedFullName = fullName;
+ binaryMapDataObject = o;
+ }
+ }
}
}
}
}
+
+ return binaryMapDataObject;
}
- downloaded = downloadMapDataObject == null;
- if (!downloaded) {
- downloadThread = getMapActivity().getMyApplication().getDownloadThread();
- downloadRegion = osmandRegions.getRegionData(selectedFullName);
- if (downloadRegion != null && downloadRegion.isRegionMapDownload()) {
- List indexItems = downloadThread.getIndexes().getIndexItems(downloadRegion);
- for (IndexItem item : indexItems) {
- if (item.getType() == DownloadActivityType.NORMAL_FILE
- && (item.isDownloaded() || downloadThread.isDownloading(item))) {
- indexItem = item;
- }
- }
- }
-
- leftDownloadButtonController = new TitleButtonController() {
- @Override
- public void buttonPressed() {
- if (indexItem != null) {
- if (indexItem.getType() == DownloadActivityType.NORMAL_FILE) {
- new DownloadValidationManager(getMapActivity().getMyApplication())
- .startDownload(getMapActivity(), indexItem);
+ @Override
+ protected void onPostExecute(BinaryMapDataObject binaryMapDataObject) {
+ downloadMapDataObject = binaryMapDataObject;
+ downloaded = downloadMapDataObject == null;
+ if (!downloaded) {
+ downloadThread = getMapActivity().getMyApplication().getDownloadThread();
+ downloadRegion = osmandRegions.getRegionData(selectedFullName);
+ if (downloadRegion != null && downloadRegion.isRegionMapDownload()) {
+ List indexItems = downloadThread.getIndexes().getIndexItems(downloadRegion);
+ for (IndexItem item : indexItems) {
+ if (item.getType() == DownloadActivityType.NORMAL_FILE
+ && (item.isDownloaded() || downloadThread.isDownloading(item))) {
+ indexItem = item;
}
}
}
- };
- leftDownloadButtonController.caption =
- downloadRegion != null ? downloadRegion.getLocaleName() : getMapActivity().getString(R.string.shared_string_download);
- leftDownloadButtonController.leftIconId = R.drawable.ic_action_import;
- titleProgressController = new TitleProgressController() {
- @Override
- public void buttonPressed() {
- if (indexItem != null) {
- downloadThread.cancelDownload(indexItem);
+ leftDownloadButtonController = new TitleButtonController() {
+ @Override
+ public void buttonPressed() {
+ if (indexItem != null) {
+ if (indexItem.getType() == DownloadActivityType.NORMAL_FILE) {
+ new DownloadValidationManager(getMapActivity().getMyApplication())
+ .startDownload(getMapActivity(), indexItem);
+ }
+ }
+ }
+ };
+ leftDownloadButtonController.caption =
+ downloadRegion != null ? downloadRegion.getLocaleName() : getMapActivity().getString(R.string.shared_string_download);
+ leftDownloadButtonController.leftIconId = R.drawable.ic_action_import;
+
+ titleProgressController = new TitleProgressController() {
+ @Override
+ public void buttonPressed() {
+ if (indexItem != null) {
+ downloadThread.cancelDownload(indexItem);
+ }
+ }
+ };
+
+ if (!downloadThread.getIndexes().isDownloadedFromInternet) {
+ if (getMapActivity().getMyApplication().getSettings().isInternetConnectionAvailable()) {
+ downloadThread.runReloadIndexFiles();
}
}
- };
- if (!downloadThread.getIndexes().isDownloadedFromInternet) {
- if (getMapActivity().getMyApplication().getSettings().isInternetConnectionAvailable()) {
- downloadThread.runReloadIndexFiles();
+ if (mapContextMenu != null) {
+ mapContextMenu.updateMenuUI();
}
}
-
- updateData();
}
- }
+
+ }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+
}
private boolean checkIfObjectDownloaded(ResourceManager rm, String downloadName) {
diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/dialogs/ContextMenuCardDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/dialogs/ContextMenuCardDialogFragment.java
index e9a674bc75..259e680f9c 100644
--- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/dialogs/ContextMenuCardDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/builders/cards/dialogs/ContextMenuCardDialogFragment.java
@@ -109,7 +109,7 @@ public class ContextMenuCardDialogFragment extends Fragment {
fragment.dialog = menu;
menu.getMapActivity().getSupportFragmentManager().beginTransaction()
.replace(R.id.topFragmentContainer, fragment, TAG)
- .addToBackStack(TAG).commit();
+ .addToBackStack(TAG).commitAllowingStateLoss();
}
public void dismiss() {
diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryInstallDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryInstallDialogFragment.java
index 430f92a92a..2d4d4b477e 100644
--- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryInstallDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryInstallDialogFragment.java
@@ -35,7 +35,7 @@ public class MapillaryInstallDialogFragment extends DialogFragment {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
- MapillaryPlugin.installMapillary(mapActivity.getMyApplication());
+ MapillaryPlugin.installMapillary(mapActivity, mapActivity.getMyApplication());
}
});
diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java
index 1eb7d18913..86146dd45a 100644
--- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java
@@ -2,6 +2,7 @@ package net.osmand.plus.mapillary;
import android.app.Activity;
import android.content.ActivityNotFoundException;
+import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@@ -23,6 +24,7 @@ import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
+import net.osmand.plus.Version;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.MapActivityLayers;
import net.osmand.plus.base.BottomSheetDialogFragment;
@@ -34,6 +36,7 @@ import net.osmand.plus.views.mapwidgets.MapWidgetRegistry.MapWidgetRegInfo;
import net.osmand.plus.views.mapwidgets.TextInfoWidget;
import net.osmand.util.Algorithms;
+import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.List;
@@ -235,8 +238,9 @@ public class MapillaryPlugin extends OsmandPlugin {
return success;
}
- public static boolean installMapillary(OsmandApplication app) {
- boolean success = execInstall(app, "market://search?q=pname:" + MAPILLARY_PACKAGE_ID);
+ public static boolean installMapillary(Activity activity, OsmandApplication app) {
+ app.logEvent(activity, "install_mapillary");
+ boolean success = execInstall(app, Version.getUrlWithUtmRef(app, MAPILLARY_PACKAGE_ID));
if (!success) {
success = execInstall(app, "https://play.google.com/store/apps/details?id=" + MAPILLARY_PACKAGE_ID);
}
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
new file mode 100644
index 0000000000..ef3eb32057
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java
@@ -0,0 +1,149 @@
+package net.osmand.plus.measurementtool;
+
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import net.osmand.AndroidUtils;
+import net.osmand.plus.IconsCache;
+import net.osmand.plus.R;
+import net.osmand.plus.activities.MapActivity;
+
+public class MeasurementToolFragment extends Fragment {
+
+ public static final String TAG = "MeasurementToolFragment";
+
+ private TextView distanceTv;
+ private TextView pointsTv;
+ private String pointsSt;
+
+ private boolean wasCollapseButtonVisible;
+
+ @Nullable
+ @Override
+ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
+ MapActivity mapActivity = (MapActivity) getActivity();
+ final MeasurementToolLayer measurementLayer = mapActivity.getMapLayers().getMeasurementToolLayer();
+ IconsCache iconsCache = mapActivity.getMyApplication().getIconsCache();
+ final boolean nightMode = mapActivity.getMyApplication().getDaynightHelper().isNightModeForMapControls();
+ final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme;
+
+ pointsSt = mapActivity.getString(R.string.points).toLowerCase();
+
+ View view = View.inflate(new ContextThemeWrapper(getContext(), themeRes), R.layout.fragment_measurement_tool, null);
+
+ final View mainView = view.findViewById(R.id.main_view);
+ AndroidUtils.setBackground(mapActivity, mainView, nightMode, R.drawable.bg_bottom_menu_light, R.drawable.bg_bottom_menu_dark);
+
+ distanceTv = (TextView) mainView.findViewById(R.id.measurement_distance_text_view);
+ pointsTv = (TextView) mainView.findViewById(R.id.measurement_points_text_view);
+
+ ((ImageView) mainView.findViewById(R.id.ruler_icon))
+ .setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_ruler, R.color.color_myloc_distance));
+ ((ImageView) mainView.findViewById(R.id.up_down_icon))
+ .setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_arrow_up));
+ ((ImageView) mainView.findViewById(R.id.previous_dot_icon))
+ .setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_undo_dark));
+ ((ImageView) mainView.findViewById(R.id.next_dot_icon))
+ .setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_redo_dark));
+
+ mainView.findViewById(R.id.add_point_button).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ measurementLayer.addPointOnClick();
+ updateText();
+ }
+ });
+
+ enterMeasurementMode();
+
+ return view;
+ }
+
+ @Override
+ public void onDestroyView() {
+ super.onDestroyView();
+ exitMeasurementMode();
+ }
+
+ private MapActivity getMapActivity() {
+ return (MapActivity) getActivity();
+ }
+
+ private MeasurementToolLayer getMeasurementLayer() {
+ MapActivity mapActivity = getMapActivity();
+ if (mapActivity != null) {
+ return mapActivity.getMapLayers().getMeasurementToolLayer();
+ }
+ return null;
+ }
+
+ private void updateText() {
+ MeasurementToolLayer measurementLayer = getMeasurementLayer();
+ if (measurementLayer != null) {
+ distanceTv.setText(measurementLayer.getDistanceSt() + ",");
+ pointsTv.setText(pointsSt + ": " + measurementLayer.getPointsCount());
+ }
+ }
+
+ private void enterMeasurementMode() {
+ MapActivity mapActivity = getMapActivity();
+ MeasurementToolLayer measurementLayer = getMeasurementLayer();
+ if (mapActivity != null && measurementLayer != null) {
+ measurementLayer.setInMeasurementMode(true);
+ mapActivity.refreshMap();
+ mapActivity.disableDrawer();
+ mark(View.INVISIBLE, R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info);
+ mark(View.GONE, R.id.map_route_info_button, R.id.map_menu_button, R.id.map_compass_button, R.id.map_layers_button,
+ R.id.map_search_button, R.id.map_quick_actions_button);
+
+ View collapseButton = mapActivity.findViewById(R.id.map_collapse_button);
+ if (collapseButton != null && collapseButton.getVisibility() == View.VISIBLE) {
+ wasCollapseButtonVisible = true;
+ collapseButton.setVisibility(View.INVISIBLE);
+ } else {
+ wasCollapseButtonVisible = false;
+ }
+
+ updateText();
+ }
+ }
+
+ private void exitMeasurementMode() {
+ MapActivity mapActivity = getMapActivity();
+ MeasurementToolLayer measurementLayer = getMeasurementLayer();
+ if (mapActivity != null && measurementLayer != null) {
+ measurementLayer.setInMeasurementMode(false);
+ mapActivity.refreshMap();
+ mapActivity.enableDrawer();
+ mark(View.VISIBLE, R.id.map_left_widgets_panel, R.id.map_right_widgets_panel, R.id.map_center_info,
+ R.id.map_route_info_button, R.id.map_menu_button, R.id.map_compass_button, R.id.map_layers_button,
+ R.id.map_search_button, R.id.map_quick_actions_button);
+
+ View collapseButton = mapActivity.findViewById(R.id.map_collapse_button);
+ if (collapseButton != null && wasCollapseButtonVisible) {
+ collapseButton.setVisibility(View.VISIBLE);
+ }
+
+ measurementLayer.clearPoints();
+ }
+ }
+
+ private void mark(int status, int... widgets) {
+ MapActivity mapActivity = getMapActivity();
+ if (mapActivity != null) {
+ for (int widget : widgets) {
+ View v = mapActivity.findViewById(widget);
+ if (v != null) {
+ v.setVisibility(status);
+ }
+ }
+ }
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java
new file mode 100644
index 0000000000..73a28ef780
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolLayer.java
@@ -0,0 +1,149 @@
+package net.osmand.plus.measurementtool;
+
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Path;
+
+import net.osmand.data.LatLon;
+import net.osmand.data.QuadPoint;
+import net.osmand.data.RotatedTileBox;
+import net.osmand.plus.GPXUtilities.WptPt;
+import net.osmand.plus.OsmAndFormatter;
+import net.osmand.plus.R;
+import net.osmand.plus.views.OsmandMapLayer;
+import net.osmand.plus.views.OsmandMapTileView;
+import net.osmand.util.MapUtils;
+
+import java.util.LinkedList;
+
+import gnu.trove.list.array.TIntArrayList;
+
+public class MeasurementToolLayer extends OsmandMapLayer {
+
+ private OsmandMapTileView view;
+ private boolean inMeasurementMode;
+ private LinkedList measurementPoints = new LinkedList<>();
+ private Bitmap centerIconDay;
+ private Bitmap centerIconNight;
+ private Bitmap pointIcon;
+ private Paint bitmapPaint;
+ private RenderingLineAttributes lineAttrs = new RenderingLineAttributes("rulerLine");
+ private Path path = new Path();
+ private int marginX;
+ private int marginY;
+ private TIntArrayList tx = new TIntArrayList();
+ private TIntArrayList ty = new TIntArrayList();
+
+ @Override
+ public void initLayer(OsmandMapTileView view) {
+ this.view = view;
+
+ centerIconDay = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_ruler_center_day);
+ centerIconNight = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_ruler_center_night);
+ pointIcon = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_pedestrian_location);
+
+ bitmapPaint = new Paint();
+ bitmapPaint.setAntiAlias(true);
+ bitmapPaint.setDither(true);
+ bitmapPaint.setFilterBitmap(true);
+
+ marginY = pointIcon.getHeight() / 2;
+ marginX = pointIcon.getWidth() / 2;
+ }
+
+ public boolean isInMeasurementMode() {
+ return inMeasurementMode;
+ }
+
+ void setInMeasurementMode(boolean inMeasurementMode) {
+ this.inMeasurementMode = inMeasurementMode;
+ }
+
+ int getPointsCount() {
+ return measurementPoints.size();
+ }
+
+ String getDistanceSt() {
+ float dist = 0;
+ if (measurementPoints.size() > 0) {
+ for (int i = 1; i < measurementPoints.size(); i++) {
+ dist += MapUtils.getDistance(measurementPoints.get(i - 1).lat, measurementPoints.get(i - 1).lon,
+ measurementPoints.get(i).lat, measurementPoints.get(i).lon);
+ }
+ }
+ return OsmAndFormatter.getFormattedDistance(dist, view.getApplication());
+ }
+
+ void clearPoints() {
+ measurementPoints.clear();
+ }
+
+ @Override
+ public void onDraw(Canvas canvas, RotatedTileBox tb, DrawSettings settings) {
+ if (inMeasurementMode) {
+ lineAttrs.updatePaints(view, settings, tb);
+ drawCenterIcon(canvas, tb, tb.getCenterPixelPoint(), settings.isNightMode());
+
+ if (measurementPoints.size() > 0) {
+ path.reset();
+ tx.reset();
+ ty.reset();
+ for (int i = 0; i < measurementPoints.size(); i++) {
+ WptPt pt = measurementPoints.get(i);
+ int locX = tb.getPixXFromLonNoRot(pt.lon);
+ int locY = tb.getPixYFromLatNoRot(pt.lat);
+ if (i == 0) {
+ path.moveTo(locX, locY);
+ } else {
+ path.lineTo(locX, locY);
+ }
+ tx.add(locX);
+ ty.add(locY);
+
+ if (tb.containsLatLon(pt.lat, pt.lon)) {
+ canvas.drawBitmap(pointIcon, locX - marginX, locY - marginY, bitmapPaint);
+ }
+ }
+ path.lineTo(tb.getCenterPixelX(), tb.getCenterPixelY());
+ tx.add(tb.getCenterPixelX());
+ ty.add(tb.getCenterPixelY());
+ calculatePath(tb, tx, ty, path);
+ canvas.drawPath(path, lineAttrs.paint);
+ }
+ }
+ }
+
+ private void drawCenterIcon(Canvas canvas, RotatedTileBox tb, QuadPoint center, boolean nightMode) {
+ canvas.rotate(-tb.getRotate(), center.x, center.y);
+ if (nightMode) {
+ canvas.drawBitmap(centerIconNight, center.x - centerIconNight.getWidth() / 2,
+ center.y - centerIconNight.getHeight() / 2, bitmapPaint);
+ } else {
+ canvas.drawBitmap(centerIconDay, center.x - centerIconDay.getWidth() / 2,
+ center.y - centerIconDay.getHeight() / 2, bitmapPaint);
+ }
+ canvas.rotate(tb.getRotate(), center.x, center.y);
+ }
+
+ void addPointOnClick() {
+ RotatedTileBox tb = view.getCurrentRotatedTileBox();
+ LatLon l = tb.getLatLonFromPixel(tb.getCenterPixelX(), tb.getCenterPixelY());
+ WptPt pt = new WptPt();
+ pt.lat = l.getLatitude();
+ pt.lon = l.getLongitude();
+ measurementPoints.add(pt);
+ view.refreshMap();
+ }
+
+ @Override
+ public void destroyLayer() {
+
+ }
+
+ @Override
+ public boolean drawInScreenPixels() {
+ return false;
+ }
+}
diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java
index 9567a91566..47c1816cee 100644
--- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java
+++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java
@@ -236,7 +236,11 @@ public class TrackSegmentFragment extends OsmAndListFragment {
}
private GPXFile getGpx() {
- return getTrackActivity().getGpx();
+ TrackActivity activity = getTrackActivity();
+ if (activity == null) {
+ return null;
+ }
+ return activity.getGpx();
}
private GpxDataItem getGpxDataItem() {
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java b/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java
index 9477428426..86fd7d853c 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/UploadOpenstreetmapPointAsyncTask.java
@@ -96,7 +96,7 @@ public class UploadOpenstreetmapPointAsyncTask
@Override
protected void onPostExecute(Map loadErrorsMap) {
if (progress != null) {
- progress.dismiss();
+ progress.dismissAllowingStateLoss();
}
listener.uploadEnded(loadErrorsMap);
}
diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java
index c4134a7f69..58b53cb878 100644
--- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java
+++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java
@@ -578,14 +578,19 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable
private void putAllAcceptedTypes(Map> types) {
for (PoiCategory category : types.keySet()) {
+ LinkedHashSet typesSet = types.get(category);
if (acceptedTypes.containsKey(category)) {
- if (acceptedTypes.get(category) != null && types.get(category) != null) {
- acceptedTypes.get(category).addAll(types.get(category));
+ if (acceptedTypes.get(category) != null && typesSet != null) {
+ acceptedTypes.get(category).addAll(typesSet);
} else {
acceptedTypes.put(category, null);
}
} else {
- acceptedTypes.put(category, new LinkedHashSet<>(types.get(category)));
+ if (typesSet != null) {
+ acceptedTypes.put(category, new LinkedHashSet<>(typesSet));
+ } else {
+ acceptedTypes.put(category, null);
+ }
}
}
}
diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java
index 26fa4599c1..98255722b9 100644
--- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java
+++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java
@@ -350,7 +350,7 @@ public class ResourceManager {
public List reloadIndexesOnStart(AppInitializer progress, List warnings){
close();
// check we have some assets to copy to sdcard
- warnings.addAll(checkAssets(progress));
+ warnings.addAll(checkAssets(progress, false));
progress.notifyEvent(InitEvents.ASSETS_COPIED);
reloadIndexes(progress, warnings);
progress.notifyEvent(InitEvents.MAPS_INITIALIZED);
@@ -414,9 +414,9 @@ public class ResourceManager {
return warnings;
}
- private List checkAssets(IProgress progress) {
+ public List checkAssets(IProgress progress, boolean forceUpdate) {
String fv = Version.getFullVersion(context);
- if (!fv.equalsIgnoreCase(context.getSettings().PREVIOUS_INSTALLED_VERSION.get())) {
+ if (!fv.equalsIgnoreCase(context.getSettings().PREVIOUS_INSTALLED_VERSION.get()) || forceUpdate) {
File applicationDataDir = context.getAppPath(null);
applicationDataDir.mkdirs();
if (applicationDataDir.canWrite()) {
@@ -424,7 +424,7 @@ public class ResourceManager {
progress.startTask(context.getString(R.string.installing_new_resources), -1);
AssetManager assetManager = context.getAssets();
boolean isFirstInstall = context.getSettings().PREVIOUS_INSTALLED_VERSION.get().equals("");
- unpackBundledAssets(assetManager, applicationDataDir, progress, isFirstInstall);
+ unpackBundledAssets(assetManager, applicationDataDir, progress, isFirstInstall || forceUpdate);
context.getSettings().PREVIOUS_INSTALLED_VERSION.set(fv);
copyRegionsBoundaries();
// see Issue #3381
diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
index eb033497c0..d83e382a23 100644
--- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java
@@ -861,7 +861,8 @@ public class ContextMenuLayer extends OsmandMapLayer {
if (movementListener.onTouchEvent(event)) {
if (menu.isVisible()) {
- menu.hide();
+ menu.updateMapCenter(null);
+ menu.close();
}
if (multiSelectionMenu.isVisible()) {
multiSelectionMenu.hide();
diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
index bc05ca3953..8c7dc0d5de 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java
@@ -712,7 +712,7 @@ public class MapControlsLayer extends OsmandMapLayer {
((app.accessibilityEnabled() || (System.currentTimeMillis() - touchEvent < TIMEOUT_TO_SHOW_BUTTONS)) && routeFollowingMode);
updateMyLocation(rh, routeDialogOpened || trackDialogOpened);
boolean showButtons = (showRouteCalculationControls || !routeFollowingMode)
- && !isInMovingMarkerMode() && !isInGpxDetailsMode();
+ && !isInMovingMarkerMode() && !isInGpxDetailsMode() && !isInMeasurementToolMode();
//routePlanningBtn.setIconResId(routeFollowingMode ? R.drawable.ic_action_gabout_dark : R.drawable.map_directions);
if (rh.isFollowingMode()) {
routePlanningBtn.setIconResId(R.drawable.map_start_navigation);
@@ -729,13 +729,14 @@ public class MapControlsLayer extends OsmandMapLayer {
mapZoomIn.updateVisibility(!routeDialogOpened);
mapZoomOut.updateVisibility(!routeDialogOpened);
- compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass());
+ compassHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && shouldShowCompass() &&
+ !isInMeasurementToolMode());
if (layersHud.setIconResId(settings.getApplicationMode().getMapIconId())) {
layersHud.update(app, isNight);
}
- layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened);
- quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened);
+ layersHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode());
+ quickSearchHud.updateVisibility(!routeDialogOpened && !trackDialogOpened && !isInMeasurementToolMode());
if (!routePlanningMode && !routeFollowingMode) {
if (mapView.isZooming()) {
@@ -1127,6 +1128,10 @@ public class MapControlsLayer extends OsmandMapLayer {
return contextMenuLayer.isInGpxDetailsMode();
}
+ private boolean isInMeasurementToolMode() {
+ return mapActivity.getMapLayers().getMeasurementToolLayer().isInMeasurementMode();
+ }
+
public static View.OnLongClickListener getOnClickMagnifierListener(final OsmandMapTileView view) {
return new View.OnLongClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java
index 3170b2742a..c5365d41ff 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapQuickActionLayer.java
@@ -25,6 +25,7 @@ import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
+import net.osmand.plus.measurementtool.MeasurementToolLayer;
import net.osmand.plus.quickaction.QuickAction;
import net.osmand.plus.quickaction.QuickActionFactory;
import net.osmand.plus.quickaction.QuickActionRegistry;
@@ -39,6 +40,7 @@ import static net.osmand.plus.views.ContextMenuLayer.VIBRATE_SHORT;
public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRegistry.QuickActionUpdatesListener, QuickAction.QuickActionSelectionListener {
private final ContextMenuLayer contextMenuLayer;
+ private final MeasurementToolLayer measurementToolLayer;
private ImageView contextMarker;
private final MapActivity mapActivity;
private final OsmandApplication app;
@@ -63,6 +65,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
app = activity.getMyApplication();
settings = activity.getMyApplication().getSettings();
quickActionRegistry = activity.getMapLayers().getQuickActionRegistry();
+ measurementToolLayer = mapActivity.getMapLayers().getMeasurementToolLayer();
}
@@ -319,6 +322,7 @@ public class MapQuickActionLayer extends OsmandMapLayer implements QuickActionRe
boolean hideQuickButton = !isLayerOn ||
contextMenuLayer.isInChangeMarkerPositionMode() ||
contextMenuLayer.isInGpxDetailsMode() ||
+ measurementToolLayer.isInMeasurementMode() ||
mapActivity.getContextMenu().isVisible() && !mapActivity.getContextMenu().findMenuFragment().get().isRemoving() ||
mapActivity.getContextMenu().isVisible() && mapActivity.getContextMenu().findMenuFragment().get().isAdded() ||
mapActivity.getContextMenu().getMultiSelectionMenu().isVisible() && mapActivity.getContextMenu().getMultiSelectionMenu().getFragmentByTag().isAdded() ||
diff --git a/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java b/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java
index d5426f8038..de3f71b452 100644
--- a/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/RulerControlLayer.java
@@ -5,7 +5,6 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
-import android.graphics.Path;
import android.graphics.PointF;
import android.graphics.Rect;
import android.os.Handler;
@@ -19,14 +18,13 @@ import net.osmand.data.QuadPoint;
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandSettings;
import net.osmand.plus.OsmandSettings.RulerMode;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import java.util.ArrayList;
-import gnu.trove.list.array.TIntArrayList;
-
public class RulerControlLayer extends OsmandMapLayer {
private static final long DRAW_TIME = 2000;
@@ -49,14 +47,13 @@ public class RulerControlLayer extends OsmandMapLayer {
private int acceptableTouchRadius;
private QuadPoint cacheCenter;
+ private float cacheMapDensity;
+ private OsmandSettings.OsmandPreference mapDensity;
private int cacheIntZoom;
private double cacheTileX;
private double cacheTileY;
private long cacheMultiTouchEndTime;
private ArrayList cacheDistances;
- private Path distancePath;
- private TIntArrayList tx;
- private TIntArrayList ty;
private LatLon touchPointLatLon;
private PointF touchPoint;
private long touchStartTime;
@@ -93,13 +90,12 @@ public class RulerControlLayer extends OsmandMapLayer {
public void initLayer(final OsmandMapTileView view) {
app = mapActivity.getMyApplication();
this.view = view;
+ mapDensity = mapActivity.getMyApplication().getSettings().MAP_DENSITY;
+ cacheMapDensity = mapDensity.get();
cacheDistances = new ArrayList<>();
cacheCenter = new QuadPoint();
maxRadiusInDp = mapActivity.getResources().getDimensionPixelSize(R.dimen.map_ruler_width);
rightWidgetsPanel = mapActivity.findViewById(R.id.map_right_widgets_panel);
- distancePath = new Path();
- tx = new TIntArrayList();
- ty = new TIntArrayList();
touchPoint = new PointF();
acceptableTouchRadius = mapActivity.getResources().getDimensionPixelSize(R.dimen.acceptable_touch_radius);
@@ -307,12 +303,13 @@ public class RulerControlLayer extends OsmandMapLayer {
}
boolean move = tb.getZoom() != cacheIntZoom || Math.abs(tb.getCenterTileX() - cacheTileX) > 1 ||
- Math.abs(tb.getCenterTileY() - cacheTileY) > 1;
+ Math.abs(tb.getCenterTileY() - cacheTileY) > 1 || mapDensity.get() != cacheMapDensity;
if (!tb.isZoomAnimated() && move) {
cacheIntZoom = tb.getZoom();
cacheTileX = tb.getCenterTileX();
cacheTileY = tb.getCenterTileY();
+ cacheMapDensity = mapDensity.get();
cacheDistances.clear();
updateDistance(tb);
}
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
index c37ff98037..1de9e3e931 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java
@@ -1048,6 +1048,8 @@ public class RouteInfoWidgetsFactory {
private MapActivity ma;
private String cacheRulerText;
private int maxWidth;
+ private float cacheMapDensity;
+ private OsmandSettings.OsmandPreference mapDensity;
private int cacheRulerZoom;
private double cacheRulerTileX;
private double cacheRulerTileY;
@@ -1061,6 +1063,8 @@ public class RouteInfoWidgetsFactory {
textShadow = (TextView) ma.findViewById(R.id.map_ruler_text_shadow);
maxWidth = ma.getResources().getDimensionPixelSize(R.dimen.map_ruler_width);
orientationPortrait = AndroidUiHelper.isOrientationPortrait(ma);
+ mapDensity = ma.getMyApplication().getSettings().MAP_DENSITY;
+ cacheMapDensity = mapDensity.get();
}
public void updateTextSize(boolean isNight, int textColor, int textShadowColor, int shadowRadius) {
@@ -1077,10 +1081,12 @@ public class RouteInfoWidgetsFactory {
} else if (!orientationPortrait && ma.getRoutingHelper().isRoutePlanningMode()) {
visible = false;
} else if (!tb.isZoomAnimated() && (tb.getZoom() != cacheRulerZoom || Math.abs(tb.getCenterTileX() - cacheRulerTileX) > 1 || Math
- .abs(tb.getCenterTileY() - cacheRulerTileY) > 1) && tb.getPixWidth() > 0 && maxWidth > 0) {
+ .abs(tb.getCenterTileY() - cacheRulerTileY) > 1 || mapDensity.get() != cacheMapDensity) &&
+ tb.getPixWidth() > 0 && maxWidth > 0) {
cacheRulerZoom = tb.getZoom();
cacheRulerTileX = tb.getCenterTileX();
cacheRulerTileY = tb.getCenterTileY();
+ cacheMapDensity = mapDensity.get();
final double dist = tb.getDistance(0, tb.getPixHeight() / 2, tb.getPixWidth(), tb.getPixHeight() / 2);
double pixDensity = tb.getPixWidth() / dist;
double roundedDist = OsmAndFormatter.calculateRoundedDist(maxWidth /
diff --git a/OsmAndCore-sample/build.gradle b/OsmAndCore-sample/build.gradle
index 95b9cd9c66..80d8b9f02f 100644
--- a/OsmAndCore-sample/build.gradle
+++ b/OsmAndCore-sample/build.gradle
@@ -110,8 +110,8 @@ repositories {
dependencies {
compile project(path: ':OsmAnd-java', configuration: 'android')
- compile 'com.android.support:appcompat-v7:23.3.0'
- compile 'com.android.support:design:23.3.0'
+ compile 'com.android.support:appcompat-v7:25.+'
+ compile 'com.android.support:design:25.+'
compile fileTree(dir: "libs", include: ["*.jar"])
compile "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
debugCompile "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
diff --git a/OsmAndCore-sample/res/drawable-hdpi/ic_arrow_back.png b/OsmAndCore-sample/res/drawable-hdpi/ic_arrow_back.png
new file mode 100644
index 0000000000..7a975df613
Binary files /dev/null and b/OsmAndCore-sample/res/drawable-hdpi/ic_arrow_back.png differ
diff --git a/OsmAndCore-sample/res/drawable-mdpi/ic_arrow_back.png b/OsmAndCore-sample/res/drawable-mdpi/ic_arrow_back.png
new file mode 100644
index 0000000000..c14541d3d7
Binary files /dev/null and b/OsmAndCore-sample/res/drawable-mdpi/ic_arrow_back.png differ
diff --git a/OsmAndCore-sample/res/drawable-xhdpi/ic_arrow_back.png b/OsmAndCore-sample/res/drawable-xhdpi/ic_arrow_back.png
new file mode 100644
index 0000000000..e212ab8f5c
Binary files /dev/null and b/OsmAndCore-sample/res/drawable-xhdpi/ic_arrow_back.png differ
diff --git a/OsmAndCore-sample/res/drawable-xxhdpi/ic_arrow_back.png b/OsmAndCore-sample/res/drawable-xxhdpi/ic_arrow_back.png
new file mode 100644
index 0000000000..1766bbc0ef
Binary files /dev/null and b/OsmAndCore-sample/res/drawable-xxhdpi/ic_arrow_back.png differ
diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java
index 8081f1c0a4..f45c263a13 100644
--- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java
+++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/InstallOsmandAppDialog.java
@@ -39,7 +39,7 @@ public class InstallOsmandAppDialog extends AppCompatDialogFragment {
view.findViewById(R.id.install_osmand_btn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- boolean success = execOsmAndInstall("market://search?q=pname:");
+ boolean success = execOsmAndInstall("market://details?id=");
if (!success) {
success = execOsmAndInstall("https://play.google.com/store/apps/details?id=");
}
diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java
index 734dccc9e9..7af901bdca 100644
--- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java
+++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/mapcontextmenu/ContextMenuHelper.java
@@ -62,7 +62,7 @@ public class ContextMenuHelper {
final Toolbar topBar = new Toolbar(ctx);
topBar.setClickable(true);
- Drawable back = app.getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ Drawable back = app.getIconsCache().getIcon(R.drawable.ic_arrow_back);
topBar.setNavigationIcon(back);
topBar.setNavigationContentDescription(app.getString("access_shared_string_navigate_up"));
topBar.setTitle(title);
@@ -220,7 +220,7 @@ public class ContextMenuHelper {
final Toolbar topBar = new Toolbar(ctx);
topBar.setClickable(true);
- Drawable back = app.getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
+ Drawable back = app.getIconsCache().getIcon(R.drawable.ic_arrow_back);
topBar.setNavigationIcon(back);
topBar.setNavigationContentDescription(app.getString("access_shared_string_navigate_up"));
topBar.setTitle(title);
diff --git a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java
index 1a5deb3c6e..2d4752b087 100644
--- a/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java
+++ b/OsmAndCore-sample/src/net/osmand/core/samples/android/sample1/search/QuickSearchDialogFragment.java
@@ -203,7 +203,7 @@ public class QuickSearchDialogFragment extends DialogFragment implements SampleC
);
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
- toolbar.setNavigationIcon(app.getIconsCache().getThemedIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
+ toolbar.setNavigationIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_arrow_back));
toolbar.setNavigationContentDescription(app.getString("access_shared_string_navigate_up"));
toolbar.setNavigationOnClickListener(
new OnClickListener() {
diff --git a/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java b/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java
index ed01e7efee..c89c7fca37 100644
--- a/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java
+++ b/plugins/Osmand-Nautical/src/net/osmand/nautical/NauticalActivity.java
@@ -57,7 +57,7 @@ public class NauticalActivity extends Activity {
public void onClick(View v) {
String appName = OSMAND_COMPONENT;
logEvent(NauticalActivity.this, "open_play_store_" + appName);
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + appName));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName));
try {
//stopService(intent);
startActivity(intent);
diff --git a/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java b/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java
index e83c802fda..7748a9f5ce 100644
--- a/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java
+++ b/plugins/Osmand-ParkingPlugin/src/net/osmand/parkingPlugin/ParkingPluginActivity.java
@@ -56,7 +56,7 @@ public class ParkingPluginActivity extends Activity {
public void onClick(View v) {
String appName = OSMAND_COMPONENT;
logEvent(ParkingPluginActivity.this, "open_play_store_" + appName);
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + appName));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName));
try {
//stopService(intent);
startActivity(intent);
diff --git a/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java b/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java
index 92421706d1..9b4bec7bf6 100644
--- a/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java
+++ b/plugins/Osmand-SRTMPlugin/src/net/osmand/srtmPlugin/SRTMPluginActivity.java
@@ -58,7 +58,7 @@ public class SRTMPluginActivity extends Activity {
public void onClick(View v) {
String appName = OSMAND_COMPONENT;
logEvent(SRTMPluginActivity.this, "open_play_store_" + appName);
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + appName));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName));
try {
//stopService(intent);
startActivity(intent);
diff --git a/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java b/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java
index 1f8f3d5b13..30b849d59d 100644
--- a/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java
+++ b/plugins/Osmand-Skimaps/src/net/osmand/skimaps/SkiMapsActivity.java
@@ -59,7 +59,7 @@ public class SkiMapsActivity extends Activity {
public void onClick(View v) {
String appName = OSMAND_COMPONENT;
logEvent(SkiMapsActivity.this, "open_play_store_" + appName);
- Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + appName));
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appName));
try {
//stopService(intent);
startActivity(intent);