diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml
index efd7166495..dd68aeb46a 100644
--- a/OsmAnd/res/values-cs/strings.xml
+++ b/OsmAnd/res/values-cs/strings.xml
@@ -2915,4 +2915,13 @@ Zobrazená oblast: %1$s x %2$s
Jak otevřít články Wikipedie?
Skrýt plný popis
Zobrazit plný popis
+ • Nové: Podpora pro celosvětové cestovní průvodce. Odkazovaná místa jsou propojené s mapou. Úvodní data z Wikivoyage.
+\n
+\n • Wikipedie: nový vzhled, aktivní linky, podpora obrázků
+\n
+\n • Rozhraní zobrazování tras: podpora skupin přechodových bodů (waypointů)
+\n
+\n • Mapové značky: import vybraných skupin z GPX souborů, nový vzhled zadávání souřadnic
+\n
+\n • Předplatné OsmAnd Live nyní zahrnuje všechny funkce OsmAnd
diff --git a/OsmAnd/res/values-el/phrases.xml b/OsmAnd/res/values-el/phrases.xml
index c760ae63b2..2a1156fc27 100644
--- a/OsmAnd/res/values-el/phrases.xml
+++ b/OsmAnd/res/values-el/phrases.xml
@@ -2027,4 +2027,33 @@
Αρχιτεκτονική: σύγχρονη
Αρχιτεκτονική: σταλινικός νεοκλασικισμός
Αρχιτεκτονική: εκλεκτική
+ Αρχιτεκτονική: νέα αντικειμενικότητα
+ Αρχιτεκτονική: σύγχρονη
+ Αρχιτεκτονική: οικοδομισμός
+ Αρχιτεκτονική: περιδεμένη (umgebinde)
+ Αρχιτεκτονική: ξύλινος σκελετός
+ Αρχιτεκτονική: νέο ύφος (αρ νουβό)
+ Αρχιτεκτονική: νεοκλασικισμός
+ Αρχιτεκτονική: βικτωριανή
+ Αρχιτεκτονική: μπρουταλισμός
+ Αρχιτεκτονική: κλασικισμός
+ Αρχιτεκτονική: γοτθική
+ Αρχιτεκτονική: παλαιορωσική
+ Αρχιτεκτονική: μπαρόκ
+ Αρχιτεκτονική: μεταοικοδομισμός
+ Αρχιτεκτονική: βιλχεμινικό ύφος
+ Αρχιτεκτονική: αναγεννησιακή
+ Αρχιτεκτονική: ρομανική
+
+ Υδατοσήραγγα
+ Οδική σήραγγα
+ Πεζοσήραγγα
+ Σιδηροδρομική σήραγγα
+ Οδική σήραγγα
+ Πεζογέφυρα
+ Ποδηλατική γέφυρα
+ Σιδηροδρομική γέφυρα
+ Γέφυρα θαλάσσιων οδών
+ Δομή γέφυρας: ακτινωτή
+ Δομή γέφυρας: απλή ανάρτηση
diff --git a/OsmAnd/res/values-es/phrases.xml b/OsmAnd/res/values-es/phrases.xml
index 078854a8fd..90f905ad30 100644
--- a/OsmAnd/res/values-es/phrases.xml
+++ b/OsmAnd/res/values-es/phrases.xml
@@ -1715,7 +1715,7 @@
Memorial de guerra
Placa
Piedra
- Estrella
+ Estela
Busto
Koshinto
Placa azul
diff --git a/OsmAnd/res/values-eu/phrases.xml b/OsmAnd/res/values-eu/phrases.xml
index 0775e9f38c..5633748018 100644
--- a/OsmAnd/res/values-eu/phrases.xml
+++ b/OsmAnd/res/values-eu/phrases.xml
@@ -3207,5 +3207,116 @@
Kanpokoa
Telefono-baleak
Baleak
-
-
+
+ Kontrol-postu mota
+
+Gasolindegia; Zerbitzu estazioa;Erregai estazioa;Petrolio estazioa
+
+ Ukimenezko zoladura gabe
+ Ez dago ezinduentzako toki berezirik
+ Ezinduentzako toki bereziak
+ "Kotxean zerbitzatzea: Ez "
+ Kotxearekin gurutzatzea: Ez
+
+ Ezin da eraman
+ Eramateko besterik ez
+
+ Ez da etxera bidaltzen
+ Etxera bidaltzeko besterik ez
+
+ Bizikletentzako hodiak
+ Paketeak jasotzeko gunea
+ Estela
+ Estupa
+ Aurrealdeko dekorazioa
+
+ Mika
+ Zohikatza
+ Errubia
+ Errutiloa
+ Arbela;burdin minerala;kobrea
+ Zirkoia
+
+ Belardi hezea
+ AS/NZS 3112
+
+ Handia
+ Tartekoa
+ Txikia
+ Handia
+ Tartekoa
+ Txikia
+ Handia
+ Tartekoa
+ Txikia
+ Handia
+ Tartekoa
+ Txikia
+ Handia
+ Tartekoa
+ Txikia
+ Handia
+ Tartekoa
+ Txikia
+
+ Zoladura denda
+ Eltzegintza
+
+ Dendako entrega-puntua
+
+ Helduentzako jokoen zentroa
+
+ Kotxe konponketa
+ Olio aldaketa
+ Erabilitako kotxeen salmenta
+ Frenoak
+ Kotxe berrien salmenta
+ Diagnostikoak
+ Kotxerako piezak
+ Bateriak
+ Haize egokitua
+ Karrozeriaren konponketa
+ Elektrikoa
+ Gurpilak
+ Kristala
+ Kamioien konponketa
+ Isilgailua
+ Alineazioa
+ Transmisioaren konponketa
+ Motorra
+ Asegurua
+ Pneumatikoak
+
+ Eskalada abentura
+
+ Via ferrata
+ Kable zenbakia
+ Zailtauna
+
+ Goi-ordoki
+ Harana
+ Mendia
+ Zintzilik
+ Harkaitza
+ Apala
+ Geldikia
+ Izotz-mihia
+
+ Punturik altuena
+ Punturik baxuena
+ Batez besteko aldapa
+
+ Bidezidor kiroleko kontrol-puntua
+ Zigilatze puntua
+ Kodea
+ Koadernoa
+ Zulatzailea
+ Galdetegia
+ Elektronikoa
+ Zirkuitoa
+
+ Harkaitza
+
+ Bukaera data
+
+
diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml
index f36883b3a9..49820ea7b1 100644
--- a/OsmAnd/res/values-eu/strings.xml
+++ b/OsmAnd/res/values-eu/strings.xml
@@ -79,7 +79,7 @@
Hasi azpilorratz berri bat
Puntu guztiak garbitu
- Ireki existitzen den GPX lorratza
+ Ireki existitzen den GPX fitxategia
Mesedez itxaron uneko zeregina bukatu harte
Iparrorratzean zarata gutxiagotzen du baina inertzia gehitzen du.
Erabili Kalman iragazkia
@@ -565,7 +565,7 @@
Gorde lorratza GPX trepeta erabiliz edo \'Bidaiaren grabaketa\' ezarpenen bidez.
Erakutsi uneko lorratza
- OsmAnd-en dohaineko bertsio hau %1$s deskargetara dago mugatua eta ez ditu Wikipediako artikuluak lineaz kanpo erabiltzen.
+ %1$s mapa deskargatu edo eguneratu ditzakezu.
Doainezko bertsioa
Erakutsi POI-aren deskripzioa.
Ipar Amerika
@@ -661,7 +661,7 @@ Biltegiratzean {1} MB erabiliko dira.
Jatorria:
Bilatu inguruan
- Gorde GPX lorratz berri gisa
+ Gorde GPX fitxategi berri gisa
Ibilbidea \'%1$s\' bezala gorde da.
Fitxategi-izena:
Izen berdineko beste fitxategi bat dago dagoeneko.
@@ -893,7 +893,7 @@ Biltegiratzean {1} MB erabiliko dira.
Bektore mapak ez dira kargatuak izan
Ez da GPX fitxategirik aurkitu lorratzen direktorioan
- GPX lorratza…
+ GPX fitxategiak…
Ezin izan dira GPX datuak irakurri
Lineaz kanpoko bektore mapak
Bilatu garraioa geldiunean
@@ -1060,7 +1060,7 @@ Biltegiratzean {1} MB erabiliko dira.
Herriak kargatzen…
POI
- Ezin izan da GPX lorratza gorde
+ Ezin izan da GPX fitxategia gorde
Ezin izan da ibilbidea kalkulatu
Ezin izan da ibilbidea kalkulatu
Kalkulatutako ibilbidea hutsik dago
@@ -1072,7 +1072,7 @@ Biltegiratzean {1} MB erabiliko dira.
Datuak kargatzen…
Datu lokalak irakurtzen…
Azkeneko OsmAnden exekuzioak huts egin du. Log fitxategia {0} da. Mesedez gertatutakoa jakinarazi eta log fitxategia erantsi.
- GPX lorratzak SDra gordetzen…
+ GPX fitxategia gordetzen…
Bukatua
@@ -1087,8 +1087,8 @@ Biltegiratzean {1} MB erabiliko dira.
OSM edizioa
Gainerako ezarpenak
Ezarpenak
- Gorde uneko lorratza memoria txartelean orain.
- Gorde uneko GPX lorratza
+ Gorde uneko lorratza GPX fitxategi gisa orain.
+ Gorde uneko lorratza
Erregistroen tartea nabigazioan
Aukeratu erregistratze maiztasuna nabigazio bitarteko lorratz grabaketarako.
GPX lorratza automatikoki gordeko da lorratzen direktorioan nabigazioan zehar.
@@ -1750,9 +1750,9 @@ Lorratza %2$s
Hautatu lorratzen grabatze orokorrerako erregistratze maiztasun bat (Mapan GPX erregistratze trepetaren bidez gaitzen da).
Erregistratu lorratza GPX fitxategian
Eskaerapeko lorratz erregistroa
- Ez da GPX fitxategirik aukeratu. Bat aukeratzeko sakatu luze lorratz eskuragarri batean.
+ Ez da GPX fitxategirik aukeratu. Sakatu luze bat aukeratzeko.
Azpi-lorratzak: %1$s
- GPX lorratza hutsa
+ GPX fitxategi hutsa
Bidaiaren grabaketa
@@ -2199,7 +2199,7 @@ Eskuragarri {2} MB besterik ez daude.
\n
\nGrabatutako lorratzak lagunekin partekatu ditzakezu edo OSM kontribuzio gisa erabili. Kirolariek entrenamenduak grabatzeko erabili dezakete. Lorratzen oinarrizko analisi bat egin daiteke zuzenean OsmAnd erabiliz, bueltako denbora, batezbesteko abiadura, eta abar. eta jakina lorratzak kanpo tresna bereziekin aztertu daitezke ere.
Internetera konektatu behar zara gehigarri hau instalatzeko.
- Gaitu \'SRTM\' gehigarria
+ Aktibatu \'Sestra-kurbak\' gehigarria
Gehigarriak
Pisten prestaketa
Iparrera
@@ -2283,7 +2283,7 @@ mapak eta nabigazioa
Gogokoak
Orain hemen gordeta: %1$s
Aldaketak igotzen dituzunean POIa ezabatuko da
- Erakutsi GPX
+ Erakutsi GPX datuak
Lerro kopurua
Ziur zaude?
Gorde gabeko aldaketak galduko dira, Jarraitu?
@@ -2332,7 +2332,7 @@ mapak eta nabigazioa
\n
\nOsmAnden ohiko mapa batetara itzultzeko, gehigarri hau desgaitu edo \'Mapa estiloa\' aldatu \'Konfiguratu mapa\' menuan."
Gogoko puntuaren izena aldatu da eta orain %1$s da irriabartxoak dituen katea fitxategira gorde ahal izateko.
- Gaitu \'Itsaso markak\' gehigarria
+ Aktibatu \'Itsas-mapa ikuspegia\'
Gehigarri honek zure eskura jartzen ditu mundu osoko eskiatzeko aldapak, fondoko eski zirkuituak, trabesiako eski ibilbideak, teleferikoak, eta abar. Ibilbideak eta pistak zailtasunaren arabera koloreztatu dira, eta elurtutako paisaiaren itxura duen \'Negu\' estiloko mapa batean adierazten dira.
\n
\nHau aktibatzean ikuspegia \'Negua eta eskia\' estilora aldatzen da, paisaia neguko egoeran bistaratuz. Hau atzera aldatu daiteke gehigarri hau desgaituz eta \'Konfiguratu mapa\' menuko \'Mapa estiloa\' aldatuz.
@@ -2358,7 +2358,7 @@ mapak eta nabigazioa
Mapak deskargatzeko beharrezkoa da.
Kokalekua bilatzen…
Espazio librea
- OsmAnd datuen biltegiratzea (mapak, lorratzak, eta abar): %1$s.
+ OsmAnd datuen biltegiratzea (mapak, GPX fitxategiak, eta abar): %1$s.
Eman baimena
Eman kokapena atzitzeko baimena
Jaso jarraibideak eta aurkitu toki berriak Internetera konexiorik gabe
@@ -2437,9 +2437,9 @@ mapak eta nabigazioa
Hartu %1$d. irteera eta jarraitu
Igo POI bat
Ibilbidearen kalkulua
- Ez duzu lorratzik oraindik
- Lorratzak karpetara gehitu ditzakezu ere
- Gehitu lorratza
+ Ez duzu GPX fitxategirik oraindik
+ GPX fitxategiak karpetara gehitu ditzakezu ere
+ Gehitu GPX fitxategia
Itxura
Ongi
Bilatu hiria edo eskualdea
@@ -2583,7 +2583,7 @@ Area honi dagokio: %1$s x %2$s
Puntuak ezabatu dira.
%1$d puntu ezabatuko dituzu. Ziur zaude?
Ibilbide honetan pasatu beharreko bide-gurutzeak
- Ibilbide honetako puntu nabarmenak
+ Bide-puntuak, interesezko puntuak, izena duten ezaugarriak
Lorratza
Gehieneko abiadura
Batezbesteko abiadura
@@ -2593,7 +2593,7 @@ Area honi dagokio: %1$s x %2$s
Irteera
Iritsiera
Kolorea
- Hautatu lorratzen karpeta
+ Hautatu GPX fitxategien karpeta
Fitxategia ezin da lekuz aldatu.
Lekuz aldatu
Lorratzak
@@ -2609,7 +2609,7 @@ Area honi dagokio: %1$s x %2$s
Erabili elebazio kotak
- Erabili SRT, ASTER, eta EU-DEM hornitzaileen elebazio datuak.
+ Kontuan izan terrenoaren elebazioa (SRTM, ASTER, eta EU-DEM datuen bidez).
Malda
Berberera
@@ -2906,14 +2906,14 @@ Area honi dagokio: %1$s x %2$s
Hautatu nabigazio profila
Gehitu ibilbide-puntuak
Gehitu lerroa
- Gehitu eta grabatu lorratzak
- Grabatu edo inportatu lorratzak ikusteko.
+ Gehitu GPX fitxategiak
+ Inportatu GPX fitxategiak, edo grabatu lorratzak.
Gehitu gogokoak
- Inportatu edo markatu gogokoak mapan.
- Inportatu lorratza
+ Inportatu gogokoak, edo gehitu mapan puntuak markatuz.
+ Inportatu GPX fitxategia
%1$s fitxategiak ez du bide-punturik, inportatu lorratz gisa?
Mugitu puntua
- Gehitu GPX lorratzera
+ Gehitu GPX fitxategira
Maparen orientazioaren atalasea
"Hautatu maparen orientazioa \'barne ipar-orratza\' eta ez \'mugimenduaren norabidea\'-ren arabera erabakitzeko abiadura."
Markatzaile guztiak historialera mugituta
@@ -2964,16 +2964,16 @@ Area honi dagokio: %1$s x %2$s
Bide-puntuak dituzten lorratzak bilatzen
Gehiago
Maparen itxura
- Bide-puntuak markatzaileetara gehitu ahal dira, bide-puntuak dituzten lorratz hauetako bat hautatuz.
+ Hautatu lorratz bat bere bide-puntuak markatzaileetara gehitzeko.
Hautatu gogoko kategoria bat markatzaileetara gehitzeko.
Lorratzaren bide-puntuak
Gogokoak kategoria
Gehitu talde bat
- "Inportatu taldeak gogokoetatik eta lorratzaren bide-puntuetatik."
+ Inportatu taldeak gogokoetatik eta GPX bide-puntuetatik.
Sortu mapa-markatzaileak!
Sakatu labur edo luze \'Tokiak\', gero sakatu markatzaile-bandera botoian.
Inportatu taldeak
- Inportatu gogokoen taldeak edo lorratzen bide-puntuak markatzaile gisa.
+ Inportatu gogokoen taldeak edo bide-puntuak markatzaile gisa.
Pasatutako gisa markatutako markatzaileak pantaila honetan agertzen dira.
Bi
Bat
@@ -2990,7 +2990,7 @@ Area honi dagokio: %1$s x %2$s
Hurrengo eremura
Aldatu izena markatzaileari
Pantaila osoko modua
- gogoko edo lorratz fitxategi gisa inportatu daiteke.
+ gogoko edo GPX fitxategi gisa inportatu daiteke.
Inportatu GPX fitxategi gisa
Inportatu gogoko gisa
Inportatu fitxategia
@@ -3028,8 +3028,8 @@ Area honi dagokio: %1$s x %2$s
Ordenatu
Koordenatuen sarrera
gorde da
- Esportatu zure markatzaileak honako fitxategi honetara:
- Gorde lorratz gisa
+ Esportatu zure markatzaileak honako GPX fitxategi honetara:
+ Gorde GPX fitxategi gisa
Eraman historialera
Taldea ez da egongo da aplikazioa berrabiarazten denean.
Erakutsi norabide lerroak
@@ -3106,7 +3106,7 @@ Area honi dagokio: %1$s x %2$s
Maparen inportazio errorea
Mapa inportatu da
Inguruko ibilbideak
- Inguruan
+ Erradioa
Distantzia: Urrunena lehenbizi
Distantzia: Hurbilena lehenbizi
Sartu longitudea
@@ -3132,15 +3132,16 @@ Area honi dagokio: %1$s x %2$s
Bai
Soilik Wi-Fi bidez
Deskargatu irudiak
- Artikuluetako irudiak deskargatu daitezke konexiorik gabe erabiltzeko. Ezarpen hau aldatzeko zoaz Arakatu > Aukerak atalera.
+ "Artikuluetako irudiak konexiorik gabe erabiltzeko deskargatu daitezke.
+\nEzarpen hau Arakatu > Aukerak atalean aldatu dezakezu."
Soilik Wi-Fi
- Hautatu bidai liburua
+ Hautatu bidai-liburu bat
Bidai liburua
Orria sarean besterik ez dago eskuragarri. Web nabigatzaile batean ireki nahi duzu?
Irudien cache-a
Ezabatu bilaketa historiala
- Erakutsi irudiak
- Bidai mapak
+ Deskargatu irudiak
+ Bidai-gidak
Wikivoyage
Artikulua kenduta
Bilatu: Herrialdea, hiria, probintzia
@@ -3154,9 +3155,9 @@ Area honi dagokio: %1$s x %2$s
Bide-puntuak mapa markatzaileetatik kendu dira
Mundu osoko Wikivoyage artikuluak
Planetako leku interesgarrienetarako gidak, OsmAnd-en bertan eta Internet konexiorik gabe.
- Wikivoyage bidai gida
+ Bidai-gidak
Hautatu plana
- Erosi hauetako bat bidai-artikuluak konexiorik gabe irakurtzeko:
+ Erosi hauetako bat lineaz kanpoko bidai-giden funtzioa eskuratzeko:
Hautatu elementu egokia:
Mapen eguneraketak: Hilero
Mapen eguneraketak: Egunero, orduero
@@ -3190,9 +3191,9 @@ Area honi dagokio: %1$s x %2$s
Gogoko dituzun artikuluetan oinarrituta, honako mapak deskargatzea aholkatzen dizugu:
Behar dituzun mapak
- Deskargatu Wikivoyage bidai gida hauek munduko tokien inguruko artikuluak ikusteko Internetera konexioa ez duzunean ere.
+ Deskargatu Wikivoyage bidai gidak munduko tokien inguruko artikuluak ikusteko Internetera konexioa ez duzunean ere.
Edonork idatzi dezakeen mundu osoko doako gida.
- Bidaia Wikivoyage-n oinarrituta dago. Probatu doan ezaugarri guztiak besta probatze garai irekian. Gero, Bidaia OsmAnd Unlimited harpidedunentzat eta OsmAnd+ erosleentzat egongo da eskuragarri
+ Bidai-gidak Wikivoyage-n oinarrituta daude. Probatu doan ezaugarri guztiak besta probatze garai irekian. Gero, Bidaia-gidak OsmAnd Unlimited harpidedunentzat eta OsmAnd+ erosleentzat egongo da eskuragarri.
Wikivoyage-ko edozein artikulu aldatu dezakezu. Partekatu ezagutza, esperientzia, talentua eta zure atentzioa
Ongi etorri beta irekira
Sestra-kurbak eta mendi itzalak
@@ -3212,4 +3213,28 @@ Area honi dagokio: %1$s x %2$s
Irakurri Wikipedia sarean
Deskargatu dena
Gogokoa
+ Eskuratu OsmAnd Live ezaugarri guztiak desblokeatzeko: Mapen eguneraketak egunero deskarga mugarik gabe, ordainpeko eta doako gehigarri guztiak, Wikipedia, Wikivoyage eta askoz gehiago.
+ Lehenetsitako itxuraren aldaera, oinezko eta bizikleten bideen kontrastea handitzeko. Mapnik kolore zaharrak erabiltzen ditu.
+ Errepidetik kanpo gidatzean erabilgarria. Atzealdeko mapa gisa satelite irudiak erabiltzeko egokia. Gakoak: Errepideen zabalera murriztua, eta bide, bidexka eta bidegorrien zabalera handitua.
+ Nabigazio nautikorako estiloa. Ezaugarri nagusiak: Boiak, faroak, ibai bideak, itxas erreiak eta markak, portuak, itsas zerbitzuak, sakonera marrak.
+ Eskiatzeko estiloa. Ezaugarri nagusiak: Pisten marrazketa, arrastreak eta bestelako eskiatzeko ezaugarriak eroso jarrita. Bestelako ezaugarriak leunduak ez distraitzeko.
+ Kotxe nabigaziorako estilo sinple eta kontraste handikoa. Begietara xamurra gau moduan. Ezaugarri nagusiak. Sestra-kurbak, kontraste handiko errepideak, bestelako ezaugarriak leunduak ez distraitzeko.
+ Bidezidor kirol eta mendiko bizikletarako kontraste-estiloa. Irakurgarritasun ona argi egoera konplexuetan. Ezaugarri nagusiak: Bide eta objektu naturalen kontrastea, ibilbide mota desberdinak, sestra-kurbak ezarpen aurreratuekin, lehenetsitako estiloa baino xehetasun gehiago dagokion zoom mailetan. Azaleraren egonkortasunaren aukerak bidearen zoladuraren kalitatea bereiztea ahalbidetzen dizu. Gau modurik ez.
+ \'Mapnik\' lehenetsitako marrazketa estilo zaharra. Ezaugarri nagusiak: Koloreak Mapnik estiloaren antzekoak dira.
+ Xehetasun handiko estiloa errepiderako. Lehenetsitako estiloaren konfigurazio aukera guztiak ditu, gainera: Ahal beste xehetasun erakusten ditu, bereziki errepideak, bideak eta bestelako garraio-bideak. Bide moten arteko bereizketa bisual argia, errepide-mapa askoren antzekoa. Kontraste handiko eskema naturan erabiltzeko, egun eta gau moduak.
+ Erabilera orokorrerako estiloa. Biztanle askoko hirietan estilo sinplifikatua. Ezaugarri nagusiak: estra-kurbak, ibilbideak, zuladuraren kalitatea, sarbide-mugak, bideak SAC eskalaren arabera marrazten dira.
+ • Berria: Lineaz kanpoko bidi gida globalentzako euskarria. Aipatutako kokalekuak mapan estekatzen dira. Hasierako datuak Wikivoyage-tik.
+\n
+\n • Wikipedia: Itxura berria, esteka aktiboak, irudiak onartzen dira
+\n
+\n • Open Track UI: Bide-puntu taldeentzako euskarria
+\n
+\n • Mapa-markatzaileak: Inportatu hautatutako taldeak GPX fitxategietatik, korrdenatuen sarrera, itxura berria
+\n
+\n • OsmAnd Live harpidetzak orain OsmAnd ezaugarri guztiak onartzen ditu
+\n
+\n
+ GPX fitxategiak
+ Tarteko iritsiera ordua
+ Tarteko denbora
diff --git a/OsmAnd/res/values-fa/phrases.xml b/OsmAnd/res/values-fa/phrases.xml
index 019523d77e..7a7f9c70ba 100644
--- a/OsmAnd/res/values-fa/phrases.xml
+++ b/OsmAnd/res/values-fa/phrases.xml
@@ -526,7 +526,7 @@
ایزوگام
سراج
لوازم قایق
-پوب بری
+چوب بری
مجسمه ساز
کفاش
@@ -818,7 +818,7 @@
سلامت
اداره
گردشگری
- دیدن دیدنیها
+ دیدنیها
محل اسکان
اینترنت
اوقات فراغت
diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml
index e12eeebdc7..f59a3732c3 100644
--- a/OsmAnd/res/values-fa/strings.xml
+++ b/OsmAnd/res/values-fa/strings.xml
@@ -2569,7 +2569,7 @@
تلاش مجدد
افزودن خط
افزودن نقاط برگزیده
- نقاط برگزیده را روی نقشه علامت بزنید یا آنها را از یک فایل وارد کنید.
+ نقاط موردعلاقهتان را روی نقشه علامت بزنید یا آنها را از یک فایل وارد کنید.
جابهجاکردن نقطه
نقطهٔ شروع را بهعنوان مقصد هم در نظر بگیر.
ایجاد سفر رفتوبرگشتی
@@ -2583,7 +2583,7 @@
موقعیت من
پایان
طراحی مسیر
- مرتبکردن
+ مرتبسازی
واردکردن مختصات
ذخیره شد
نشانههایتان را در این فایل GPX ذخیره کنید:
@@ -2592,7 +2592,7 @@
نزولی
مسافت تا نشانهها و جهتگیری بهسمت آنها چگونه روی نقشه نشان داده شود:
آستانهٔ تغییر جهت نقشه
- مشخص کنید که در چه سرعتی جهت نقشه از «در جهت حرکت» به «در جهت قطبنما» تغییر کند.
+ مشخص کنید در چه سرعتی جهت نقشه از «در جهت حرکت» به «در جهت قطبنما» تغییر کند.
همهٔ نشانههای نقشه به سابقه منتقل شد
نشانهٔ نقشه به سابقه منتقل شد
نشانهٔ نقشه به قسمت فعال منتقل شد
@@ -2885,7 +2885,7 @@
\n • رابط کاربری و شیوهٔ دانلود اطلاعات نقشهها بازسازی شده است
\n
\n و…
- فایل GPX با مکانهای یادداشتدار.
+ فایل GPX از مکانهای یادداشتدار.
برنامهٔ OsmAnd+ (مخفف OSM Automated Navigation Directions بهمعنی راهبری خودکار با نقشهٔ OSM) یک نرمافزار نقشه و راهبری است که به گسترهٔ وسیعی از دادههای نقشهٔ باز شهری (OpenStreetMap یا بهصورت خلاصه OSM) دسترسی دارد. این دادههای رایگان و جهانی با بالاترین کیفیت ارائه میشوند.
\n
\nراهبر دیداری و شنیداری، مشاهدهٔ مکانهای محبوب (POIها یا Points of interest)، ایجاد و مدیریت ردهای GPX، استفاده از تصویرسازی منحنیهای تراز و اطلاعات ارتفاع، انتخاب حالتهای پیاده، دوچرخه، خودرو، امکان ویرایش مکانها و... چیزهایی هستند که تجربهٔ مؤثر و لذتبخشی را در کار با نقشه برایتان به ارمغان میآورد.
@@ -3021,7 +3021,7 @@
یک
خطوط جهتداری را از موقعیت شما بهسمت نشانههای فعال نمایش میدهد.
با یک یا دو پیکان، سمت قرارگیری نشانههای فعال روی نقشه را نمایش میدهد.
- مشخص کنید که مسافت شما تا نشانههای فعال چگونه نشان داده شود.
+ مشخص کنید مسافت شما تا نشانههای فعال کجا نشان داده شود.
تعداد نشانههای فعال روی نقشه را مشخص کنید.
تنظیمات ظاهری
مسیری را انتخاب کنید تا نقاط بینراهیِ آن را به نشانهها اضافه کنید.
@@ -3032,13 +3032,13 @@
گروهی از نقاط برگزیده یا نقاط بینراهی GPX را وارد کنید.
روی نقشه نشانهگذاری کنید!
مکانها را بهصورت کوتاه یا طولانی لمس کنید و سپس دکمهٔ پرچم را بزنید.
- واردکردن گروهها
+ گروه وارد کنید
گروههای نقاط برگزیده یا نقاط بینراهی را بهعنوان نشانه وارد کنید.
نشانههایی که بهعنوان عبورکرده مشخص شدهاند در این صفحه نشان داده میشوند.
بیشتر
در جستوجوی مسیرهای دارای نقطهٔ بینراهی
- ایجاد یا ویرایش اشیای OSM
- ایجاد یا ویرایش POIها، بازگشایی توضیحات ویرایشی و نظردادن روی آنها و آپلود فایلهای ذخیرهشدهٔ GPX.
+ اشیای OSM را بسازید یا ویرایش کنید
+ نقاط پرکاربرد (POI) را اضافه یا ویرایش کنید، توضیح ویرایشی اضافه کنید یا روی آنها نظر بدهید و فایلهای GPX ضبطشده را آپلود کنید.
حذف شد
ویرایش شد
افزوده شد
@@ -3074,8 +3074,8 @@
ساعت بازکردن
زمان بازشدن
عملیات بیشتر
- فایل GPX با مختصات و دادههای یادداشتهایی که انتخاب شده است.
- فایل GPX با مختصات و دادههای یادداشتهایی که انتخاب شده است.
+ فایل GPX از مختصات و اطلاعات یادداشتهای انتخابی.
+ فایل GPX از مختصات و اطلاعات همهٔ یادداشتها.
عملیات
نشانه
ویرایشها: %1$s، مبلغ: %2$s هزارم بیتکوین
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index 6db393e415..112e62f728 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -823,8 +823,8 @@
Ces informations sont visibles sur le Tableau de bord comme sur la carte. Un rappel peut même être ajouté à votre calendrier.
Emplacement de stationnement
- Marquer comme emplacement de stationnement
- Supprimer un emplacement de stationnement
+ Marquer comme stationnement
+ Supprimer l\'emplacement de stationnement
Point de départ trop éloigné de la route la plus proche.
Lieu partagé
Sélectionner la vitesse de l\'animation
@@ -2315,7 +2315,7 @@ Si vous appréciez OsmAnd et OSM et que vous souhaitez soutenir ces projets, c\'
Hongrois (formel)
Déplacez la carte pour modifier la position de la marque
Trace courante
- Modifier la position de la marque
+ Déplacer la marque
Espagnol (américain)
Anglais (Royaume-Uni)
Indiquer la direction de la cible par des sons
diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml
index 94441259db..22111358f6 100644
--- a/OsmAnd/res/values-it/strings.xml
+++ b/OsmAnd/res/values-it/strings.xml
@@ -2787,12 +2787,12 @@ Rappresenta l\'area: %1$s x %2$s
Scrivi il nome utente
Visualizza le immagini aggiunte da
Nome utente
- Puoi filtrare le immagini per contributore o per data. I filtri si possono applicare solo per gli zoom più elevati.
+ Filtra le immagini per contributore o per data. I filtri sono attivi per gli zoom più elevati.
Salva le tracce registrate in cartelle mensili
Salva le tracce registrate in sottocartelle per mese di registrazione (come 2018-01).
Reimposta
Premi questo pulsante per mettere in pausa o riprendere la navigazione.
- Mostra la finestra di dialogo Fine navigazione
+ Mostra la finestra di dialogo Navigazione terminata
Avvia/ferma navigazione
Premi questo pulsante per avviare o fermare la navigazione.
Rosa traslucido
@@ -2832,10 +2832,10 @@ Rappresenta l\'area: %1$s x %2$s
Aggiungi un punto dopo
Opzioni
OsmAnd collegherà i punti ai percorso in base al profilo di navigazione.
- Puoi salvare i punti sia come punti di un percorso che come linea.
+ Salva i punti sia come punti di un percorso che come linea.
Scegli il profilo di navigazione
Uscire senza salvare?
- No animazioni
+ Non usare animazioni
Disabilita le animazioni nell\'app.
Mantieni visualizzato nella mappa
Tempo tampone per il tracciamento online
@@ -2884,11 +2884,11 @@ Rappresenta l\'area: %1$s x %2$s
Ordina
Inserimento coordinate
è salvato
- Esporta i marcatori in un file, puoi indicarlo qui:
- Salva come traccia
+ Esporta i tuoi marcatori nel seguente file GPX:
+ Salva come file GPX
Sposta nella cronologia
Il gruppo verrà rimosso al prossimo riavvio dell\'app.
- Mostra le linee guida
+ Mostra le linee di direzione
Mostra le frecce nella mappa
Mostra superati
Nascondi i superati
@@ -2910,7 +2910,7 @@ Rappresenta l\'area: %1$s x %2$s
Il file %1$s non contiene punti intermedi, importarlo come traccia?
Sposta il punto
Aggiungi a una traccia GPX
-Si è verificato un errore: la nota non è stata modificata
+Non è possibile modificare la nota
Strada
Mostra la mappa
Percorso calcolato
@@ -2931,31 +2931,31 @@ Rappresenta l\'area: %1$s x %2$s
\n
Giallo scuro
Importa come file GPX
- Importa come Preferito
+ Importa come preferito
Importa file
Un tap sulla mappa per nascondere/visualizzare i pulsanti di controllo e i widgets.
Modalità a schermo intero
Marcatore superato
- può essere importato come Preferito oppure come file traccia.
+ può essere importato come preferito oppure come file GPX.
Visualizzazione nella mappa
- I punti intermedi possono essere aggiunti ai marcatori selezionando una traccia che ne contiene.
+ Scegli una traccia per aggiornare i suoi punti intermedi ai marcatori.
Scegli una categoria di luoghi preferiti da aggiungere ai marcatori.
Punti intermedi della traccia
Categoria di luoghi preferiti
Aggiungi un gruppo
- Puoi importare un gruppo dai preferiti o i punti intermedi di una traccia.
+ Importa gruppi dai preferiti o i punti intermedi GPX.
Crea i marcatori della mappa!
- Tap lungo o breve su \'Luoghi\', poi tappa il pulsante bandiera del marcatore.
+ Tap lungo o breve su Luoghi, poi tappa il pulsante bandiera del marcatore.
Importa gruppi
- Puoi importare, come marcatori, gruppi di luoghi preferiti o punti intermedi di tracce.
+ Importa gruppi di preferiti o punti intermedi come marcatori.
Marcatori indicati come passati appariranno su questa schermata.
Due
Uno
- Una linea-guida fra la tua posizione e le posizioni dei marcatori attivi verrà visualizzata sulla mappa.
+ Mostra la linea di direzione dalla tua posizione alle posizioni dei marcatori attivi.
Visualizza una o due frecce, indicanti la direzione verso i marcatori attivi.
Scegli come visualizzare la distanza verso marcatori attivi.
- Scegli quante indicazioni di direzione sono visualizzate.
+ Scegli il numero di marcatori attivi da visualizzare.
Numero di cifre decimali
Destra
Sinistra
@@ -3022,7 +3022,7 @@ Rappresenta l\'area: %1$s x %2$s
Attuale
Aggiunge una fermata intermedia
Aggiunge la prima fermata
- Sposta in alto la destinazione e crea la destinazione
+ Sposta in alto la destinazione e crealo
Mostra le note chiuse
Mostra/nascondi le note OSM sulla mappa.
GPX - adatto all\'esportazione in JOSM o altri editor OSM.
@@ -3053,8 +3053,8 @@ Rappresenta l\'area: %1$s x %2$s
S
N
Nome del punto facoltativo
- Percorsi vicini in
- Vicino
+ Percorsi vicini entro
+ Entro
Immetti il nome del file.
Errore importazione mappa
Mappa importata
@@ -3068,13 +3068,13 @@ Rappresenta l\'area: %1$s x %2$s
Totale
"Usa due cifre per la longitudine"
Viaggio
- Puoi aggiungere tutti i punti intermedi delle tracce o per categorie separate.
+ Aggiungi tutti i punti intermedi della traccia oppure scegli una categoria separata.
Non fare
Fai
Solo da WiFi
Scarica le immagini
Solo con WiFi
- Scegli il libro di viaggio
+ Scegli un libro di viaggio
Libro di viaggio
Pagina disponibile solo online. Aprirla in un browser?
Cache delle immagini
@@ -3090,7 +3090,7 @@ Rappresenta l\'area: %1$s x %2$s
Iniza a modificare
Ottieni l\'accesso illimitato
Benvenuti alla open beta
- Guida di Viaggio Wikivoyage
+ Guide Viaggi
Aggiornamenti delle mappe: Ogni mese
Aggiornamenti delle mappe: Ogni ora
Acquisto In-app
@@ -3116,14 +3116,14 @@ Rappresenta l\'area: %1$s x %2$s
Guide dei luoghi più interessanti del pianeta, integrata in OsmAnd, senza connessione a Internet.
Linee Isoipse e Ombreggiamento dei rilievi
Scegli il piano
- Acquista uno dei seguenti articoli di viaggio da leggere offline:
+ Acquista uno dei seguenti per ricevere la funzionalità delle guide di viaggio offline:
Scegli uno degli oggetti disponibili:
Immagini dagli articoli possono essere per l\'uso offline.
\n Puoi sempre modificare le impostazioni in \'Esplora\' → \'Opzioni\'.
Cancella la cronologia di ricerca
Riavvia
Scarica immagini
- Mappe turistiche
+ Guide di turistiche
Wikivoyage
Articolo rimosso
Cerca: Nazione, città, provincia
@@ -3196,7 +3196,8 @@ Rappresenta l\'area: %1$s x %2$s
\n • Scegli se registrare la tua visita su un file GPX locale oppure su di un servizio online
\n • Scegli se mostrare la velocità e l’altitudine
\n • Mostra le curve di livello e l’ombreggiatura dei rilievi
- Modifica dello stile standard per fornire un maggior contrasto alle strade pedonali e piste ciclabili. Utilizza i colori della versione vecchia di Mapnik.
+ Modifica dello stile standard per un maggior contrasto delle strade pedonali e piste ciclabili. Utilizza i colori della versione vecchia di Mapnik.
Orario di arrivo intermedio
orario intermedio
+ Acquista OsmAnd Live per sbloccare tutte le funzionalità: aggiornamenti quotidiani delle mappe con download illimitati, tutti i componenti aggiuntivi gratuiti e a pagamento, Wikipedia, Wikivoyage è molto altro.
diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml
index 50b488b8dc..4f32a97924 100644
--- a/OsmAnd/res/values-pt-rBR/strings.xml
+++ b/OsmAnd/res/values-pt-rBR/strings.xml
@@ -1483,7 +1483,7 @@ Pôr do Sol: %2$s
Mostrar paradas de transporte
Aplicativo de navegação OsmAnd
Dados de POI foram atualizados ({0} foram carregados)
- Erro ao atualizar a lista local de POI
+ Não pôde atualizar a lista local de POIs
Erro ao carregar dados do servidor
Não há dados de POI off-line para esta região
Aproximar zoom permite atualizar POIs
@@ -1547,7 +1547,7 @@ Pôr do Sol: %2$s
Usar a Internet para calcular a rota
Usar a navegação on-line
Especificar configurações de Openstreetmap.org (OSM) necessárias para envios ao OSM
- Especificar o idioma, baixar/atualizar dados
+ Especificar o idioma, baixar/atualizar dados.
Dados
Configurações adicionais
Atualizar mapa
@@ -1960,10 +1960,10 @@ Pôr do Sol: %2$s
Sem endereço determinado
Procurando endereço
Rotas a cavalo
- Atualizar tudo
+ Atualizar
Somente baixar via Wi-Fi
Atualização ao vivo
-Atualizar já
+Atualizar
Distância:
Tempo:
App não tem permissão para usar o cartão SD
@@ -2077,7 +2077,7 @@ Pôr do Sol: %2$s
Encontrar a minha posição
Não verificar se há atualizações de versão ou descontos relacionados ao OsmAnd.
Não mostrar atualizações
- Você deseja atualizar todos os seus mapas agora?
+ Atualizar todos os mapas agora?
Limpar todos os títulos
Você tem certeza que deseja substituir seu favorito %1$s?
Mudar
@@ -2904,4 +2904,15 @@ Pôr do Sol: %2$s
\ne muito mais…
Baixe artigos da Wikipédia por %1$s para lê-los offline.
Procurando o artigo wiki necessário
+ Marcador
+ Ocultar descrição completa
+ Mostrar descrição completa
+ O link será aberto em um navegador web.
+ Como abrir o link?
+ Ler a Wikipédia offline
+ Baixar tudo
+ Você cancelou a sua assinatura OsmAnd Live
+ Arquivos GPX
+ Hora de chegada intermediária
+ Hora intermediária
diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java
index 9fb04f29ba..b19a20700f 100644
--- a/OsmAnd/src/net/osmand/plus/AppInitializer.java
+++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java
@@ -13,7 +13,6 @@ import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.support.v7.app.AlertDialog;
-
import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
@@ -27,6 +26,7 @@ import net.osmand.plus.activities.DayNightHelper;
import net.osmand.plus.activities.LocalIndexHelper;
import net.osmand.plus.activities.LocalIndexInfo;
import net.osmand.plus.activities.SavingTrackHelper;
+import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.download.ui.AbstractLoadLocalIndexTask;
import net.osmand.plus.helpers.AvoidSpecificRoads;
@@ -67,7 +67,6 @@ import java.util.Locale;
import java.util.Random;
import btools.routingapp.BRouterServiceConnection;
-
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.getPendingIntent;
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLastCheck;
import static net.osmand.plus.liveupdates.LiveUpdatesHelper.preferenceLiveUpdatesOn;
@@ -448,6 +447,7 @@ public class AppInitializer implements IProgress {
app.mapMarkersDbHelper = startupInit(new MapMarkersDbHelper(app), MapMarkersDbHelper.class);
app.mapMarkersHelper = startupInit(new MapMarkersHelper(app), MapMarkersHelper.class);
app.searchUICore = startupInit(new QuickSearchHelper(app), QuickSearchHelper.class);
+ app.mapViewTrackingUtilities = startupInit(new MapViewTrackingUtilities(app), MapViewTrackingUtilities.class);
app.travelDbHelper = new TravelDbHelper(app);
if (app.getSettings().SELECTED_TRAVEL_BOOK.get() != null) {
app.travelDbHelper.initTravelBooks();
diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
index ba2a6d89b0..7a37d2860b 100644
--- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java
@@ -110,7 +110,7 @@ public class ContextMenuAdapter {
@LayoutRes
private int layoutId;
private final ConfigureMapMenu.OnClickListener changeAppModeListener;
- private final IconsCache mIconsCache;
+ private final UiUtilities mIconsCache;
public ContextMenuArrayAdapter(Activity context,
@LayoutRes int layoutRes,
@@ -124,7 +124,7 @@ public class ContextMenuAdapter {
this.lightTheme = lightTheme;
this.layoutId = layoutRes;
this.changeAppModeListener = changeAppModeListener;
- mIconsCache = app.getIconsCache();
+ mIconsCache = app.getUIUtilities();
}
@Override
@@ -169,7 +169,7 @@ public class ContextMenuAdapter {
}
if (layoutId == R.layout.help_to_improve_item) {
TextView feedbackButton = (TextView) convertView.findViewById(R.id.feedbackButton);
- Drawable pollIcon = app.getIconsCache().getThemedIcon(R.drawable.ic_action_big_poll);
+ Drawable pollIcon = app.getUIUtilities().getThemedIcon(R.drawable.ic_action_big_poll);
feedbackButton.setCompoundDrawablesWithIntrinsicBounds(null, pollIcon, null, null);
feedbackButton.setOnClickListener(new View.OnClickListener() {
@Override
@@ -181,7 +181,7 @@ public class ContextMenuAdapter {
});
TextView contactUsButton = (TextView) convertView.findViewById(R.id.contactUsButton);
Drawable contactUsIcon =
- app.getIconsCache().getThemedIcon(R.drawable.ic_action_big_feedback);
+ app.getUIUtilities().getThemedIcon(R.drawable.ic_action_big_feedback);
contactUsButton.setCompoundDrawablesWithIntrinsicBounds(null, contactUsIcon, null,
null);
final String email = app.getString(R.string.support_email);
diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuItem.java b/OsmAnd/src/net/osmand/plus/ContextMenuItem.java
index f8f4c92fc6..3143a28f39 100644
--- a/OsmAnd/src/net/osmand/plus/ContextMenuItem.java
+++ b/OsmAnd/src/net/osmand/plus/ContextMenuItem.java
@@ -107,7 +107,7 @@ public class ContextMenuItem {
if (skipPaintingWithoutColor || getColorRes() != INVALID_ID) {
return getColorRes();
} else {
- return IconsCache.getDefaultColorRes(context);
+ return UiUtilities.getDefaultColorRes(context);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/IconsCache.java b/OsmAnd/src/net/osmand/plus/IconsCache.java
deleted file mode 100644
index b483d14b17..0000000000
--- a/OsmAnd/src/net/osmand/plus/IconsCache.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package net.osmand.plus;
-
-import android.content.Context;
-import android.graphics.drawable.Drawable;
-import android.graphics.drawable.LayerDrawable;
-import android.support.annotation.ColorInt;
-import android.support.annotation.ColorRes;
-import android.support.annotation.DrawableRes;
-import android.support.v4.content.ContextCompat;
-import android.support.v4.graphics.drawable.DrawableCompat;
-import android.view.MenuItem;
-
-import gnu.trove.map.hash.TLongObjectHashMap;
-
-public class IconsCache {
-
- private TLongObjectHashMap drawable = new TLongObjectHashMap<>();
- private OsmandApplication app;
-
- public IconsCache(OsmandApplication app) {
- this.app = app;
- }
-
- private Drawable getDrawable(@DrawableRes int resId, @ColorRes int clrId) {
- long hash = ((long)resId << 31l) + clrId;
- Drawable d = drawable.get(hash);
- if (d == null) {
- d = ContextCompat.getDrawable(app, resId);
- d = DrawableCompat.wrap(d);
- d.mutate();
- if (clrId != 0) {
- DrawableCompat.setTint(d, ContextCompat.getColor(app, clrId));
- }
- drawable.put(hash, d);
- }
- return d;
- }
-
- private Drawable getPaintedDrawable(@DrawableRes int resId, @ColorInt int color){
- long hash = ((long)resId << 31l) + color;
- Drawable d = drawable.get(hash);
- if(d == null) {
- d = ContextCompat.getDrawable(app, resId);
- d = DrawableCompat.wrap(d);
- d.mutate();
- DrawableCompat.setTint(d, color);
-
- drawable.put(hash, d);
- }
- return d;
- }
-
- public Drawable getPaintedIcon(@DrawableRes int id, @ColorInt int color){
- return getPaintedDrawable(id, color);
- }
-
- public Drawable getIcon(@DrawableRes int id, @ColorRes int colorId) {
- return getDrawable(id, colorId);
- }
-
- public Drawable getIcon(@DrawableRes int backgroundId, @DrawableRes int id, @ColorRes int colorId) {
- Drawable b = getDrawable(backgroundId, 0);
- Drawable f = getDrawable(id, colorId);
- Drawable[] layers = new Drawable[2];
- layers[0] = b;
- layers[1] = f;
- return new LayerDrawable(layers);
- }
-
- public Drawable getThemedIcon(@DrawableRes int id) {
- return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color : 0);
- }
-
- public Drawable getIcon(@DrawableRes int id) {
- return getDrawable(id, 0);
- }
-
- public Drawable getIcon(@DrawableRes int id, boolean light) {
- return getDrawable(id, light ? R.color.icon_color : 0);
- }
-
- @ColorRes
- public static int getDefaultColorRes(Context context) {
- final OsmandApplication app = (OsmandApplication) context.getApplicationContext();
- boolean light = app.getSettings().isLightContent();
- return light ? R.color.icon_color : R.color.color_white;
- }
-}
diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java
index 5b2611e2c2..ba3d388a39 100644
--- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java
+++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java
@@ -556,14 +556,7 @@ public class OsmAndLocationProvider implements SensorEventListener {
}
}
- public synchronized Float getHeading() {
-// if (heading != null && lastValSin != avgValSin && System.currentTimeMillis() - lastHeadingCalcTime > 700) {
-// avgValSin = lastValSin;
-// avgValCos = lastValCos;
-// Arrays.fill(previousCompassValuesA, avgValSin);
-// Arrays.fill(previousCompassValuesB, avgValCos);
-// updateCompassVal();
-// }
+ public Float getHeading() {
return heading;
}
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index 1203adafe8..1dcaca042b 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -42,6 +42,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.api.SQLiteAPI;
import net.osmand.plus.api.SQLiteAPIImpl;
+import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.helpers.AvoidSpecificRoads;
@@ -87,7 +88,7 @@ public class OsmandApplication extends MultiDexApplication {
OsmAndAppCustomization appCustomization;
private final SQLiteAPI sqliteAPI = new SQLiteAPIImpl(this);
private final OsmAndTaskManager taskManager = new OsmAndTaskManager(this);
- private final IconsCache iconsCache = new IconsCache(this);
+ private final UiUtilities iconsCache = new UiUtilities(this);
Handler uiHandler;
private boolean plusVersionInApp;
@@ -122,6 +123,7 @@ public class OsmandApplication extends MultiDexApplication {
QuickSearchHelper searchUICore;
TravelDbHelper travelDbHelper;
InAppPurchaseHelper inAppPurchaseHelper;
+ MapViewTrackingUtilities mapViewTrackingUtilities;
RoutingConfiguration.Builder defaultRoutingConfig;
private Locale preferredLocale = null;
@@ -214,10 +216,11 @@ public class OsmandApplication extends MultiDexApplication {
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
- public IconsCache getIconsCache() {
+ public UiUtilities getUIUtilities() {
return iconsCache;
}
+
@Override
public void onTerminate() {
super.onTerminate();
@@ -420,7 +423,7 @@ public class OsmandApplication extends MultiDexApplication {
View view = uiContext.getLayoutInflater().inflate(R.layout.select_voice_first, null);
((ImageView) view.findViewById(R.id.icon))
- .setImageDrawable(getIconsCache().getIcon(R.drawable.ic_action_volume_up, getSettings().isLightContent()));
+ .setImageDrawable(getUIUtilities().getIcon(R.drawable.ic_action_volume_up, getSettings().isLightContent()));
view.findViewById(R.id.spinner).setOnClickListener(new View.OnClickListener() {
@Override
@@ -441,7 +444,7 @@ public class OsmandApplication extends MultiDexApplication {
});
((ImageView) view.findViewById(R.id.dropDownIcon))
- .setImageDrawable(getIconsCache().getIcon(R.drawable.ic_action_arrow_drop_down, getSettings().isLightContent()));
+ .setImageDrawable(getUIUtilities().getIcon(R.drawable.ic_action_arrow_drop_down, getSettings().isLightContent()));
builder.setCancelable(true);
builder.setNegativeButton(R.string.shared_string_cancel, null);
@@ -1003,4 +1006,8 @@ public class OsmandApplication extends MultiDexApplication {
});
bld.show();
}
+
+ public MapViewTrackingUtilities getMapViewTrackingUtilities() {
+ return mapViewTrackingUtilities;
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/UiUtilities.java b/OsmAnd/src/net/osmand/plus/UiUtilities.java
new file mode 100644
index 0000000000..7f54a4b820
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/UiUtilities.java
@@ -0,0 +1,225 @@
+package net.osmand.plus;
+
+import gnu.trove.map.hash.TLongObjectHashMap;
+import net.osmand.Location;
+import net.osmand.data.LatLon;
+import net.osmand.plus.views.DirectionDrawable;
+import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.LayerDrawable;
+import android.hardware.Sensor;
+import android.hardware.SensorManager;
+import android.support.annotation.ColorInt;
+import android.support.annotation.ColorRes;
+import android.support.annotation.DrawableRes;
+import android.support.v4.content.ContextCompat;
+import android.support.v4.graphics.drawable.DrawableCompat;
+import android.view.WindowManager;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+public class UiUtilities {
+
+ private TLongObjectHashMap drawableCache = new TLongObjectHashMap<>();
+ private OsmandApplication app;
+ private static final int ORIENTATION_0 = 0;
+ private static final int ORIENTATION_90 = 3;
+ private static final int ORIENTATION_270 = 1;
+ private static final int ORIENTATION_180 = 2;
+
+
+ public UiUtilities(OsmandApplication app) {
+ this.app = app;
+ }
+
+ private Drawable getDrawable(@DrawableRes int resId, @ColorRes int clrId) {
+ long hash = ((long) resId << 31l) + clrId;
+ Drawable d = drawableCache.get(hash);
+ if (d == null) {
+ d = ContextCompat.getDrawable(app, resId);
+ d = DrawableCompat.wrap(d);
+ d.mutate();
+ if (clrId != 0) {
+ DrawableCompat.setTint(d, ContextCompat.getColor(app, clrId));
+ }
+ drawableCache.put(hash, d);
+ }
+ return d;
+ }
+
+ private Drawable getPaintedDrawable(@DrawableRes int resId, @ColorInt int color) {
+ long hash = ((long) resId << 31l) + color;
+ Drawable d = drawableCache.get(hash);
+ if (d == null) {
+ d = ContextCompat.getDrawable(app, resId);
+ d = DrawableCompat.wrap(d);
+ d.mutate();
+ DrawableCompat.setTint(d, color);
+
+ drawableCache.put(hash, d);
+ }
+ return d;
+ }
+
+ public Drawable getPaintedIcon(@DrawableRes int id, @ColorInt int color) {
+ return getPaintedDrawable(id, color);
+ }
+
+ public Drawable getIcon(@DrawableRes int id, @ColorRes int colorId) {
+ return getDrawable(id, colorId);
+ }
+
+ public Drawable getIcon(@DrawableRes int backgroundId, @DrawableRes int id, @ColorRes int colorId) {
+ Drawable b = getDrawable(backgroundId, 0);
+ Drawable f = getDrawable(id, colorId);
+ Drawable[] layers = new Drawable[2];
+ layers[0] = b;
+ layers[1] = f;
+ return new LayerDrawable(layers);
+ }
+
+ public Drawable getThemedIcon(@DrawableRes int id) {
+ return getDrawable(id, app.getSettings().isLightContent() ? R.color.icon_color : 0);
+ }
+
+ public Drawable getIcon(@DrawableRes int id) {
+ return getDrawable(id, 0);
+ }
+
+ public Drawable getIcon(@DrawableRes int id, boolean light) {
+ return getDrawable(id, light ? R.color.icon_color : 0);
+ }
+
+ @ColorRes
+ public static int getDefaultColorRes(Context context) {
+ final OsmandApplication app = (OsmandApplication) context.getApplicationContext();
+ boolean light = app.getSettings().isLightContent();
+ return light ? R.color.icon_color : R.color.color_white;
+ }
+
+
+ public UpdateLocationViewCache getUpdateLocationViewCache(){
+ UpdateLocationViewCache uvc = new UpdateLocationViewCache();
+ uvc.screenOrientation = getScreenOrientation();
+ return uvc;
+ }
+
+ public static class UpdateLocationViewCache {
+ int screenOrientation;
+ public boolean paintTxt = true;
+ public int arrowResId;
+ public int arrowColor;
+ public int textColor;
+ public LatLon specialFrom;
+ }
+
+ public void updateLocationView(UpdateLocationViewCache cache, ImageView arrow, TextView txt,
+ double toLat, double toLon) {
+ updateLocationView(cache, arrow, txt, new LatLon(toLat, toLon));
+ }
+ public void updateLocationView(UpdateLocationViewCache cache, ImageView arrow, TextView txt,
+ LatLon toLoc) {
+ float[] mes = new float[2];
+ boolean stale = false;
+ LatLon fromLoc = cache == null ? null : cache.specialFrom;
+ boolean useCenter = fromLoc != null;
+ Float h = null;
+ if (fromLoc == null) {
+ Location loc = app.getLocationProvider().getLastKnownLocation();
+ h = app.getLocationProvider().getHeading();
+ if (loc == null) {
+ loc = app.getLocationProvider().getLastStaleKnownLocation();
+ stale = true;
+ }
+ if (loc != null) {
+ fromLoc = new LatLon(loc.getLatitude(), loc.getLongitude());
+ } else {
+ useCenter = true;
+ fromLoc = app.getMapViewTrackingUtilities().getMapLocation();
+ h = app.getMapViewTrackingUtilities().getMapRotate();
+ if(h != null) {
+ h = -h;
+ }
+ }
+ }
+ if (fromLoc != null && toLoc != null) {
+ Location.distanceBetween(toLoc.getLatitude(), toLoc.getLongitude(), fromLoc.getLatitude(),
+ fromLoc.getLongitude(), mes);
+ }
+
+ if (arrow != null) {
+ boolean newImage = false;
+ int arrowResId = cache == null ? 0 : cache.arrowResId;
+ if (arrowResId == 0) {
+ arrowResId = R.drawable.ic_direction_arrow;
+ }
+ DirectionDrawable dd;
+ if (!(arrow.getDrawable() instanceof DirectionDrawable)) {
+ newImage = true;
+ dd = new DirectionDrawable(app, arrow.getWidth(), arrow.getHeight());
+ } else {
+ dd = (DirectionDrawable) arrow.getDrawable();
+ }
+ int imgColorSet = cache == null ? 0 : cache.arrowColor;
+ if (imgColorSet == 0) {
+ imgColorSet = useCenter ? R.color.color_distance : R.color.color_myloc_distance;
+ if (stale) {
+ imgColorSet = R.color.icon_color;
+ }
+ }
+ dd.setImage(arrowResId, imgColorSet);
+ if (fromLoc == null || h == null || toLoc == null) {
+ dd.setAngle(0);
+ } else {
+ float orientation = (cache == null ? 0 : cache.screenOrientation) ;
+ dd.setAngle(mes[1] - h + 180 + orientation);
+ }
+ if (newImage) {
+ arrow.setImageDrawable(dd);
+ }
+ arrow.invalidate();
+ }
+ if (txt != null) {
+ if (fromLoc != null && toLoc != null) {
+ if (cache.paintTxt) {
+ int textColorSet = cache.textColor;
+ if (textColorSet == 0) {
+ textColorSet = useCenter ? R.color.color_distance : R.color.color_myloc_distance;
+ if (stale) {
+ textColorSet = R.color.icon_color;
+ }
+ }
+ txt.setTextColor(app.getResources().getColor(textColorSet));
+ }
+ txt.setText(OsmAndFormatter.getFormattedDistance(mes[0], app));
+ } else {
+ txt.setText("");
+ }
+ }
+ }
+
+ public int getScreenOrientation() {
+ int screenOrientation = ((WindowManager) app.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getRotation();
+ switch (screenOrientation) {
+ case ORIENTATION_0: // Device default (normally portrait)
+ screenOrientation = 0;
+ break;
+ case ORIENTATION_90: // Landscape right
+ screenOrientation = 90;
+ break;
+ case ORIENTATION_270: // Landscape left
+ screenOrientation = 270;
+ break;
+ case ORIENTATION_180: // Upside down
+ screenOrientation = 180;
+ break;
+ }
+ //Looks like screenOrientation correction must not be applied for devices without compass?
+ Sensor compass = ((SensorManager) app.getSystemService(Context.SENSOR_SERVICE)).getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
+ if (compass == null) {
+ screenOrientation = 0;
+ }
+ return screenOrientation;
+ }
+
+}
diff --git a/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java b/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java
index 93abbc07dd..9eec370077 100644
--- a/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/ActionBarPreferenceActivity.java
@@ -44,7 +44,7 @@ public abstract class ActionBarPreferenceActivity extends AppCompatPreferenceAct
shadowView = null;
}
tb.setClickable(true);
- tb.setNavigationIcon(((OsmandApplication) getApplication()).getIconsCache().getIcon(R.drawable.ic_arrow_back));
+ tb.setNavigationIcon(((OsmandApplication) getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back));
tb.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
tb.setBackgroundColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTabBackground)));
tb.setTitleTextColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTextColor)));
diff --git a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java
index 3d463dafab..1392594bed 100644
--- a/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/EditFavoriteGroupDialogFragment.java
@@ -244,7 +244,7 @@ public class EditFavoriteGroupDialogFragment extends MenuBottomSheetDialogFragme
if (color == 0) {
colorImageView.setImageDrawable(getContentIcon(R.drawable.ic_action_circle));
} else {
- colorImageView.setImageDrawable(getMyApplication().getIconsCache().getPaintedIcon(R.drawable.ic_action_circle, color));
+ colorImageView.setImageDrawable(getMyApplication().getUIUtilities().getPaintedIcon(R.drawable.ic_action_circle, color));
}
}
@@ -284,7 +284,7 @@ public class EditFavoriteGroupDialogFragment extends MenuBottomSheetDialogFragme
TextView textView = (TextView) v.findViewById(R.id.text1);
textView.setText(app.getString(ColorDialogs.paletteColors[position]));
textView.setCompoundDrawablesWithIntrinsicBounds(null, null,
- app.getIconsCache().getPaintedIcon(R.drawable.ic_action_circle, color), null);
+ app.getUIUtilities().getPaintedIcon(R.drawable.ic_action_circle, color), null);
textView.setCompoundDrawablePadding(AndroidUtils.dpToPx(getContext(), 10f));
v.findViewById(R.id.divider).setVisibility(View.GONE);
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java
index a72fbcab6e..27fc4c3907 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesListFragment.java
@@ -3,6 +3,24 @@
*/
package net.osmand.plus.activities;
+import java.text.Collator;
+import java.util.Comparator;
+import java.util.List;
+
+import net.osmand.Location;
+import net.osmand.data.FavouritePoint;
+import net.osmand.data.LatLon;
+import net.osmand.data.PointDescription;
+import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandSettings;
+import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities.UpdateLocationViewCache;
+import net.osmand.plus.activities.search.SearchActivity;
+import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
+import net.osmand.plus.base.FavoriteImageDrawable;
+import net.osmand.plus.base.OsmAndListFragment;
+import net.osmand.util.MapUtils;
import android.app.Activity;
import android.content.Intent;
import android.support.v4.app.FragmentActivity;
@@ -20,23 +38,6 @@ import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
-import net.osmand.data.FavouritePoint;
-import net.osmand.data.LatLon;
-import net.osmand.data.PointDescription;
-import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandSettings;
-import net.osmand.plus.R;
-import net.osmand.plus.activities.search.SearchActivity;
-import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
-import net.osmand.plus.base.FavoriteImageDrawable;
-import net.osmand.plus.base.OsmAndListFragment;
-import net.osmand.plus.dashboard.DashLocationFragment;
-import net.osmand.util.MapUtils;
-
-import java.util.Comparator;
-import java.util.List;
-
public class FavoritesListFragment extends OsmAndListFragment implements SearchActivityChild, OsmAndCompassListener {
public static final String SELECT_FAVORITE_POINT_INTENT_KEY = "SELECT_FAVORITE_POINT_INTENT_KEY";
@@ -48,7 +49,7 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
private OsmandSettings settings;
private boolean compassRegistered;
-
+ float lastHeading ;
@Override
public void onAttach(Activity activity) {
@@ -67,7 +68,7 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
double lat = intent.getDoubleExtra(SearchActivity.SEARCH_LAT, 0);
double lon = intent.getDoubleExtra(SearchActivity.SEARCH_LON, 0);
if (lat != 0 || lon != 0) {
- favouritesAdapter.location = new LatLon(lat, lon);
+ favouritesAdapter.cache.specialFrom = new LatLon(lat, lon);
}
}
}
@@ -85,15 +86,10 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
@Override
public void onResume() {
super.onResume();
-
- if (favouritesAdapter.location == null && getActivity() instanceof SearchActivity) {
- favouritesAdapter.location = ((SearchActivity) getActivity()).getSearchPoint();
+ if (getActivity() instanceof SearchActivity && ((SearchActivity) getActivity()).getSearchPoint() != null) {
+ favouritesAdapter.cache.specialFrom = ((SearchActivity) getActivity()).getSearchPoint();
}
- if (favouritesAdapter.location == null) {
- favouritesAdapter.location = settings.getLastKnownMapLocation();
- }
- favouritesAdapter.screenOrientation = DashLocationFragment.getScreenOrientation(getActivity());
- locationUpdate(favouritesAdapter.location);
+ locationUpdate(favouritesAdapter.cache.specialFrom);
}
@Override
@@ -106,13 +102,17 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
app.getLocationProvider().addCompassListener(this);
compassRegistered = true;
}
- favouritesAdapter.searchAroundLocation = true;
+ favouritesAdapter.cache.specialFrom = null;
} else {
- favouritesAdapter.searchAroundLocation = false;
+ favouritesAdapter.cache.specialFrom = ((SearchActivity) getActivity()).getSearchPoint();
}
}
if (favouritesAdapter != null) {
- favouritesAdapter.updateLocation(l);
+ if(l != null) {
+ favouritesAdapter.sortByName();
+ } else {
+ favouritesAdapter.sortByDistance(l);
+ }
}
}
@@ -156,33 +156,27 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
public static class FavouritesAdapter extends ArrayAdapter {
private Activity activity;
- private LatLon location;
private OsmandApplication app;
- private boolean searchAroundLocation;
- private int screenOrientation;
- private Float heading;
- private boolean shoudShowMenuButton;
+ private boolean shouldShowMenuButton;
+ private UpdateLocationViewCache cache;
public FavouritesAdapter(Activity activity, List list,
- boolean shoudShowMenuButton) {
+ boolean shouldShowMenuButton) {
super(activity, R.layout.favorites_list_item, list);
this.activity = activity;
this.app = ((OsmandApplication) activity.getApplication());
- this.shoudShowMenuButton = shoudShowMenuButton;
+ this.shouldShowMenuButton = shouldShowMenuButton;
+ cache = app.getUIUtilities().getUpdateLocationViewCache();
}
- public LatLon getLocation() {
- return location;
- }
- public void updateLocation(LatLon l) {
- location = l;
+ public void updateLocation(final LatLon l) {
sort(new Comparator() {
@Override
public int compare(FavouritePoint object1, FavouritePoint object2) {
- if (location != null) {
- double d1 = MapUtils.getDistance(location, object1.getLatitude(), object1.getLongitude());
- double d2 = MapUtils.getDistance(location, object2.getLatitude(), object2.getLongitude());
+ if (l != null) {
+ double d1 = MapUtils.getDistance(l, object1.getLatitude(), object1.getLongitude());
+ double d2 = MapUtils.getDistance(l, object2.getLatitude(), object2.getLongitude());
if (d1 == d2) {
return 0;
} else if (d1 > d2) {
@@ -204,7 +198,7 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
if (row == null) {
- LayoutInflater inflater = activity.getLayoutInflater(); // favourite dank
+ LayoutInflater inflater = activity.getLayoutInflater();
row = inflater.inflate(R.layout.favorites_list_item, parent, false);
}
@@ -212,14 +206,14 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
TextView distanceText = (TextView) row.findViewById(R.id.distance);
ImageView icon = (ImageView) row.findViewById(R.id.favourite_icon);
ImageView direction = (ImageView) row.findViewById(R.id.direction);
- ImageView giImage= (ImageView)row.findViewById(R.id.group_image);
+ ImageView giImage = (ImageView) row.findViewById(R.id.group_image);
direction.setVisibility(View.VISIBLE);
final FavouritePoint favorite = getItem(position);
- if (shoudShowMenuButton) {
+ if (shouldShowMenuButton) {
ImageButton options = (ImageButton) row.findViewById(R.id.options);
options.setFocusable(false);
- options.setImageDrawable(((OsmandApplication) activity.getApplication())
- .getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
+ options.setImageDrawable(((OsmandApplication) activity.getApplication()).getUIUtilities()
+ .getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setVisibility(View.VISIBLE);
options.setOnClickListener(new View.OnClickListener() {
@Override
@@ -230,25 +224,65 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
}
if (!favorite.getCategory().isEmpty()) {
giImage.setVisibility(View.VISIBLE);
- giImage.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_small_group));
+ giImage.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_small_group));
} else {
giImage.setVisibility(View.GONE);
}
((TextView) row.findViewById(R.id.group_name)).setText(favorite.getCategory());
icon.setImageDrawable(FavoriteImageDrawable.getOrCreate(activity, favorite.getColor(), false));
- DashLocationFragment.updateLocationView(!searchAroundLocation, location, heading, direction, distanceText,
- favorite.getLatitude(), favorite.getLongitude(), screenOrientation, app);
-
+
+ app.getUIUtilities().updateLocationView(cache, direction, distanceText,
+ favorite.getLatitude(), favorite.getLongitude());
name.setText(getName(favorite));
final CheckBox ch = (CheckBox) row.findViewById(R.id.toggle_item);
icon.setVisibility(View.VISIBLE);
ch.setVisibility(View.GONE);
if (activity instanceof SearchActivity)
- ViewCompat.setAccessibilityDelegate(row, ((SearchActivity)activity).getAccessibilityAssistant());
+ ViewCompat.setAccessibilityDelegate(row, ((SearchActivity) activity).getAccessibilityAssistant());
return row;
}
+ public void sortByName() {
+ final Collator inst = Collator.getInstance();
+ sort(new Comparator() {
+ @Override
+ public int compare(FavouritePoint o1, FavouritePoint o2) {
+ return inst.compare(o1.getName(), o2.getName());
+ }
+
+ });
+
+ }
+ public void sortByDistance(final LatLon loc) {
+ sort(new Comparator() {
+ @Override
+ public int compare(FavouritePoint lhs, FavouritePoint rhs) {
+ if (loc == null) {
+ return 0;
+ }
+ double ld = MapUtils.getDistance(loc, lhs.getLatitude(), lhs.getLongitude());
+ double rd = MapUtils.getDistance(loc, rhs.getLatitude(), rhs.getLongitude());
+ return Double.compare(ld, rd);
+
+ }
+ });
+
+ }
+
+
+ public void sortByDefault() {
+ Location loc = app.getLocationProvider().getLastStaleKnownLocation();
+ LatLon map = app.getMapViewTrackingUtilities().getMapLocation();
+ if (loc != null) {
+ sortByDistance(new LatLon(loc.getLatitude(), loc.getLongitude()));
+ } else if(map != null){
+ sortByDistance(map);
+ } else{
+ sortByName();
+ }
+ }
+
}
public OsmandApplication getMyApplication() {
@@ -260,9 +294,8 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
// 99 in next line used to one-time initialize arrows (with reference vs. fixed-north direction) on non-compass
// devices
FragmentActivity activity = getActivity();
- float lastHeading = favouritesAdapter.heading != null ? favouritesAdapter.heading : 99;
- favouritesAdapter.heading = value;
- if (Math.abs(MapUtils.degreesDiff(lastHeading, favouritesAdapter.heading)) > 5) {
+ if (Math.abs(MapUtils.degreesDiff(lastHeading, value)) > 5) {
+ lastHeading = value;
if (activity instanceof SearchActivity) {
((SearchActivity)activity).getAccessibilityAssistant().lockEvents();
favouritesAdapter.notifyDataSetChanged();
@@ -270,8 +303,6 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
} else {
favouritesAdapter.notifyDataSetChanged();
}
- } else {
- favouritesAdapter.heading = lastHeading;
}
if (activity instanceof SearchActivity) {
final View selected = ((SearchActivity)activity).getAccessibilityAssistant().getFocusedView();
@@ -281,7 +312,7 @@ public class FavoritesListFragment extends OsmAndListFragment implements SearchA
if ((position != AdapterView.INVALID_POSITION) && (position >= getListView().getHeaderViewsCount())) {
FavouritePoint point = favouritesAdapter.getItem(position - getListView().getHeaderViewsCount());
LatLon location = new LatLon(point.getLatitude(), point.getLongitude());
- ((SearchActivity)activity).getNavigationInfo().updateTargetDirection(location, favouritesAdapter.heading.floatValue());
+ ((SearchActivity)activity).getNavigationInfo().updateTargetDirection(location, value);
}
} catch (Exception e) {
return;
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesSearchFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesSearchFragment.java
index e4419afe3b..f9c73ed087 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesSearchFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesSearchFragment.java
@@ -105,7 +105,7 @@ public class FavoritesSearchFragment extends DialogFragment {
}
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
- toolbar.setNavigationIcon(app.getIconsCache().getThemedIcon(R.drawable.ic_arrow_back));
+ toolbar.setNavigationIcon(app.getUIUtilities().getThemedIcon(R.drawable.ic_arrow_back));
toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
toolbar.setNavigationOnClickListener(
new View.OnClickListener() {
@@ -141,7 +141,7 @@ public class FavoritesSearchFragment extends DialogFragment {
progressBar = (ProgressBar) view.findViewById(R.id.searchProgressBar);
clearButton = (ImageButton) view.findViewById(R.id.clearButton);
- clearButton.setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark));
+ clearButton.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark));
clearButton.setOnClickListener(
new View.OnClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
index 8d78cec590..8cbb03c761 100644
--- a/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/FavoritesTreeFragment.java
@@ -149,7 +149,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
View searchView = inflater.inflate(R.layout.search_fav_list_item, null);
searchView.setBackgroundResource(light ? R.color.bg_color_light : R.color.bg_color_dark);
TextView title = (TextView) searchView.findViewById(R.id.title);
- title.setCompoundDrawablesWithIntrinsicBounds(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_search_dark), null, null, null);
+ title.setCompoundDrawablesWithIntrinsicBounds(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark), null, null, null);
title.setHint(R.string.shared_string_search);
searchView.setOnClickListener(new View.OnClickListener() {
@Override
@@ -783,7 +783,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
int disabledColor = light ? R.color.secondary_text_light : R.color.secondary_text_dark;
row.findViewById(R.id.group_divider).setVisibility(groupPosition == 0 ? View.GONE : View.VISIBLE);
int color = model.color == 0 || model.color == Color.BLACK ? getResources().getColor(R.color.color_favorite) : model.color;
- setCategoryIcon(app, app.getIconsCache().getPaintedIcon(
+ setCategoryIcon(app, app.getUIUtilities().getPaintedIcon(
R.drawable.ic_action_fav_dark, visible ? (color | 0xff000000) : getResources().getColor(disabledColor)),
groupPosition, isExpanded, row, light);
adjustIndicator(app, groupPosition, isExpanded, row, light);
@@ -833,7 +833,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
}
final View ch = row.findViewById(R.id.options);
if (!selectionMode) {
- ((ImageView) ch).setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
+ ((ImageView) ch).setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white));
ch.setVisibility(View.VISIBLE);
ch.setContentDescription(getString(R.string.shared_string_settings));
ch.setOnClickListener(new View.OnClickListener() {
@@ -877,7 +877,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
if (showOptionsButton) {
ImageView options = (ImageView) row.findViewById(R.id.options);
options.setFocusable(false);
- options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(
+ options.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(
R.drawable.ic_overflow_menu_white));
options.setVisibility(View.VISIBLE);
options.setOnClickListener(new View.OnClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java
index 9b95a3e3a5..3075ec1ce9 100644
--- a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java
@@ -252,7 +252,7 @@ public class IntermediatePointsDialog {
} else {
int icon = position == intermediates.size() - 1? R.drawable.ic_action_target:
R.drawable.ic_action_intermediate;
- tv.setCompoundDrawablesWithIntrinsicBounds(app.getIconsCache().getThemedIcon(icon), null, null, null);
+ tv.setCompoundDrawablesWithIntrinsicBounds(app.getUIUtilities().getThemedIcon(icon), null, null, null);
tv.setCompoundDrawablePadding(padding);
final CheckBox ch = ((CheckBox) v.findViewById(R.id.toggle_item));
ch.setVisibility(View.VISIBLE);
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
index 82fd3688d6..b03a24fb0b 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java
@@ -160,7 +160,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
private static final Log LOG = PlatformUtil.getLog(MapActivity.class);
- private static MapViewTrackingUtilities mapViewTrackingUtilities;
+ private MapViewTrackingUtilities mapViewTrackingUtilities;
private static MapContextMenu mapContextMenu = new MapContextMenu();
private static Intent prevActivityIntent = null;
@@ -220,7 +220,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
boolean portraitMode = AndroidUiHelper.isOrientationPortrait(this);
boolean largeDevice = AndroidUiHelper.isXLargeDevice(this);
landscapeLayout = !portraitMode && !largeDevice;
-
+ mapViewTrackingUtilities = app.getMapViewTrackingUtilities();
mapContextMenu.setMapActivity(this);
super.onCreate(savedInstanceState);
@@ -1227,10 +1227,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
}
public LatLon getMapLocation() {
- if (mapView == null) {
- return settings.getLastKnownMapLocation();
- }
- return new LatLon(mapView.getLatitude(), mapView.getLongitude());
+ return mapViewTrackingUtilities.getMapLocation();
}
public float getMapRotate() {
@@ -1452,9 +1449,6 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
return mapViewTrackingUtilities;
}
- public static MapViewTrackingUtilities getSingleMapViewTrackingUtilities() {
- return mapViewTrackingUtilities;
- }
protected void parseLaunchIntentLocation() {
Intent intent = getIntent();
diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java
index 3a44bbaf61..1a7a063378 100644
--- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java
+++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java
@@ -327,7 +327,7 @@ public class MapActivityLayers {
@Override
public void onShow(DialogInterface dialog) {
Button neutralButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL);
- Drawable drawable = app.getIconsCache().getThemedIcon(R.drawable.ic_action_singleselect);
+ Drawable drawable = app.getUIUtilities().getThemedIcon(R.drawable.ic_action_singleselect);
neutralButton.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
neutralButton.setContentDescription(app.getString(R.string.shared_string_filters));
}
@@ -391,7 +391,7 @@ public class MapActivityLayers {
@Override
public void onShow(DialogInterface dialog) {
Button neutralButton = alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL);
- Drawable drawable = app.getIconsCache().getThemedIcon(R.drawable.ic_action_multiselect);
+ Drawable drawable = app.getUIUtilities().getThemedIcon(R.drawable.ic_action_multiselect);
neutralButton.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null);
neutralButton.setContentDescription(app.getString(R.string.apply_filters));
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java
index daf1be419e..e66b0738bc 100644
--- a/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/NavigatePointFragment.java
@@ -106,7 +106,7 @@ public class NavigatePointFragment extends Fragment implements SearchActivityChi
}
MenuItem menuItem = menu.add(0, SHOW_ON_MAP, 0, R.string.shared_string_show_on_map);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
- menuItem = menuItem.setIcon(app.getIconsCache().getIcon(R.drawable.ic_action_marker_dark, light));
+ menuItem = menuItem.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_marker_dark, light));
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/OpeningHoursView.java b/OsmAnd/src/net/osmand/plus/activities/OpeningHoursView.java
index d4dd64b7ee..cd6dddec3d 100644
--- a/OsmAnd/src/net/osmand/plus/activities/OpeningHoursView.java
+++ b/OsmAnd/src/net/osmand/plus/activities/OpeningHoursView.java
@@ -122,7 +122,7 @@ public class OpeningHoursView {
}
TextView label = (TextView)row.findViewById(R.id.label);
ImageView icon = (ImageView)row.findViewById(R.id.remove);
- icon.setBackgroundDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark));
+ icon.setBackgroundDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark));
if(selectedRule == position){
label.setTypeface(null, Typeface.BOLD);
label.setTextSize(22);
diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandActionBarActivity.java b/OsmAnd/src/net/osmand/plus/activities/OsmandActionBarActivity.java
index 5162339969..108baf0176 100644
--- a/OsmAnd/src/net/osmand/plus/activities/OsmandActionBarActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/OsmandActionBarActivity.java
@@ -19,7 +19,7 @@ public class OsmandActionBarActivity extends OsmandInAppPurchaseActivity {
//should be called after set content view
protected void setupHomeButton(){
- Drawable back = ((OsmandApplication)getApplication()).getIconsCache().getIcon(R.drawable.ic_arrow_back);
+ Drawable back = ((OsmandApplication)getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back);
back.setColorFilter(ContextCompat.getColor(this, R.color.color_white), PorterDuff.Mode.MULTIPLY);
final ActionBar supportActionBar = getSupportActionBar();
if (supportActionBar != null) {
diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java b/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java
index 55873e5102..792780859a 100644
--- a/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/activities/OsmandBaseExpandableListAdapter.java
@@ -13,10 +13,10 @@ public abstract class OsmandBaseExpandableListAdapter extends BaseExpandableList
protected void adjustIndicator(OsmandApplication app, int groupPosition, boolean isExpanded, View row, boolean light) {
ImageView indicator = (ImageView) row.findViewById(R.id.explist_indicator);
if (!isExpanded) {
- indicator.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_down, light));
+ indicator.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_arrow_down, light));
indicator.setContentDescription(row.getContext().getString(R.string.access_collapsed_list));
} else {
- indicator.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_arrow_up, light));
+ indicator.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_arrow_up, light));
indicator.setContentDescription(row.getContext().getString(R.string.access_expanded_list));
}
indicator.setVisibility(getChildrenCount(groupPosition) > 0 ? View.VISIBLE : View.GONE);
@@ -25,9 +25,9 @@ public abstract class OsmandBaseExpandableListAdapter extends BaseExpandableList
protected void setCategoryIcon(OsmandApplication app, int resId, int groupPosition, boolean isExpanded, View row, boolean light) {
ImageView icon = (ImageView) row.findViewById(R.id.category_icon);
if (resId == 0) {
- icon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_action_folder_stroke, light));
+ icon.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_action_folder_stroke, light));
} else {
- icon.setImageDrawable(app.getIconsCache().getIcon(resId, light));
+ icon.setImageDrawable(app.getUIUtilities().getIcon(resId, light));
}
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java b/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java
index cc6294e4c2..2d7f8d3c77 100644
--- a/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/OsmandListActivity.java
@@ -54,7 +54,7 @@ public abstract class OsmandListActivity extends
public MenuItem createMenuItem(Menu m, int id, int titleRes, int iconDark, int menuItemType) {
MenuItem menuItem = m.add(0, id, 0, titleRes);
if (iconDark != 0) {
- menuItem.setIcon(getMyApplication().getIconsCache().getIcon(iconDark));
+ menuItem.setIcon(getMyApplication().getUIUtilities().getIcon(iconDark));
}
menuItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
index 656f3079cf..0ea1b94b3c 100644
--- a/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/PluginActivity.java
@@ -132,7 +132,7 @@ public class PluginActivity extends OsmandActionBarActivity {
Button getButton = (Button)findViewById(R.id.plugin_get);
Button settingsButton = (Button)findViewById(R.id.plugin_settings);
settingsButton.setCompoundDrawablesWithIntrinsicBounds(
- getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_settings),
+ getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_settings),
null, null, null);
View installHeader = findViewById(R.id.plugin_install_header);
@@ -142,7 +142,7 @@ public class PluginActivity extends OsmandActionBarActivity {
settingsButton.setVisibility(View.GONE);
installHeader.setVisibility(View.VISIBLE);
View worldGlobeIcon = installHeader.findViewById(R.id.ic_world_globe);
- Drawable worldGlobeDrawable = getMyApplication().getIconsCache().getThemedIcon(
+ Drawable worldGlobeDrawable = getMyApplication().getUIUtilities().getThemedIcon(
R.drawable.ic_world_globe_dark);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
worldGlobeIcon.setBackground(worldGlobeDrawable);
diff --git a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
index 2adf4973d2..219c4145c4 100644
--- a/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/PluginsActivity.java
@@ -124,7 +124,7 @@ public class PluginsActivity extends OsmandListActivity {
ImageView pluginOptions = (ImageView) view.findViewById(R.id.plugin_options);
- pluginOptions.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
+ pluginOptions.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white));
pluginOptions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
index 9fc8c3867e..272dea98f7 100644
--- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java
@@ -1,6 +1,30 @@
package net.osmand.plus.activities;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import net.osmand.IProgress;
+import net.osmand.IndexConstants;
+import net.osmand.data.PointDescription;
+import net.osmand.osm.io.NetworkUtils;
+import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandSettings;
+import net.osmand.plus.OsmandSettings.DrivingRegion;
+import net.osmand.plus.OsmandSettings.MetricsConstants;
+import net.osmand.plus.R;
+import net.osmand.plus.Version;
+import net.osmand.plus.base.MapViewTrackingUtilities;
+import net.osmand.plus.dashboard.DashChooseAppDirFragment;
+import net.osmand.plus.dashboard.DashChooseAppDirFragment.ChooseAppDirFragment;
+import net.osmand.plus.dashboard.DashChooseAppDirFragment.MoveFilesToDifferentDirectory;
+import net.osmand.plus.dialogs.ConfigureMapMenu;
+import net.osmand.plus.download.DownloadActivity;
+import net.osmand.plus.render.NativeOsmandLibrary;
+import net.osmand.render.RenderingRulesStorage;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -31,32 +55,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
-import net.osmand.IProgress;
-import net.osmand.IndexConstants;
-import net.osmand.data.PointDescription;
-import net.osmand.osm.io.NetworkUtils;
-import net.osmand.plus.ApplicationMode;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandSettings;
-import net.osmand.plus.OsmandSettings.DrivingRegion;
-import net.osmand.plus.OsmandSettings.MetricsConstants;
-import net.osmand.plus.R;
-import net.osmand.plus.Version;
-import net.osmand.plus.base.MapViewTrackingUtilities;
-import net.osmand.plus.dashboard.DashChooseAppDirFragment;
-import net.osmand.plus.dashboard.DashChooseAppDirFragment.ChooseAppDirFragment;
-import net.osmand.plus.dashboard.DashChooseAppDirFragment.MoveFilesToDifferentDirectory;
-import net.osmand.plus.dialogs.ConfigureMapMenu;
-import net.osmand.plus.download.DownloadActivity;
-import net.osmand.plus.inapp.InAppPurchaseHelper;
-import net.osmand.plus.render.NativeOsmandLibrary;
-import net.osmand.render.RenderingRulesStorage;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
public class SettingsGeneralActivity extends SettingsBaseActivity implements OnRequestPermissionsResultCallback {
@@ -168,7 +166,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity implements OnR
public void onClick(DialogInterface dialog, int which) {
if (drs.get(which) == null) {
settings.DRIVING_REGION_AUTOMATIC.set(true);
- MapViewTrackingUtilities mapViewTrackingUtilities = MapActivity.getSingleMapViewTrackingUtilities();
+ MapViewTrackingUtilities mapViewTrackingUtilities = getMyApplication().getMapViewTrackingUtilities();
if (mapViewTrackingUtilities != null) {
mapViewTrackingUtilities.resetDrivingRegionUpdate();
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoDialogFragment.java b/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoDialogFragment.java
index abdb4839ce..4ba8569454 100644
--- a/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/ShowRouteInfoDialogFragment.java
@@ -46,7 +46,7 @@ import net.osmand.plus.GPXUtilities.TrkSegment;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayGroup;
import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem;
-import net.osmand.plus.IconsCache;
+import net.osmand.plus.UiUtilities;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
@@ -108,7 +108,7 @@ public class ShowRouteInfoDialogFragment extends DialogFragment {
view = inflater.inflate(R.layout.route_info_layout, container, false);
Toolbar toolbar = (Toolbar) view.findViewById(R.id.toolbar);
- toolbar.setNavigationIcon(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_arrow_back));
+ toolbar.setNavigationIcon(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_arrow_back));
toolbar.setNavigationContentDescription(R.string.shared_string_close);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
@@ -118,9 +118,9 @@ public class ShowRouteInfoDialogFragment extends DialogFragment {
});
((ImageView) view.findViewById(R.id.distance_icon))
- .setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_route_distance));
+ .setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_route_distance));
((ImageView) view.findViewById(R.id.time_icon))
- .setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_time_span));
+ .setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_time_span));
buildMenuButtons();
@@ -337,13 +337,13 @@ public class ShowRouteInfoDialogFragment extends DialogFragment {
((TextView) headerView.findViewById(R.id.ascent_text)).setText(asc);
((ImageView) headerView.findViewById(R.id.average_icon))
- .setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_altitude_average));
+ .setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_altitude_average));
((ImageView) headerView.findViewById(R.id.range_icon))
- .setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_altitude_average));
+ .setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_altitude_average));
((ImageView) headerView.findViewById(R.id.descent_icon))
- .setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_altitude_descent));
+ .setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_altitude_descent));
((ImageView) headerView.findViewById(R.id.ascent_icon))
- .setImageDrawable(app.getIconsCache().getThemedIcon(R.drawable.ic_action_altitude_ascent));
+ .setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_action_altitude_ascent));
headerView.findViewById(R.id.details_view).setOnClickListener(new View.OnClickListener() {
@Override
@@ -415,7 +415,7 @@ public class ShowRouteInfoDialogFragment extends DialogFragment {
}
private void buildMenuButtons() {
- IconsCache iconsCache = getMyApplication().getIconsCache();
+ UiUtilities iconsCache = getMyApplication().getUIUtilities();
ImageButton printRoute = (ImageButton) view.findViewById(R.id.print_route);
printRoute.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_gprint_dark));
printRoute.setOnClickListener(new View.OnClickListener() {
diff --git a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
index 47ebe3098d..dbc59ddadb 100644
--- a/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/actions/AppModeDialog.java
@@ -76,15 +76,15 @@ public class AppModeDialog {
ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);
boolean nightMode = isNightMode(ctx, useMapTheme);
if (checked) {
- iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), nightMode ? R.color.route_info_checked_mode_icon_color_dark : R.color.route_info_checked_mode_icon_color_light));
+ iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), nightMode ? R.color.route_info_checked_mode_icon_color_dark : R.color.route_info_checked_mode_icon_color_light));
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_checked)));
tb.findViewById(R.id.selection).setVisibility(View.VISIBLE);
} else {
if (useMapTheme) {
- iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), R.color.route_info_unchecked_mode_icon_color));
+ iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), R.color.route_info_unchecked_mode_icon_color));
iv.setBackgroundResource(AndroidUtils.resolveAttribute(ctx, android.R.attr.selectableItemBackground));
} else {
- iv.setImageDrawable(ctx.getIconsCache().getThemedIcon(mode.getSmallIconDark()));
+ iv.setImageDrawable(ctx.getUIUtilities().getThemedIcon(mode.getSmallIconDark()));
}
iv.setContentDescription(String.format("%s %s", mode.toHumanString(ctx), ctx.getString(R.string.item_unchecked)));
tb.findViewById(R.id.selection).setVisibility(View.INVISIBLE);
@@ -123,7 +123,7 @@ public class AppModeDialog {
int metricsY = (int) ctx.getResources().getDimension(R.dimen.route_info_modes_height);
View tb = layoutInflater.inflate(R.layout.mode_view, null);
ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);
- iv.setImageDrawable(ctx.getIconsCache().getIcon(mode.getSmallIconDark(), isNightMode(ctx, useMapTheme) ? R.color.route_info_checked_mode_icon_color_dark : R.color.route_info_checked_mode_icon_color_light));
+ iv.setImageDrawable(ctx.getUIUtilities().getIcon(mode.getSmallIconDark(), isNightMode(ctx, useMapTheme) ? R.color.route_info_checked_mode_icon_color_dark : R.color.route_info_checked_mode_icon_color_light));
iv.setContentDescription(mode.toHumanString(ctx));
// tb.setCompoundDrawablesWithIntrinsicBounds(null, ctx.getIconsCache().getIcon(mode.getIconId(), R.color.app_mode_icon_color), null, null);
LayoutParams lp = new LinearLayout.LayoutParams(metricsX, metricsY);
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java
index 479f88c1ec..1fe5410bf1 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java
@@ -179,7 +179,7 @@ public class SearchAddressFragment extends Fragment {
}
});
OsmandApplication app = getApplication();
- Drawable icon = getApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_remove_dark);
+ Drawable icon = getApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_remove_dark);
((ImageView)findViewById(R.id.ResetBuilding)).setBackgroundDrawable(icon);
findViewById(R.id.ResetBuilding).setOnClickListener(new View.OnClickListener(){
@Override
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java
index dd081e1dce..e3258b7c68 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchHistoryFragment.java
@@ -1,5 +1,22 @@
package net.osmand.plus.activities.search;
+import java.util.List;
+
+import net.osmand.data.LatLon;
+import net.osmand.data.PointDescription;
+import net.osmand.plus.OsmAndFormatter;
+import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandSettings;
+import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
+import net.osmand.plus.UiUtilities.UpdateLocationViewCache;
+import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
+import net.osmand.plus.base.OsmAndListFragment;
+import net.osmand.plus.helpers.SearchHistoryHelper;
+import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
+import net.osmand.util.MapUtils;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
@@ -24,24 +41,6 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.TextView.BufferType;
-import net.osmand.data.LatLon;
-import net.osmand.data.PointDescription;
-import net.osmand.plus.IconsCache;
-import net.osmand.plus.OsmAndFormatter;
-import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandSettings;
-import net.osmand.plus.R;
-import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
-import net.osmand.plus.base.OsmAndListFragment;
-import net.osmand.plus.dashboard.DashLocationFragment;
-import net.osmand.plus.helpers.SearchHistoryHelper;
-import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
-import net.osmand.util.MapUtils;
-
-import java.util.List;
-
public class SearchHistoryFragment extends OsmAndListFragment implements SearchActivityChild, OsmAndCompassListener {
private LatLon location;
@@ -51,9 +50,9 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
public static final String SEARCH_LON = SearchActivity.SEARCH_LON;
private HistoryAdapter historyAdapter;
private Float heading;
- private boolean searchAroundLocation;
private boolean compassRegistered;
- private int screenOrientation;
+ private UpdateLocationViewCache updateLocationViewCache;
+ private double lastHeading;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
@@ -125,19 +124,18 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
//Hardy: onResume() code is needed so that search origin is properly reflected in tab contents when origin has been changed on one tab, then tab is changed to another one.
location = null;
FragmentActivity activity = getActivity();
+ updateLocationViewCache = getMyApplication().getUIUtilities().getUpdateLocationViewCache();
Intent intent = activity.getIntent();
if (intent != null) {
double lat = intent.getDoubleExtra(SEARCH_LAT, 0);
double lon = intent.getDoubleExtra(SEARCH_LON, 0);
if (lat != 0 || lon != 0) {
- historyAdapter.location = new LatLon(lat, lon);
+ updateLocationViewCache.specialFrom = new LatLon(lat, lon);
+
}
}
- if (location == null && activity instanceof SearchActivity) {
- location = ((SearchActivity) activity).getSearchPoint();
- }
- if (location == null) {
- location = ((OsmandApplication) activity.getApplication()).getSettings().getLastKnownMapLocation();
+ if (activity instanceof SearchActivity && ((SearchActivity) activity).getSearchPoint() != null) {
+ updateLocationViewCache.specialFrom = ((SearchActivity) activity).getSearchPoint();
}
historyAdapter.clear();
for (HistoryEntry entry : helper.getHistoryEntries()) {
@@ -145,12 +143,11 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
}
locationUpdate(location);
clearButton.setVisibility(historyAdapter.isEmpty() ? View.GONE : View.VISIBLE);
- screenOrientation = DashLocationFragment.getScreenOrientation(getActivity());
+
}
@Override
public void locationUpdate(LatLon l) {
- //location = l;
if (getActivity() instanceof SearchActivity) {
if (((SearchActivity) getActivity()).isSearchAroundCurrentLocation() && l != null) {
if (!compassRegistered) {
@@ -159,13 +156,13 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
app.getLocationProvider().addCompassListener(this);
compassRegistered = true;
}
- searchAroundLocation = true;
+ updateLocationViewCache.specialFrom = null;
} else {
- searchAroundLocation = false;
+ updateLocationViewCache.specialFrom = ((SearchActivity) getActivity()).getSearchPoint();
}
}
if (historyAdapter != null) {
- historyAdapter.updateLocation(l);
+ historyAdapter.updateLocation();
}
}
@@ -205,7 +202,7 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
MenuItem item = optionsMenu.getMenu().add(
R.string.shared_string_remove).setIcon(
- getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_delete_dark));
+ getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_delete_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
@@ -218,11 +215,9 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
}
class HistoryAdapter extends ArrayAdapter {
- private LatLon location;
- public void updateLocation(LatLon l) {
- location = l;
+ public void updateLocation() {
notifyDataSetChanged();
}
@@ -241,10 +236,11 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
udpateHistoryItem(historyEntry, row, location, getActivity(), getMyApplication());
TextView distanceText = (TextView) row.findViewById(R.id.distance);
ImageView direction = (ImageView) row.findViewById(R.id.direction);
- DashLocationFragment.updateLocationView(!searchAroundLocation, location, heading, direction, distanceText,
- historyEntry.getLat(), historyEntry.getLon(), screenOrientation, getMyApplication());
+ getMyApplication().getUIUtilities().updateLocationView(updateLocationViewCache,
+ direction, distanceText, historyEntry.getLat(),
+ historyEntry.getLon());
ImageButton options = (ImageButton) row.findViewById(R.id.options);
- options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
+ options.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setVisibility(View.VISIBLE);
options.setOnClickListener(new View.OnClickListener() {
@Override
@@ -264,7 +260,7 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
TextView nameText = (TextView) row.findViewById(R.id.name);
TextView distanceText = (TextView) row.findViewById(R.id.distance);
ImageView direction = (ImageView) row.findViewById(R.id.direction);
- IconsCache ic = app.getIconsCache();
+ UiUtilities ic = app.getUIUtilities();
direction.setImageDrawable(ic.getIcon(R.drawable.ic_direction_arrow, R.color.color_distance));
String distance = "";
if (location != null) {
@@ -326,12 +322,9 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
@Override
public void updateCompassValue(float value) {
- // 99 in next line used to one-time initalize arrows (with reference vs. fixed-north direction) on non-compass
- // devices
FragmentActivity activity = getActivity();
- float lastHeading = heading != null ? heading : 99;
- heading = value;
- if (heading != null && Math.abs(MapUtils.degreesDiff(lastHeading, heading)) > 5) {
+ if (Math.abs(MapUtils.degreesDiff(lastHeading, value)) > 5) {
+ lastHeading = value;
if (activity instanceof SearchActivity) {
((SearchActivity)activity).getAccessibilityAssistant().lockEvents();
historyAdapter.notifyDataSetChanged();
@@ -339,8 +332,6 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
} else {
historyAdapter.notifyDataSetChanged();
}
- } else {
- heading = lastHeading;
}
if (activity instanceof SearchActivity) {
final View selected = ((SearchActivity)activity).getAccessibilityAssistant().getFocusedView();
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java
index dcc5abf3f9..22e38384a9 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java
@@ -3,6 +3,46 @@
*/
package net.osmand.plus.activities.search;
+import gnu.trove.set.hash.TLongHashSet;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import net.osmand.Location;
+import net.osmand.ResultMatcher;
+import net.osmand.access.AccessibilityAssistant;
+import net.osmand.access.NavigationInfo;
+import net.osmand.data.Amenity;
+import net.osmand.data.LatLon;
+import net.osmand.data.PointDescription;
+import net.osmand.osm.PoiType;
+import net.osmand.plus.OsmAndFormatter;
+import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
+import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.OsmandSettings;
+import net.osmand.plus.R;
+import net.osmand.plus.R.color;
+import net.osmand.plus.UiUtilities;
+import net.osmand.plus.UiUtilities.UpdateLocationViewCache;
+import net.osmand.plus.activities.EditPOIFilterActivity;
+import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.activities.OsmandListActivity;
+import net.osmand.plus.poi.NominatimPoiFilter;
+import net.osmand.plus.poi.PoiUIFilter;
+import net.osmand.plus.poi.PoiUIFilter.AmenityNameFilter;
+import net.osmand.plus.render.RenderingIcons;
+import net.osmand.plus.views.DirectionDrawable;
+import net.osmand.util.Algorithms;
+import net.osmand.util.MapUtils;
+import net.osmand.util.OpeningHoursParser;
+import net.osmand.util.OpeningHoursParser.OpeningHours;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -36,47 +76,6 @@ import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
-import net.osmand.Location;
-import net.osmand.ResultMatcher;
-import net.osmand.access.AccessibilityAssistant;
-import net.osmand.access.NavigationInfo;
-import net.osmand.data.Amenity;
-import net.osmand.data.LatLon;
-import net.osmand.data.PointDescription;
-import net.osmand.osm.PoiType;
-import net.osmand.plus.IconsCache;
-import net.osmand.plus.OsmAndFormatter;
-import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
-import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandSettings;
-import net.osmand.plus.R;
-import net.osmand.plus.R.color;
-import net.osmand.plus.activities.EditPOIFilterActivity;
-import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.activities.OsmandListActivity;
-import net.osmand.plus.dashboard.DashLocationFragment;
-import net.osmand.plus.poi.NominatimPoiFilter;
-import net.osmand.plus.poi.PoiUIFilter;
-import net.osmand.plus.poi.PoiUIFilter.AmenityNameFilter;
-import net.osmand.plus.render.RenderingIcons;
-import net.osmand.plus.views.DirectionDrawable;
-import net.osmand.util.Algorithms;
-import net.osmand.util.MapUtils;
-import net.osmand.util.OpeningHoursParser;
-import net.osmand.util.OpeningHoursParser.OpeningHours;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import gnu.trove.set.hash.TLongHashSet;
-
/**
* Search poi activity
*/
@@ -133,7 +132,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
});
showFilterItem = menu.add(0, FILTER, 0, R.string.search_poi_filter);
MenuItemCompat.setShowAsAction(showFilterItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
- showFilterItem = showFilterItem.setIcon(getMyApplication().getIconsCache().getIcon(
+ showFilterItem = showFilterItem.setIcon(getMyApplication().getUIUtilities().getIcon(
R.drawable.ic_action_filter_dark));
showFilterItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
@@ -156,7 +155,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
showOnMapItem = menu.add(0, SHOW_ON_MAP, 0, R.string.shared_string_show_on_map);
MenuItemCompat.setShowAsAction(showOnMapItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
- showOnMapItem = showOnMapItem.setIcon(getMyApplication().getIconsCache().getIcon(
+ showOnMapItem = showOnMapItem.setIcon(getMyApplication().getUIUtilities().getIcon(
R.drawable.ic_show_on_map));
showOnMapItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
@@ -264,9 +263,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
});
searchFilter.setHint(R.string.filter_poi_hint);
((ImageView) findViewById(R.id.search_icon)).setImageDrawable(
- getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_filter_dark));
+ getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_filter_dark));
((ImageView) findViewById(R.id.options)).
- setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
+ setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white));
findViewById(R.id.options).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -346,7 +345,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
private void showOptionsMenu(View v) {
// Show menu with search all, name finder, name finder poi
- IconsCache iconsCache = getMyApplication().getIconsCache();
+ UiUtilities iconsCache = getMyApplication().getUIUtilities();
final PopupMenu optionsMenu = new PopupMenu(this, v);
final PoiUIFilter f = this.filter;
@@ -380,7 +379,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
}
private void addFilter(PopupMenu optionsMenu, final String value) {
- IconsCache iconsCache = getMyApplication().getIconsCache();
+ UiUtilities iconsCache = getMyApplication().getUIUtilities();
MenuItem item = optionsMenu.getMenu().add(getString(R.string.search_poi_filter) + ": " + value)
.setIcon(iconsCache.getThemedIcon(R.drawable.ic_action_filter_dark));
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@@ -557,7 +556,8 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
try {
int position = getListView().getPositionForView(selected);
if ((position != AdapterView.INVALID_POSITION) && (position >= getListView().getHeaderViewsCount())) {
- navigationInfo.updateTargetDirection(amenityAdapter.getItem(position - getListView().getHeaderViewsCount()).getLocation(), heading.floatValue());
+ navigationInfo.updateTargetDirection(amenityAdapter.getItem(position - getListView().getHeaderViewsCount()).
+ getLocation(), heading.floatValue());
}
} catch (Exception e) {
return;
@@ -717,10 +717,11 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
class AmenityAdapter extends ArrayAdapter {
private AmenityFilter listFilter;
private List originalAmenityList;
- private int screenOrientation;
+ private UpdateLocationViewCache updateLocationViewCache;
AmenityAdapter(List list) {
super(SearchPOIActivity.this, R.layout.searchpoi_list, list);
+ updateLocationViewCache = getMyApplication().getUIUtilities().getUpdateLocationViewCache();
originalAmenityList = new ArrayList(list);
this.setNotifyOnChange(false);
}
@@ -731,7 +732,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
public void setNewModel(List amenityList) {
setNotifyOnChange(false);
- screenOrientation = DashLocationFragment.getScreenOrientation(SearchPOIActivity.this);
+ updateLocationViewCache = getMyApplication().getUIUtilities().getUpdateLocationViewCache();
originalAmenityList = new ArrayList(amenityList);
clear();
for (Amenity obj : amenityList) {
@@ -768,7 +769,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
timeIcon.setVisibility(View.VISIBLE);
timeText.setVisibility(View.VISIBLE);
- timeIcon.setImageDrawable(app.getIconsCache().getIcon(R.drawable.ic_small_time, colorId));
+ timeIcon.setImageDrawable(app.getUIUtilities().getIcon(R.drawable.ic_small_time, colorId));
timeText.setTextColor(app.getResources().getColor(colorId));
String rt = rs.getCurrentRuleTime(inst);
timeText.setText(rt == null ? "" : rt);
@@ -790,19 +791,12 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
direction.setImageDrawable(draw);
}
net.osmand.Location loc = location;
- if (loc != null) {
- mes = new float[2];
- LatLon l = amenity.getLocation();
- net.osmand.Location.distanceBetween(l.getLatitude(), l.getLongitude(), loc.getLatitude(),
- loc.getLongitude(), mes);
+ if(searchNearBy) {
+ updateLocationViewCache.specialFrom = null;
+ } else if(loc != null) {
+ updateLocationViewCache.specialFrom = new LatLon(loc.getLatitude(), loc.getLongitude());
}
- if (loc != null) {
- float a = heading != null ? heading : 0;
- draw.setAngle(mes[1] - a + 180 + screenOrientation);
- } else {
- draw.setAngle(0);
- }
- draw.setColorId(searchNearBy ? color.color_myloc_distance : color.color_distance);
+ getMyApplication().getUIUtilities().updateLocationView(updateLocationViewCache, direction, distanceText, amenity.getLocation());
direction.setImageDrawable(draw);
PoiType st = amenity.getType().getPoiTypeByKeyName(amenity.getSubType());
if (st != null) {
@@ -817,15 +811,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
icon.setImageDrawable(null);
}
- String distance = " ";
- if (mes != null) {
- distance = " " + OsmAndFormatter.getFormattedDistance((int) mes[0], getMyApplication()) + " "; //$NON-NLS-1$
- }
String poiType = OsmAndFormatter.getPoiStringWithoutType(amenity,
app.getSettings().MAP_PREFERRED_LOCALE.get(),
app.getSettings().MAP_TRANSLITERATE_NAMES.get());
label.setText(poiType);
- distanceText.setText(distance);
ViewCompat.setAccessibilityDelegate(row, accessibilityAssistant);
return (row);
}
diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java
index cc55f1a2f5..15b4791da6 100644
--- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java
+++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterFragment.java
@@ -30,7 +30,7 @@ import net.osmand.CollatorStringMatcher.StringMatcherMode;
import net.osmand.data.LatLon;
import net.osmand.osm.AbstractPoiType;
import net.osmand.osm.PoiType;
-import net.osmand.plus.IconsCache;
+import net.osmand.plus.UiUtilities;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
@@ -67,7 +67,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
v.findViewById(R.id.SearchFilterLayout).setVisibility(View.VISIBLE);
((EditText) v.findViewById(R.id.searchEditText)).setHint(R.string.search_poi_category_hint);
((ImageView) v.findViewById(R.id.search_icon)).setImageDrawable(
- getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_search_dark));
+ getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_action_search_dark));
setupSearchEditText((EditText) v.findViewById(R.id.searchEditText));
setupOptions((ImageView) v.findViewById(R.id.options));
@@ -76,7 +76,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
}
private void setupOptions(ImageView options) {
- options.setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
+ options.setImageDrawable(getMyApplication().getUIUtilities().getThemedIcon(R.drawable.ic_overflow_menu_white));
options.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -326,7 +326,7 @@ public class SearchPoiFilterFragment extends OsmAndListFragment implements Searc
private void showOptionsMenu(View v) {
// Show menu with search all, name finder, name finder poi
- IconsCache iconsCache = getMyApplication().getIconsCache();
+ UiUtilities iconsCache = getMyApplication().getUIUtilities();
final PopupMenu optionsMenu = new PopupMenu(getActivity(), v);
MenuItem item = optionsMenu.getMenu().add(R.string.poi_filter_custom_filter)
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java
index 0386a0dc72..71d0d85a27 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNoteRecordingMenu.java
@@ -10,7 +10,7 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import net.osmand.AndroidUtils;
-import net.osmand.plus.IconsCache;
+import net.osmand.plus.UiUtilities;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.audionotes.AudioVideoNotesPlugin.AVActionType;
@@ -124,7 +124,7 @@ public class AudioVideoNoteRecordingMenu {
public void update() {
CurrentRecording recording = plugin.getCurrentRecording();
- IconsCache iconsCache = plugin.getMapActivity().getMyApplication().getIconsCache();
+ UiUtilities iconsCache = plugin.getMapActivity().getMyApplication().getUIUtilities();
ImageView leftButtonIcon = (ImageView) view.findViewById(R.id.leftButtonIcon);
View leftButtonView = view.findViewById(R.id.leftButtonView);
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/DashAudioVideoNotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/DashAudioVideoNotesFragment.java
index c1248da2a0..4ae2e79cfc 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/DashAudioVideoNotesFragment.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/DashAudioVideoNotesFragment.java
@@ -94,7 +94,7 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
View view = inflater.inflate(R.layout.note, null, false);
getNoteView(recording, view, getMyApplication());
- ((ImageView) view.findViewById(R.id.play)).setImageDrawable(getMyApplication().getIconsCache()
+ ((ImageView) view.findViewById(R.id.play)).setImageDrawable(getMyApplication().getUIUtilities()
.getThemedIcon(R.drawable.ic_play_dark));
view.findViewById(R.id.play).setOnClickListener(new View.OnClickListener() {
@Override
@@ -146,11 +146,11 @@ public class DashAudioVideoNotesFragment extends DashBaseFragment {
Drawable iconDrawable;
if (recording.isAudio()) {
- iconDrawable = ctx.getIconsCache().getIcon(R.drawable.ic_type_audio, R.color.color_distance);
+ iconDrawable = ctx.getUIUtilities().getIcon(R.drawable.ic_type_audio, R.color.color_distance);
} else if (recording.isVideo()) {
- iconDrawable = ctx.getIconsCache().getIcon(R.drawable.ic_type_video, R.color.color_distance);
+ iconDrawable = ctx.getUIUtilities().getIcon(R.drawable.ic_type_video, R.color.color_distance);
} else {
- iconDrawable = ctx.getIconsCache().getIcon(R.drawable.ic_type_img, R.color.color_distance);
+ iconDrawable = ctx.getUIUtilities().getIcon(R.drawable.ic_type_img, R.color.color_distance);
}
icon.setImageDrawable(iconDrawable);
return iconDrawable;
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/adapters/NotesAdapter.java b/OsmAnd/src/net/osmand/plus/audionotes/adapters/NotesAdapter.java
index 1fe1548665..99660a24c1 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/adapters/NotesAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/adapters/NotesAdapter.java
@@ -212,7 +212,7 @@ public class NotesAdapter extends ArrayAdapter