From 4407c85018ddf4f8184361e23ffb64f6f89bec27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20B=C3=A1thory?= Date: Mon, 20 Oct 2014 14:15:04 +0200 Subject: [PATCH 01/26] Translated using Weblate (Hungarian) Currently translated at 99.8% (1535 of 1538 strings) --- OsmAnd/res/values-hu/strings.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index a454b2bd6a..1b4aa04de9 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -1782,4 +1782,9 @@ Válaszd ki, mekkora sebességtúllépésnél szeretnél figyelmeztetést hallani. A kedvenc hely neve módosítva lett erre: %1$s, lehetővé téve a hangulatjeleket tartalmazó szöveg fájlba mentését. Útvonal nyomtatása - + Eszköz nem található + Az OsMo szolgáltatás nem elérhető:\n- ellenőrizd az internetkapcsolatot;\n- ellenőrizd a beállításokat;\n- nézz rá a Twitterünkre: https://twitter.com/OsMomobi + Egy anonim felhasználó nem tud:\n- csoportot létrehozni;\n- csoportokat és eszközöket szinkronizálni a szerverrel;\n- csoportokat és eszközöket kezelni privát módon. + Anonim felhasználó + Bejelentkezve mint %1$s + From d3fa9c104e938eceac24e43bb4f64944f72e9f93 Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Mon, 20 Oct 2014 16:29:13 +0200 Subject: [PATCH 02/26] Translated using Weblate (Italian) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-it/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 0f0aa39bd2..fd4aada324 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -163,7 +163,7 @@ Esiste già un file con lo stesso nome. Salva Salva direzioni - Invio dei file GPX alla comunità OSM. Lo utilizzeranno per migliorare le mappe. + Invio dei file GPX alla comunità OSM. Verranno utilizzati per migliorare le mappe. Oggetto(i) %1$d di %2$d caricato(i) correttamente. Invia ad OSM Visualizza più dettagli mappa From c735a2284f3520274a13dcc12c288eef13c8be8b Mon Sep 17 00:00:00 2001 From: Viktar Palstsiuk Date: Mon, 20 Oct 2014 19:24:23 +0200 Subject: [PATCH 03/26] Translated using Weblate (Belarusian) Currently translated at 100.0% (1540 of 1540 strings) --- OsmAnd/res/values-be/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml index 5c5299b68d..50b3fb0768 100644 --- a/OsmAnd/res/values-be/strings.xml +++ b/OsmAnd/res/values-be/strings.xml @@ -1980,4 +1980,6 @@ OsmAnd мае адкрыты зыходны код і актыўна разві Сэрвіс OsMo не даступны:\n- Праверце злучэньне;\n- Праверце налады;\n- Праверце наш Twitter: https://twitter.com/OsMomobi Ананімнаму карыстальніку недаступна:\n- Стварэньне групаў;\n- Сінхранізацыя групаў і прыстасаваньняў з серверам;\n- Кіраваньне групамі і прыстасаваньнямі ў асабістым кабінеце. Пачаць працу з натыўнай візуалізацыяй + Настройка мапы + Паблізу ад From 65a25c52f6c4db20edfe7ac65a8bd4861e452232 Mon Sep 17 00:00:00 2001 From: jan madsen Date: Mon, 20 Oct 2014 20:21:56 +0200 Subject: [PATCH 04/26] Translated using Weblate (Danish) Currently translated at 100.0% (1540 of 1540 strings) --- OsmAnd/res/values-da/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 8e1951a8a9..699f729003 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1840,4 +1840,6 @@ Nogle af de centrale funktioner: En anonym bruger kan ikke:\n- oprette grupper;\n- synkronisere grupper og enheder med serveren;\n- administrere grupper og enheder i et privat kontor. Anonym bruger Logget ind som %1$s - + Konfigurer kort + I nærheden af + From f4ea12a89f49d1a05191d7e61bcf0ca74c8568d8 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Mon, 20 Oct 2014 20:41:37 +0200 Subject: [PATCH 05/26] Revert "Map preference and waypoint dialog moved to drawer menu." --- .../res/drawable-hdpi/ic_back_drawer_dark.png | Bin 1270 -> 0 bytes .../drawable-hdpi/ic_back_drawer_white.png | Bin 1270 -> 0 bytes .../drawable-hdpi/ic_sort_waypoint_dark.png | Bin 1204 -> 0 bytes .../drawable-hdpi/ic_sort_waypoint_white.png | Bin 1204 -> 0 bytes .../res/drawable-mdpi/ic_back_drawer_dark.png | Bin 1160 -> 0 bytes .../drawable-mdpi/ic_back_drawer_white.png | Bin 1160 -> 0 bytes .../drawable-xhdpi/ic_back_drawer_dark.png | Bin 1273 -> 0 bytes .../drawable-xhdpi/ic_back_drawer_white.png | Bin 1271 -> 0 bytes .../drawable-xhdpi/ic_sort_waypoint_dark.png | Bin 1344 -> 0 bytes .../drawable-xhdpi/ic_sort_waypoint_white.png | Bin 1350 -> 0 bytes .../drawable-xxhdpi/ic_back_drawer_dark.png | Bin 1361 -> 0 bytes .../drawable-xxhdpi/ic_back_drawer_white.png | Bin 1361 -> 0 bytes .../drawable-xxhdpi/ic_sort_waypoint_dark.png | Bin 1459 -> 0 bytes .../ic_sort_waypoint_white.png | Bin 1460 -> 0 bytes OsmAnd/res/layout/map_settings_item.xml | 47 -- .../res/layout/radius_search_list_element.xml | 34 -- OsmAnd/res/layout/waypoint_header.xml | 24 +- OsmAnd/res/values/strings.xml | 2 - .../net/osmand/plus/ContextMenuAdapter.java | 4 +- .../plus/activities/AvailableGPXFragment.java | 6 +- .../activities/FavouritesTreeFragment.java | 6 +- .../osmand/plus/activities/MapActivity.java | 7 +- .../plus/activities/MapActivityActions.java | 108 ++-- .../plus/activities/MapActivityLayers.java | 6 +- .../plus/activities/SelectedGPXFragment.java | 3 +- .../plus/activities/SettingsBaseActivity.java | 27 +- .../activities/search/SearchPOIActivity.java | 8 +- .../plus/audionotes/AudioNotesLayer.java | 3 +- .../audionotes/AudioVideoNotesPlugin.java | 19 +- .../configuremap/ConfigureSettingsMenu.java | 527 ------------------ .../DistanceCalculatorPlugin.java | 3 +- .../plus/download/LocalIndexesFragment.java | 6 +- .../net/osmand/plus/helpers/GpxUiHelper.java | 13 +- .../plus/helpers/WaypointDialogHelper.java | 450 ++++++--------- .../osmand/plus/helpers/WaypointHelper.java | 32 +- .../monitoring/OsmandMonitoringPlugin.java | 6 +- .../net/osmand/plus/osmedit/OsmBugsLayer.java | 3 +- .../osmand/plus/osmedit/OsmEditingPlugin.java | 12 +- .../src/net/osmand/plus/osmo/OsMoPlugin.java | 15 +- .../parkingpoint/ParkingPositionPlugin.java | 9 +- .../rastermaps/OsmandRasterMapsPlugin.java | 6 +- .../RoutePointsLayer.java | 3 +- .../plus/sherpafy/SherpafyCustomization.java | 18 +- .../osmand/plus/srtmplugin/SRTMPlugin.java | 3 +- .../net/osmand/plus/views/FavoritesLayer.java | 3 +- .../osmand/plus/views/MapControlsLayer.java | 12 +- .../net/osmand/plus/views/POIMapLayer.java | 3 +- .../plus/views/PointNavigationLayer.java | 3 +- .../plus/views/TransportStopsLayer.java | 3 +- 49 files changed, 312 insertions(+), 1122 deletions(-) delete mode 100644 OsmAnd/res/drawable-hdpi/ic_back_drawer_dark.png delete mode 100644 OsmAnd/res/drawable-hdpi/ic_back_drawer_white.png delete mode 100644 OsmAnd/res/drawable-hdpi/ic_sort_waypoint_dark.png delete mode 100644 OsmAnd/res/drawable-hdpi/ic_sort_waypoint_white.png delete mode 100644 OsmAnd/res/drawable-mdpi/ic_back_drawer_dark.png delete mode 100644 OsmAnd/res/drawable-mdpi/ic_back_drawer_white.png delete mode 100644 OsmAnd/res/drawable-xhdpi/ic_back_drawer_dark.png delete mode 100644 OsmAnd/res/drawable-xhdpi/ic_back_drawer_white.png delete mode 100644 OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_dark.png delete mode 100644 OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_white.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/ic_back_drawer_dark.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/ic_back_drawer_white.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_dark.png delete mode 100644 OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_white.png delete mode 100644 OsmAnd/res/layout/map_settings_item.xml delete mode 100644 OsmAnd/res/layout/radius_search_list_element.xml delete mode 100644 OsmAnd/src/net/osmand/plus/configuremap/ConfigureSettingsMenu.java diff --git a/OsmAnd/res/drawable-hdpi/ic_back_drawer_dark.png b/OsmAnd/res/drawable-hdpi/ic_back_drawer_dark.png deleted file mode 100644 index bc26173a816fbd1471adb81da80411821e2432cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1270 zcmbVMZD<>196#4~Erm#zcAKq8&#TKU^Ky5&OLBK4%iA?;w8=siZ1zF6%iWXaXzsyj2>X_1+M;tFF*i$W=L$RJEqoC=OfoC-2uzBu+t%D^v9Klw$}`COV*Ka_p&;O=?; z&-45J-~V?$n>pqh92-Os#Fd&Ba&X=6yaRjT_uYe+FTrKho+{WU^paf_O@PE?y$H~h zD$ao%5aq=ezXl-$={ck13w9wr!%MpA6&;MXrW%lqAfZUj5T$uwqeU>MXkqNPPj6tT zB8RbAf0|4i2~bw1mrQVCDU+9$<|R(XB1h3sjfVBS;_N^WhMITZ@`4)^N?5=xPvvC7Ft0E4qd{ z8pWc%V23g2>2?UJkxuU@)~rsVV9JP^Xb_Z_BvjRjtBtno9QfCbUC~y4(EvmaSo(q~ z!FrS?x@4HUhZ}N$&>Q}^slcL$6+xF4RG`@@A&kKrudK*?krtUEC`ovb1`JM<41;sP zN8_yI19ZU0$TA!3>e-E-q=O6-XF0z=8KkHwhKOxsZlz*NovIce%D z+Riht?BWB-1}MN312~{$KkhFvKAa6wGER#{juS~zBw2uU`11eF9|4^roM!n?^K_43 zM>^Y`QGmkEFaZrtkO@a+B$m03AdehK39)?bZt>3t4g0fUMn1Ie)Z(7Z1&#FO*ePH_0)b( zXjOXE^L(8!8`K9wubq9o5!|=_oH2U$^;@%j#Z%9^-s)@p{9Vhlhw49c?(e>>3Yzq) zBg@xU+=196$TAmP#aRyUkWc&#TKU^K!4r<&I>{%Qb7<(uFM8?1OCg@}xPMd-3kN zq*bsjGE-1o-I&s%&=1=XAtijb|Ko~(f&uF>4n@=AT6jS$04UE5{Tab+);qi(kDYL*uWiX=|5$xAbKEqH= zjbPJ(G?}&%pr}nQ*xAt@H+cs~^gay<70N<*0-Lj+CYBrgOQfuzyagF$PyS`e~g zvSkZO5v=ICmOv2Ya@k*I{H8raP(05QBu&sX4iUIBZ@5wgH=NP71`#-lty!*S8fZhK zB%5dLKkr^fx2V zelYTJ+_!5pc5rQJd@(e#9+y4uBb#09yAPqC90V|o{xU+>>s)PSL(v>pTpI+zpX#F_`^B`o%VT8MF-Yj zAik?ogM-@1;_BtDI=Jv~U&r;O%I>xNf!gHgC1LD~er@2Lv94Yc*?*Vv_1t*%eB)1) MnwS!6@zcxy0K=Z1mjD0& diff --git a/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_dark.png b/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_dark.png deleted file mode 100644 index b4b0f6f746b777f0fedc0efb599d066cef216acd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1204 zcmbVMU1%It6rOHqD5+^9l!ms{UM3PP&HU}o?EEy_{OoMZq8sC8A)%sne(q+c$;_S3 z+;le~Xy`+!G*BC?lp;kewb+L~C`zG%5EryhLaU%6RVoEvN(~|rqoj8>yQvSM4;`4f z_uPBF^Yfi^=I!C37g}3(w@?(-njO^hWPK)jw=|RQLH^o@WZ8u?V|WA=aoGqU)n_9U zf~;$d!#p(X>0>uxH$^oacM4;8EccRTA(u5G9k$~71Wi%hJr&=uCLjhT9Cy4F{ouxz zG;r(`Ju2n+oS%jzXK*HfBQrw>I$H%#NoFN)aIPGDh!gygv!-5V&D{y@5AP+9gAkQ5^>HtcMK7ZgEAi>fS%iYN#fv0ut0R5=-!WL@s#^-Kes^+IfT7Hs%-i0?W! z`B?_N6wwqJD5(icEGo&OWzu!L{iOVHBq%Owmj5+RJp4=4c_||;yzm?_Nw`SYH>)WcU zb4u*ga>vTweB0`CPw(qo%#VUQTdH(#S9A5%xgXBn`k?qMc+gzkGk1P#c7E%R!A|h` z<=~GKU9WBb?Dstj_kMY&Yx$$h-NW9lmn(!VWOMqaBEY-(P}%{rc(o_Y1jWEmsB(b-ufJ=Ez9;Ou;>P z;rhwhtDOhV-Cq1!Klj`GrPhC5IqhtwVoy<@{QSn*p1XU$i2ftl%#ePq|Hz4l%8HNW diff --git a/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_white.png b/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_white.png deleted file mode 100644 index d255baea1c03bd21200d6da82ba986ab56e68940..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1204 zcmbVMU1%It6rOI=ppj~{P_Tt$I+0>vXJ=-2X6Gkalg-RFS#XoEUFf!z+WEPgohCDP zGIP_NgtnxbN`pQ$21KMU3I#3NhY|!4^r0(Og!;0g2o?+qVuj#CF%N}!XR{l92z_v1 z=H7Gf`OeRG&Y9)O@zMQVhq?%Y*q%umw*AReNl~2geu2OXk9~DO=RgOXOgvU;_?7IvF}MZlHu2s%clj`{2ijY#+B-wf>?9I0- zN>Mx3@`a@gRYk~C7^YUMC2FYz^rsk3mSu)bGRY*3HRxd8MS4iPL0{W~1_IN!J!C_d zj4bK~oI@E3N4lMY;}r@!hTWh=6sC*`b&uf^EaNy)UQO))6~Vt@?5Z7<<~_g^K>+7` z6W62C*9K$m9`7hp#L*}dzKx5b&uGw`bAXHTT86?m3Cp$=05Ewx%hQ}Bi*!ZcMOtEc zo;Jjk0RSgRdXjJ3*$vN09H;W~h`>uc$L07DA(xWHbW#vCG0SSXHa71DNOw)p_HAR| zEo}C&SVi@Lj-X$HaHib_lU0adP=y|;s?DmCFP^Yn3)X`Es7%{gYrwb91M8R%9kR)@ zV($_|N=zFSQ?lrkZUWlmc$t=XgQtNYr%b*gr7NaEweZ&e<&VKZF;TPpr+L~(xFe(O z&M07EXPAJCC&mx<_4cE~Z~u0GZS0jdSK<#xp8H$9ec?$uet%zmV)4fVSD&GlH})B? zl9#&b11GCzXX8DeT^x?94@!mA*wV^+Y^n33g|&}+E*xB4z1cthOXKd>OU2D+XU_e; za?=?-@WZu<@2wmDsm*sk^smpZWrxmjpAf@~dx$Uk&%A!+`ooUsKa$UlYqv(uzV;6V C5{}UT diff --git a/OsmAnd/res/drawable-mdpi/ic_back_drawer_dark.png b/OsmAnd/res/drawable-mdpi/ic_back_drawer_dark.png deleted file mode 100644 index 19a15264e6b8e25893c11db1755948c6253b5a28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1160 zcmbVMTWHi+7>-sJt#&B|b?vTeOkZ3ylY24=ovocr#~J9OirC? zLG~gGx}c!=>Rv=qPz3iu3nKMF3WBUu#OsUf`Y0^*!G+z`?#Xnf`cQl@keu_M^MC*U z{kI$)9@^8<-rY`7R7XCSDU$W$_+9%E`EJXx^JLkA2g-N^Rd5Z2km`4k1?jv8#$XWw zXX?Oh*h^7u2i;N`mkWc2jl2YibrN+iAZUu}?W+gC9*3B=;F#;Dn7^*iGPLWYm{Fy` z7XlMj-Q08tN2Z5L_Vl=|J51k~bZ^}t20VxXUH2yZ$f&27hFyc~<71AY8!C7_#VnC3 z7lvsQg^*SfDr@tCOlx{VP*hFVcF`h{IX=mWJj?5bA{o3$Hy?(03!REl%w(Ish?HWg z7zYN&)oQgwO-i6}j1zQS=XjA5MV4r=(Ugxto%N%hmW2$A?9dIci+nn^2rM*-Qw(9c z6oMBN3d@H5sF^5|GOi8+PDt>a=f!a~v?E-EZ)vQk9hIg6$Q5CPCPSOlqtep?lia=E zQLISV7<)sP6a`FVkUi-^ALlbEhTJ3^*D)*!$QG>FtR_L3m3UcZbtp<~(iWklin8M* zwU(Wg@Yw+~si$R4QL>sK49IDPPo@<~HC0~Ic+G5K^L~VZZ^M>vm-udC)%RizGlT%6 zu!PV=s|$v!2&1Tq0@^eiRi}51y1s*I(HC)QAiy78m>4#7DE=^obAGAGwx({PeS}TW^4_!3{I3c6R=qemwi# z%qRQ0ex4hoAAI}U`L=})OKxvFkUI5x(~(c-H$J=fh`N=|y{O%)-e3L4h8_QQciz2O z5!GXdcHdbIH?LaQW+@_bW%18;eWLq>*MIf&FLM`jZ|-GZa`V6b^Z8LWcPaaP#ymc9 yrue&j_WsEqPW`y{>ow=@cAdpf5ARynxt|*PY5SJ)LeH!C-;f^|%3MzG|Neg|WP4Qr diff --git a/OsmAnd/res/drawable-mdpi/ic_back_drawer_white.png b/OsmAnd/res/drawable-mdpi/ic_back_drawer_white.png deleted file mode 100644 index 0ea5a84f6c9f24753181641460cca83660afa1a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1160 zcmbVMU1$_n6rPwOHkc9uMopoP<4Z(m=YMBs$TZE)?z#)v7&eQEZ{C@?o1G>zcbvI# zHz|eIBB-EX@ud&a9~1>eP@x2h=tB?$F(icI&r7M|lOXY>&}!2=o87bzArBpxx#!&b zednBee&)=`@S)C*-VTbQIt%$siL4*R@3yVvyC=^sl4Uo}j^j~O!8H&2iKyE>8MZH}QE5Ikux zYe9_{M`#m;kX8~&*5(D7R<(qnBvnm4NQ*@0_!KAdEU)Q`r1K)(d>G;_bSio&lWY1S zn!!{t4s?#I)oO{FltAGGCuo|+@ggUREJ3i*jE_N`^`m_)3mF*Mp&MWq`E+a%SZEp> z42g8@3SLkwt{e8FW}-;SxH}e1BxR5aza*}XdN4F#(Td-oYssv?L;$@lDpeV5^TZB?l zlpQCfw(M-g&t=V&mX_0sl2ZjCO9VcZR-~kvkJIt6VS~Uo2){&9HFgO>!)|_g6^U1b8QE@{zyN) z_x0Saqut*>7@~ju>h{(4l}=0UXg_XTeBX2Wa~FXznj zqd%1%%a@nGJ$3Qyw$DGfve11QKmX?7hh4`gp=a-IP3+qd{~HR~;mpnSv6KG*+gy4e diff --git a/OsmAnd/res/drawable-xhdpi/ic_back_drawer_dark.png b/OsmAnd/res/drawable-xhdpi/ic_back_drawer_dark.png deleted file mode 100644 index 17ca3bb76b484d43a48329fa8fd883ead8373287..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1273 zcmbVMZD<>19KR7(YatV5lXX@(t{`)Gxy!vIxwCOi^WuU_TW`T;A1pq(dy*XKy?A$R z(x6yZUr?!7mNMtd>V^aDpyH@g(6K7`p+Q|lm@^E9IFy3e4=o}C#plwb`l0ND2Y1i& zf1dyE|Ns5p?&aaZN4#D8x-bm$CJ)6VwD!1fX9xOP-s@GgbUX2kbHvCwC161;q8M3- zCpD0V5(LWRQ!B6!!#opeI^$$gheg@Ye8AQ5l{FKgF|6-k*#vSCI(Qc5RXt3seRhe! zRV7S}@F_ZFMqxocRI%WZ%3xZq6lFmn4nBiV(y4^|?N*PrKCgu0hl%~0HHMMO=g8$OkR@+Wbnvjy9ZH!wo zszRLma~}1EDrHsoM_FW!Uzu zBHt~na7(NhwIFZ|D{UBK?JgKD7>;2V3=@w=n^nj6kEpt0lFV7G8Rdf8%uMMU0?L?e(@X_>NyspzMGjjHU0d( zSC+0^oi$%;T-~^9&g=w3lJUpdhpTV>ko^0b`LCZouzpe99slX{96UL4K2fc%QebbQ zaC~j$@mJ5on|HvY7ar?+Te^Ap+4rt}{M-|@H&^GYH?HSyulF=SWxaQ_vAhF*xe=_b z{4%w$96r0UVb@0PDR6tOeZz|vUix#qi0^!be;u3Y@YnIh%2&@k>TUE-e-fx4onGkA zdzW$_l>hShmQVb)eBvRGT|2qzseQV5$=Rv@+;MF*k5?w@>{(0QRlV)|%lj{iQ-$1_ z?sI42U865_eoh>?Pb^A%-k6@fd+N^j8MR&?9OGuOcevSarH}5H-pw4J$2{1=sXqSl Suj^^|XOxT&#uf*jJoXRxB)T^M diff --git a/OsmAnd/res/drawable-xhdpi/ic_back_drawer_white.png b/OsmAnd/res/drawable-xhdpi/ic_back_drawer_white.png deleted file mode 100644 index e70772a78d82b1d79d7ffc709d56fabdbe67bdff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1271 zcmbVMU2NM_6gDkNr$WaALqOC?#ua0MId=S$#HOK5j0vPM*5+j(q%qL6O)44^hzTAT*J)CCsP=#* z``&Z!`Of*ypATe)p6%-Nc48RTl^m3^Xzh02bsqFJyROvG@~9mjwTEHBuF59BqAJV- zJgLh?kOi_j@$%Q87sJ~3YPnH+G__4spzfDl9lxVj5E{dJ`<#lbl!1-sK~Xaz#H~-x z5V)pBh!H+Trz$Z}(gr6@Fg!VwQzpxbpb~x0;JuEB4Cug?aYr9BEYXP&4Z9-RyT=rP zH&pC$gjgXpn#$lYXabz~2T6qvaCk`Y2l!w}2yMX`BvW*lVrY^UM4lCC25&wD@@A?9 zF)JmSzK|3lO151QDXLnn`m3xTnnfxg2m(bj6vL26gR~|LTXsmp>SDk3&w+SE`{* z>PUCHItoZw9VTF)2{O^B)EBN^#jtxGPD;_7^Zml1==!t$8}^-))7`VuxAGVK*3Z|M zcb1n2Z}5A5?mkpmC#SRUk6Z9*xa)~OL(|M}CobHcKY0E0{vD6(+jZ9ae0KiKrX-U% zGL`;lXKiDB+IRB!TiGAqTq^$c;I(62%h}+zJIBv~Baio6rTsU*dB-WYchr3KE57Sb zc3f_Ipth+_ZSK?O7I%N8^`G7zIrrfU?Y_*ZnR`pzYp-|?{_@c6r}kX(c&8R-E_yGw z9px__e($I4o)>4S?_Q;$RnBUwZ!C;mL7q z@q)zeh`+Jn(@y2r*WY(;oH{_#?L8#clL1R}$2N{EN^SO%BtG}$;lY`F>hHGuG5B^b U|Jc;|JMOP286T297}!1g4_VHzqyPW_ diff --git a/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_dark.png b/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_dark.png deleted file mode 100644 index 19e922e93059939acae1cdb80e9ab85264932ce2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1344 zcmbVMZA{!`9Is=%j0Iy1IGHd@5yLim?X|tTUg5yw%E=)I1a1TICG^_opn+>^TeyRP z$uMye*~rLZSf-PJA27?@RDw)0vn|^tppWKahQ}N&7ti z=lTDB|Mw2m)jXS#zCRs7kPKfXUk}&9*qfFDzk?f}hT)QJRy3InYRHTTIzZf#8U&~> zEVP1pAV}S>Tn8lxlGG&!n#?ADH7BZJixAVXM8g_HBS=YER1?H@V4^|LDl0B*{qt)W zDoZY`(dH-png_JWl|4FW=&1>aJ?)}X!pcg~k|+lW!oU>JXt+Z$xTp(@^Kx(>J0>tR zu41;kuuZ3${B@{D)d6a=*m04xGN{98vD)kor=tj^piGb~L6JD=U25@k|HPyhZ?xit(Za-SB(4w0}l*Qmo-yX z6*R^u1l3N{g+Wg@LkMer|2DB=Y$Xb&jED*vVYQG%I2?;Bu5Fn0;9oa()HVX$8X)R{ zp?2ybtVbw60fxDIu%VbD^oFa|WmpuUgIC4QFi=b%@511XMUo{B0GK?6WN<6%bl@Qy z!>;cy_{*yq#gKENx?0#%ir#+-@EcF%0c>(B-Vxo51=M!xR(| zBy7vj_7;|UAeQs!KrmH3psF2-E~sl$P1R^qHPqvYR~;>Elod&h7zblz+Kie9y4(dM zudasCc%C_V2OnsMJs1*M38w`S;G&gr;w%$naA0%NA`@cmAu)(;;idnZKLR>M#G2(l z&67BS9U0qhj{+37hY2Wff^;}47=5-9K^|)H@$Nu$@y^Jts$K5P*I(K*HtC?$t3Gw@ zhlMx3{AQ_o;!f_^0rc{(U3q=u^LYQr#=yrP<}mwzVlQeB_ZA)twU(ZE=ld1@tC6a+ zdTDgMuralE`H_y-@`rD)_PgqSdwWmu zckheG4u9LSaL)YVXy(-v^?ZN!y%owhS@7r6tJey~*;AfU(td0y*NwMoeRogmGjp@cV}*|;-SSSa-P~CYt}(HfFd1GCwA)b$&mRXy?ZspX-mzTD!; zzu%i30{v5uzPc}SvhQT>;?RVCrTI*e$2NYUDf!4;tGrI;~SU88db{%zR-FHpzejIt~<>5Dv-*9Kd{%O978vcXwmi~VL5?|Ez diff --git a/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_white.png b/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_white.png deleted file mode 100644 index 1a83dced108f093c79b7bb51fef51e072f9cd407..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1350 zcmbVMeN5bB81IH#7|3+QNv1HH;uubPZLht%ws64h%CW;8u;b6PCg1e+@Z0zIX%#M8tcrT8PLEh|(Ex}?*24hx zt70<<0#WWbcnOpsNLsrRs<-L`yLm}hZDLZ#mQZ65jUXjuiI^xwfrW-av!c1NxpNmV zRFU1-K1YBI#Jr$I+0|))y3Xp5)ESjH87nJAOAC=(=0*h!q^cn8gsc69l{pfy8| z@Ik@1Yzs2B%ogg-0BW z3uj4&!NV>(3;^X|MLUz?Sq)DLPKKpemxEy$imG5d9sv?D4DEB#J6WGEh4pKuC2A5# z*;b(KWvugoSl(*@(bA2OuD7PTpteP~bhAZ|plz!{EvV|5Wzm82wqzW3Q~M={-SiJ-_LN$}`;w?A{xW_tGw9*%HFo z;IrcP;`Uq}9KYF-`Rz4jGd`rIg86us{0;}7*uE`TX{n|JPN zal!n>yPwoe-#Y!rcU@}1$mP4myNB}{VkmE(u^m-bvwGhXvGjg}tE;f@T>oS&(F zXyZ)wfe*Ihg$HW~#M#`c%)x7Ww{7B_U5%fYHzMjtsCM1Zj-S0{&E17hKQha2{HblU zOpWHTefKZkxKZSp+;Av8W1=Cy=eL1h8&ADjQ(bwQy=@Q`bMV C?beh4 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_back_drawer_dark.png b/OsmAnd/res/drawable-xxhdpi/ic_back_drawer_dark.png deleted file mode 100644 index 4022c1b4221f5ca6a7ab238f402efae50238108f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1361 zcmbVMZ%i9y7(XCvTK*)8Og4u(k4)I$dUx&h&z*Fv^jaucSuI7{IO49oxAcVGb$2hc zbeOp<(Tp#{i7uPOkl|S36400}na(Wgh(lyDLiSz@RGat zdEWQ;d!FZg{@hW2Yg36~ivh#15^u8*KMYL>&?htHKV=yIZ0CP%e z1mNC;*aZSWl=}BigL(`r=#zsX81n7rqiVt^W--QeB8k`-R^O0LiqUQW@d)UW6$kP2 zCzlCamK;Qf#Yg*+E)bWSGa6{iv<9P@?kFb_4LkArG>;4<02J|bqDRsBw1Zf-%Og3v zO%eDq1a>=!m7qdCKkiaBfLn}KGD@DjBuPt(;{sL#42CA{?k0UE!2@&acvZkvNlXWK@+5*QK^4zeiFm-_Im|qFn#mN$=Q<6>0(d8;lh27 zR*czr!>6BNcm<}=EeGyY+*LFVgY5+br}*~`Z_{&d;#!Lc_-GK)f0Z1hNJ{<(|49e-+J`rhv?zHR)BVes4Un;VASJMjLQ z=l*)~3=D^zt`V%$LBjH)!M!K0o_}X?c39}xH0p)m*NL-tzA_9?)Xu1TEWZrZ9@_X! z}(qnq(hr60?7qFd<>v;$Bi?Le`;pcDjv+rhqa$a|< JFwwa0@IM@5(ZT=# diff --git a/OsmAnd/res/drawable-xxhdpi/ic_back_drawer_white.png b/OsmAnd/res/drawable-xxhdpi/ic_back_drawer_white.png deleted file mode 100644 index cab4e58f7af534d643b661946ee0cb15610540d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1361 zcmbVMZ%i9y7(XC51xlg>baR;V$Oao+@2=m)Y7UUK(7 z&-?y<&-1*`pL^Bc+GHr&QiNfc!P_hZ(7H4GKKu~+PJKGPA1#}qy94f1qcA0E0CP%e z7~o!6>;eHGN_~f?K|O{Q^u~i7u*0{9kEpUy%wmjbIf2+1R^O0Lh>>mp@i6F$D-Po4 zkFF4STyhZY79Z_PxIir4oYBC(OlvTb>5gy`(Xb1zPxHut44{ao{ph#D*ASZmjb;F9jmMD}mDlH}`#z<4LoW0iyT89DfZx|b*^C<{c<@O!m5DvH=6sF9=$6zCNk1UfNFafuI`MK%ng5z=M` zENP}$mgIoROxhzRV78iANwV8=b~fU>8K=F`= zucAXyiGZB%IP$&5wLg%{yEGs|RST+WPp%96F%_zMOikb}*Gkp#n)bLNsVRL&woI$H z7JwG-1(HWoWqc*ie0+l#XuFjGY}iTyMzWBWC~G3^Hbx@NVwmGZnigq0AlCTO|IHtT zf}*m`@}K6(ZK00LitD3*l=Wc(3Ys7djmmZT>Mab*JM0yl!StPLr)LdU=@L)DK;gkh zzIv&2zTo3eF#HKjNi5;Z+m{~$c{|?}?ruKPc7NN+{`byK+`nvJ4xicniYIhZ@oeq4 zw)pmcnLJkVJ{;-zv%khNcFWA;#rKx<3k#QD?B$%cT^CwruYV`s94(o{F0~!XUmPlf z)iZxnnNaVkGIs0e#Xwo$cX!kG1#G9|cHWWv5^P{1^sJ%kgSWFkIj_4_ Jm~1>a@DHj7(lh`7 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_dark.png b/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_dark.png deleted file mode 100644 index 4de1c9e4e394115461e722d68018e334990a35cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmbVMeM}o=7;hnC20;@?7MLMBOBlF#y=!~d_HGmcEsVm7tdvo{GOl-Tp+N7tyMwkw z49)~1W;3uZ3ma3^iT<&$3I>;8fSJGoCb(%bhFRvVVe=(U2@B;A7Y(AR{hN@8M0V-^V6Y zh=((&Do7h{^O-?|r?5=~Wo;!6wylY!I8{zIk`?XyF>ejhGfkaf&8&G_FOq9u@Q^ za&FpgDcJG_S0+`1Ec<8-^ZWg3zfLWP^_YgDC=AzPS}h7KP$|gEOaSGjv?zlGNUZ4b z$sU16B8-enXpv1S80qE}ygr+4o0yljgo2V`0mg@E)Hvq#M((v?Ey;H9Zx}mTOOBuq zV0Iu0Eg}o^;ZBQ!p?1%96fuO+(65Ugm=vbjBCsu9z{^&PNd-^ToQId>NJ{sA}>!v8O^ymW4^ASK#NmR ztd*B!hG#+4w+H&(!s5@w(q<7bvLHGHp*dOwr452CNDYDyF`GBCj$~GNcuw$3uSU|e zd20(0J*|K%5Ct!?p)>8-AqJg6?{c$74%IO%Kv@kzp+>?*pn#-wEa5il-K5?OZUwm5ZYIFP4iaIjOr1);u23kyw_0)?fghGGj1|S^CUx$q z{43#?^nsJ(dA-w3MIT)2cyz4$QQY2RclDW_Nxyv&9uAkj;;gdt{GHHW=yVT{%`Da2 zS)V-4=|)EO>-rY16jI$E*?SrX9pM6ABr;b*?X%xpO&PMQGh>TF zY+P1JdD`Wx^CWm%TfA_o#=du2xxegusAx`i^yd>L08TnhPn7d zms>jT4u17md;uG*nYP}L#ue{gY%dpAb8oI$mF@SQ_tlCIdxk%5nE0e)=t<0-Gn3sv za>sA3U7UE&yz+*U|MTUuimYE#mNJ%u>;q|b_rzPNaqlZ~%33oXWDKkfbmhnDL2_A=FXy_aX;)W`#Y7?s`Yl|mSt0xDWt)G&%n(T#_PNyqklP48%cn4GbX62d0>fuJ4 z-fKNaPNn{Iy}bH6VEgj(Z~a3Hy?oQY?DhKdPgZwV&n`bTb}19;HjwH;v{G~M!YDWO zSxq>7Pr>~V+J_&^Xr8%rbhSKXy-^9}PN?fztmsfGoQt;?$M21-M}DK${1VGhUfs!m E0Drs*mH+?% diff --git a/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_white.png b/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_white.png deleted file mode 100644 index 2ab38b4b05e5fcb6b0f7e7c843990ae7586eaf7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1460 zcmbVMZA=?w9KUAEvSEihOH}sdQpRFo*SofN?e#+GfWoL<5xQgC=u;>(Zf;u+T>2On~LqJ(JHF0WudkS>=f$W2q+&yo< z-|zo_{xA1TX~~+UDd{N)f-H3xyL@oWNxX{}!7ua2B^eG6s)gn1Iw_<^Ss5UCyc7he zTVyu^A7J_VCk6pzEZ8LY%hhu4T85KEBb&e&V`2odp_nrkVYwQhqCv1x2s`vQ`rp!{ z0`JfVC@xIqT%8cO_JLk(x=_0C*0C&oYl5vVL06Klf?6LaWibQw5LY~y-# z2BOwD^s`QtdrQ#*Nd_oov|=1#B2k;&Xrin(yKNO}hHIRlaWjDtc80Prgc+TC^w65j zhZvu$XwDW~IrP=48ewoe8jTvG7NaC@#7%a)9Vg7V*^EI1rqqX3Him_jjHH4KD4Z-r zR6z=(2}L$2)u|3W^mO(LV#MpcEgV+n0tG{c$JhvNG7`8bChj$ZR#YGO*Nu76ioZSr za34^lI+=s{2xTP6Fm`t~lmJ3+m`7v*CWWnaNnD)>!m8Wl(8CiWFYpWiFnAqYnjyFfT=@*gJjq$`?4n|5JdB-+m+{!jZU}pmkbcP9TmFY zwL3kTtD6GVry|!su#_$tKe2kJt*Yvqiz%+pT9<3rYPE5{$=tPgJ2$0Uzvs$|6WrNr z&Jics{q5$?nu+C)rVe!YUpbVW)`n=Skp9ZY?pfGwY4epBa>t*Ri|Y@Q1M7z}!RjTJ zkK$)vdwg5kt-jXUvhNIE?#~_?Suu9s!&`lWv6Wdl=MENqVI9616HCK}U0Gv?u4Ycw zG>Pu2v#k~8YRzRzd->qWzf%U<-s{?zf7e*X5CsmHCT-21yl`*NVPr$^X~$O=(o?73 z7uYr3gXjDA+XCmVj&J*rPHlKQt?J~d*FEjdtWjt7%gvRVc2B#b>=)hjsP24SApYdC z@*i8Kvqu|m-YT1XG5d`7sUyqc6FFP|Jdk@syCv_pYqpLv%EDi_cRCB5nk|T9ReFb^ zVrb-$Pt($Qw5`oRMLr(+{wGlr#Wc}cxR-hOB3akVd+6sA;aKp%8Dt063%u6a!Q<4W zuFT4dy1MvFr$_f1Yx;I=esj15o9cP>!q1JFyh-+-1 zhTU0r_wer=lYwXD?yUQJ_>p6O9pBy9jU - - - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/layout/radius_search_list_element.xml b/OsmAnd/res/layout/radius_search_list_element.xml deleted file mode 100644 index 51e1700893..0000000000 --- a/OsmAnd/res/layout/radius_search_list_element.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/OsmAnd/res/layout/waypoint_header.xml b/OsmAnd/res/layout/waypoint_header.xml index 79e153e8fd..534d0e80cc 100644 --- a/OsmAnd/res/layout/waypoint_header.xml +++ b/OsmAnd/res/layout/waypoint_header.xml @@ -4,15 +4,15 @@ android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="match_parent" - android:layout_marginTop="5dp" - android:layout_marginBottom="5dp" + android:layout_marginTop="3dp" + android:layout_marginBottom="3dp" android:layout_marginRight="3dp"> - + - \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index bfa78e99ac..06257f9037 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,8 +9,6 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> - Configure map - In proximity of Device not found OsMo service is not available:\n- check the connection;\n- check the settings;\n- check out our Twitter: https://twitter.com/OsMomobi An anonymous user can not:\n- create groups;\n- synchronize groups and devices with the server;\n- manage groups and devices in a private office. diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java index ff1d4aa75b..6fad1a3191 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java @@ -17,8 +17,8 @@ import android.widget.TextView; public class ContextMenuAdapter { public interface OnContextMenuClick { - //boolean return type needed to desribe if drawer needed to be close or not - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog); + + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog); } private final Context ctx; diff --git a/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java b/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java index e9e3d31d6b..228d02be00 100644 --- a/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/AvailableGPXFragment.java @@ -159,7 +159,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { optionsMenuAdapter = new ContextMenuAdapter(getActivity()); OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(final int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(final int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.local_index_mi_reload) { asyncLoader = new LoadGpxTask(); asyncLoader.execute(getActivity()); @@ -175,7 +175,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { } }); } - return true; } }; optionsMenuAdapter.item(R.string.show_gpx_route) @@ -396,7 +395,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { private void basicFileOperation(final GpxInfo info, ContextMenuAdapter adapter) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.local_index_mi_rename) { renameFile(info); } else if (resId == R.string.local_index_unselect_gpx_file || @@ -442,7 +441,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment { AccessibleToast.makeText(getActivity(), R.string.gpx_file_is_empty, Toast.LENGTH_LONG).show(); } } - return true; } }; if (info.gpx != null && info.file == null) { diff --git a/OsmAnd/src/net/osmand/plus/activities/FavouritesTreeFragment.java b/OsmAnd/src/net/osmand/plus/activities/FavouritesTreeFragment.java index d1524170d2..15fd1714ba 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavouritesTreeFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavouritesTreeFragment.java @@ -176,9 +176,8 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment { new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { editPoint(point); - return true; } }).reg(); Item delete = qa.item(R.string.favourites_context_menu_delete).icons( @@ -187,9 +186,8 @@ public class FavouritesTreeFragment extends OsmandExpandableListFragment { new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { deletePoint(point); - return true; } }).reg(); MapActivityActions.showObjectContextMenu(qa, getActivity(), onshow); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index 6365f5c629..022555b70e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -124,12 +124,11 @@ public class MapActivity extends AccessibleActivity { settings = app.getSettings(); app.applyTheme(this); super.onCreate(savedInstanceState); - requestWindowFeature(Window.FEATURE_NO_TITLE); - - + mapActions = new MapActivityActions(this); mapLayers = new MapActivityLayers(this); + requestWindowFeature(Window.FEATURE_NO_TITLE); // Full screen is not used here //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); @@ -275,7 +274,7 @@ public class MapActivity extends AccessibleActivity { @Override public void onBackPressed() { - if (!mapActions.onBackPressed()) { + if (!mapActions.onBackPressed()){ super.onBackPressed(); } } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 6cee4bac21..bb5acdbcee 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -47,11 +47,9 @@ import net.osmand.plus.activities.actions.ShareLocation; import net.osmand.plus.activities.actions.StartGPSStatus; import net.osmand.plus.activities.search.SearchActivity; import net.osmand.plus.base.FavoriteImageDrawable; -import net.osmand.plus.configuremap.ConfigureSettingsMenu; import net.osmand.plus.development.OsmandDevelopmentPlugin; import net.osmand.plus.helpers.WaypointDialogHelper; import net.osmand.plus.osmo.OsMoPositionLayer; -import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder; import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.views.BaseMapLayer; @@ -97,22 +95,17 @@ public class MapActivityActions implements DialogProvider { DrawerLayout mDrawerLayout; ListView mDrawerList; - private WaypointDialogHelper waypointDialogHelper; - private ConfigureSettingsMenu configureSettingsMenu; public MapActivityActions(MapActivity mapActivity){ this.mapActivity = mapActivity; settings = mapActivity.getMyApplication().getSettings(); routingHelper = mapActivity.getMyApplication().getRoutingHelper(); - waypointDialogHelper = new WaypointDialogHelper(mapActivity); - configureSettingsMenu = new ConfigureSettingsMenu(mapActivity.getMyApplication()); - waypointDialogHelper.init(); } protected void addFavouritePoint(final double latitude, final double longitude){ String name = mapActivity.getMapLayers().getContextMenuLayer().getSelectedObjectName(); - enhance(dialogBundle, latitude, longitude, name); + enhance(dialogBundle,latitude,longitude, name); mapActivity.showDialog(DIALOG_ADD_FAVORITE); } @@ -209,11 +202,11 @@ public class MapActivityActions implements DialogProvider { @Override public int compare(FavouritePoint o1, FavouritePoint o2) { - if (distance && activity instanceof MapActivity) { - float f1 = (float) MapUtils.getDistance(((MapActivity) activity).getMapLocation(), o1.getLatitude(), + if(distance && activity instanceof MapActivity) { + float f1 = (float) MapUtils.getDistance(((MapActivity) activity).getMapLocation(), o1.getLatitude(), o1.getLongitude()); - float f2 = (float) MapUtils.getDistance(((MapActivity) activity).getMapLocation(), o2.getLatitude(), - o2.getLongitude()); + float f2 = (float) MapUtils.getDistance(((MapActivity) activity).getMapLocation(), o2.getLatitude(), + o2.getLongitude()); return Float.compare(f1, f2); } return ci.compare(o1.getCategory() + " " + o1.getName(), o2.getCategory() + " " + o2.getName()); @@ -440,7 +433,8 @@ public class MapActivityActions implements DialogProvider { return dlg; } - + + private static class SaveDirectionsAsyncTask extends AsyncTask { private final OsmandApplication app; @@ -752,11 +746,9 @@ public class MapActivityActions implements DialogProvider { public void createOptionsMenuAsDrawer(boolean show){ final ContextMenuAdapter cm = createOptionsMenu(); - if (mDrawerLayout == null){ - mDrawerLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout); + mDrawerLayout = (DrawerLayout) mapActivity.findViewById(R.id.drawer_layout); mDrawerList = (ListView) mapActivity.findViewById(R.id.left_drawer); - mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); - } + mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START); ListAdapter listAdapter; if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB){ listAdapter = @@ -778,12 +770,9 @@ public class MapActivityActions implements DialogProvider { public void onItemClick(AdapterView parent, View view, int which, long id) { OnContextMenuClick click = cm.getClickAdapter(which); if (click != null) { - if (click.onContextMenuClick(cm.getItemId(which), which, false, null)){ - mDrawerLayout.closeDrawer(mDrawerList); - } - } else { - mDrawerLayout.closeDrawer(mDrawerList); + click.onContextMenuClick(cm.getItemId(which), which, false, null); } + mDrawerLayout.closeDrawer(mDrawerList); } }); @@ -830,13 +819,12 @@ public class MapActivityActions implements DialogProvider { icons(R.drawable.ic_action_gloc_dark, R.drawable.ic_action_gloc_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (getMyApplication().accessibilityEnabled()) { whereAmIDialog(); } else { mapActivity.getMapViewTrackingUtilities().backToLocationImpl(); } - return true; } }).reg(); @@ -857,9 +845,8 @@ public class MapActivityActions implements DialogProvider { optionsMenuHelper.item(t).icons(icon, iconLight) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { routingHelper.getVoiceRouter().setMute(!routingHelper.getVoiceRouter().isMute()); - return true; } }).reg(); } @@ -868,9 +855,8 @@ public class MapActivityActions implements DialogProvider { .icons(R.drawable.ic_action_gdirections_dark, R.drawable.ic_action_gdirections_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { enterRoutePlanningMode(null, null, false); - return true; } }).reg(); } else if(routingHelper.isRouteCalculated()) { @@ -880,7 +866,7 @@ public class MapActivityActions implements DialogProvider { .icons(R.drawable.ic_action_gdirections_dark, R.drawable.ic_action_gdirections_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if(routingHelper.isRoutePlanningMode()) { routingHelper.setRoutePlanningMode(false); routingHelper.setFollowingMode(true); @@ -891,7 +877,6 @@ public class MapActivityActions implements DialogProvider { } mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode(); mapActivity.refreshMap(); - return true; } }).reg(); } @@ -907,13 +892,12 @@ public class MapActivityActions implements DialogProvider { optionsMenuHelper.item(nav).icons(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { stopNavigationActionConfirm(mapView); OsMoPositionLayer osMoPositionLayer = mapActivity.getMapView().getLayerByClass(OsMoPositionLayer.class); if (osMoPositionLayer != null) { OsMoPositionLayer.setFollowDestination(null); } - return true; } }).reg(); } @@ -921,56 +905,46 @@ public class MapActivityActions implements DialogProvider { optionsMenuHelper.item(R.string.target_points).icons(R.drawable.ic_action_flage_dark, R.drawable.ic_action_flage_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (getMyApplication().getWaypointHelper().isRouteCalculated()) { - - final List deletedPoints = new ArrayList(); - ArrayAdapter adapter = waypointDialogHelper.getWaypointsAdapter(app.getMapActivity(), deletedPoints); - mDrawerList.setAdapter(adapter); - return false; + WaypointDialogHelper.showWaypointsDialog(mapActivity); } else { openIntermediatePointsDialog(); - return true; } } }).reg(); } // 5-9. Default actions (Layers, Configure Map screen, Settings, Search, Favorites) - optionsMenuHelper.item(R.string.configure_map).icons(R.drawable.ic_action_layers_dark, R.drawable.ic_action_layers_light) + optionsMenuHelper.item(R.string.menu_layers).icons(R.drawable.ic_action_layers_dark, R.drawable.ic_action_layers_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { - configureSettingsMenu.setListView(mDrawerList); - return false; - //mapActivity.getMapLayers().openLayerSelectionDialog(mapView); - //return true; + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + mapActivity.getMapLayers().openLayerSelectionDialog(mapView); } }).reg(); optionsMenuHelper.item(R.string.layer_map_appearance).icons(R.drawable.ic_action_settings_dark, R.drawable.ic_action_settings_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { mapActivity.getMapLayers().getMapInfoLayer().openViewConfigureDialog(); - return true; } }).reg(); optionsMenuHelper.item(R.string.settings_Button).icons(R.drawable.ic_action_settings2_dark, R.drawable.ic_action_settings2_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { final Intent intentSettings = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getSettingsActivity()); mapActivity.startActivity(intentSettings); - return true; } }).reg(); optionsMenuHelper.item(R.string.search_button).icons(R.drawable.ic_action_search_dark, R.drawable.ic_action_search_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getSearchActivity()); // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); LatLon loc = mapActivity.getMapLocation(); @@ -978,26 +952,23 @@ public class MapActivityActions implements DialogProvider { newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude()); newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mapActivity.startActivity(newIntent); - return true; } }).reg(); optionsMenuHelper.item(R.string.favorites_Button).icons( R.drawable.ic_action_fav_dark, R.drawable.ic_action_fav_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getFavoritesActivity()); // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); mapActivity.startActivity(newIntent); - return true; } }).reg(); optionsMenuHelper.item(R.string.show_point_options).icons(R.drawable.ic_action_marker_dark, R.drawable.ic_action_marker_light ) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { contextMenuPoint(mapView.getLatitude(), mapView.getLongitude()); - return true; } }).reg(); //////////// Others @@ -1006,9 +977,8 @@ public class MapActivityActions implements DialogProvider { .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { new StartGPSStatus(mapActivity).run(); - return true; } }).reg(); } @@ -1017,7 +987,7 @@ public class MapActivityActions implements DialogProvider { listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (MainMenuActivity.TIPS_AND_TRICKS) { TipsAndTricksActivity tactivity = new TipsAndTricksActivity(mapActivity); Dialog dlg = tactivity.getDialogToShowTips(false, true); @@ -1026,7 +996,6 @@ public class MapActivityActions implements DialogProvider { final Intent helpIntent = new Intent(mapActivity, HelpActivity.class); mapActivity.startActivity(helpIntent); } - return true; } }).reg(); final OsmAndLocationProvider loc = app.getLocationProvider(); @@ -1038,11 +1007,10 @@ public class MapActivityActions implements DialogProvider { .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { // animate moving on route loc.getLocationSimulation().startStopRouteAnimation(mapActivity); - return true; } }).reg(); } @@ -1052,7 +1020,7 @@ public class MapActivityActions implements DialogProvider { optionsMenuHelper.item(R.string.exit_Button).icons(R.drawable.ic_action_quit_dark, R.drawable.ic_action_quit_light ) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { // 1. Work for almost all cases when user open apps from main menu Intent newIntent = new Intent(mapActivity, mapActivity.getMyApplication().getAppCustomization().getMainMenuActivity()); newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); @@ -1060,7 +1028,6 @@ public class MapActivityActions implements DialogProvider { mapActivity.startActivity(newIntent); // In future when map will be main screen this should change // app.closeApplication(mapActivity); - return true; } }).reg(); @@ -1163,9 +1130,8 @@ public class MapActivityActions implements DialogProvider { new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { - MapActivityActions.directionsToDialogAndLaunchMap(activity, location.getLatitude(), location.getLongitude(), name); - return true; + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + MapActivityActions.directionsToDialogAndLaunchMap(activity, location.getLatitude(), location.getLongitude(), name); } }).reg(); Item intermediate; @@ -1178,9 +1144,8 @@ public class MapActivityActions implements DialogProvider { } intermediate.listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { addWaypointDialogAndLaunchMap(activity, location.getLatitude(), location.getLongitude(), name); - return true; } }).reg(); @@ -1190,11 +1155,10 @@ public class MapActivityActions implements DialogProvider { new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { app.getSettings().setMapLocationToShow(location.getLatitude(), location.getLongitude(), z, saveHistory ? name : null, name, obj); //$NON-NLS-1$ MapActivity.launchMapActivityMoveToTop(activity); - return true; } }).reg(); if (favorite) { @@ -1203,13 +1167,13 @@ public class MapActivityActions implements DialogProvider { addToFavorite.listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { Bundle args = new Bundle(); Dialog dlg = createAddFavouriteDialog(activity, args); dlg.show(); prepareAddFavouriteDialog(activity, dlg, args, location.getLatitude(), location.getLongitude(), name); - return true; + } }).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index da690e6027..cf4f953713 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -349,7 +349,7 @@ public class MapActivityLayers { adapter.item(R.string.layer_transport).selected( settings.SHOW_TRANSPORT_OVER_MAP.get() ? 1 : 0) .icons(R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light).reg(); if(TransportRouteHelper.getInstance().routeIsCalculated()){ - adapter.item(R.string.layer_transport_route).selected(1) + adapter.item(R.string.layer_transport_route).selected(1 ) .icons(R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light).reg(); } @@ -600,10 +600,6 @@ public class MapActivityLayers { }); return builder.show(); } - - public void setPoiFilter(PoiFilter f){ - poiMapLayer.setFilter(f); - } public void selectMapLayer(final OsmandMapTileView mapView){ if(OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) == null) { diff --git a/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java b/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java index e303a783eb..27965245cf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/SelectedGPXFragment.java @@ -188,14 +188,13 @@ public class SelectedGPXFragment extends OsmandExpandableListFragment { private void basicFileOperation(final GpxDisplayItem gpxDisplayItem, ContextMenuAdapter adapter) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.show_gpx_route) { OsmandSettings settings = app.getSettings(); settings.setMapLocationToShow(gpxDisplayItem.locationStart.lat, gpxDisplayItem.locationStart.lon, settings.getLastKnownMapZoom(), Html.fromHtml(gpxDisplayItem.name).toString()); MapActivity.launchMapActivityMoveToTop(getMyActivity()); } - return true; } }; if (gpxDisplayItem.locationStart != null) { diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java index f901eeb20a..17f9c5292c 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java @@ -9,8 +9,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import android.os.Build; -import android.preference.*; import net.osmand.access.AccessibleToast; import net.osmand.plus.ApplicationMode; import net.osmand.plus.OsmandApplication; @@ -27,8 +25,14 @@ import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnMultiChoiceClickListener; import android.os.Bundle; +import android.preference.CheckBoxPreference; +import android.preference.EditTextPreference; +import android.preference.ListPreference; +import android.preference.Preference; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.Preference.OnPreferenceClickListener; +import android.preference.PreferenceGroup; +import android.preference.PreferenceScreen; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Toast; @@ -42,7 +46,7 @@ public abstract class SettingsBaseActivity extends SherlockPreferenceActivity im protected OsmandSettings settings; protected final boolean profileSettings ; - protected List modes = new ArrayList(); + private List modes = new ArrayList(); private ApplicationMode previousAppMode; private Map screenPreferences = new LinkedHashMap(); @@ -70,23 +74,6 @@ public abstract class SettingsBaseActivity extends SherlockPreferenceActivity im return p; } - public CheckBoxPreference createCheckBoxPreference(OsmandPreference b, int title, int darkIcon, int lightIcon){ - CheckBoxPreference p = new CheckBoxPreference(this); - p.setTitle(title); - p.setKey(b.getId()); - p.setOnPreferenceChangeListener(this); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { - if (getMyApplication().getSettings().isLightContent()) { - p.setIcon(lightIcon); - } else { - p.setIcon(darkIcon); - } - } - screenPreferences.put(b.getId(), p); - booleanPreferences.put(b.getId(), b); - return p; - } - public CheckBoxPreference createCheckBoxPreference(OsmandPreference b, int title, int summary) { CheckBoxPreference p = new CheckBoxPreference(this); p.setTitle(title); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index cc2571bced..d2b9f0b6bf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -580,7 +580,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa poiDescr.listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dlg) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dlg) { // Build text(amenity) // Find and format links @@ -597,8 +597,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa // Make links clickable TextView textView = (TextView) dialog.findViewById(android.R.id.message); textView.setMovementMethod(LinkMovementMethod.getInstance()); - textView.setLinksClickable(true); - return true; + textView.setLinksClickable(true); } }).reg(); } @@ -607,9 +606,8 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa showDetails.listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dlg) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dlg) { showPOIDetails(amenity, settings.usingEnglishNames()); - return true; } }).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java index e414204e5a..5a86d98e4a 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioNotesLayer.java @@ -118,14 +118,13 @@ public class AudioNotesLayer extends OsmandMapLayer implements IContextMenuProvi final Recording r = (Recording) o; OnContextMenuClick listener = new ContextMenuAdapter.OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.recording_context_menu_play || itemId == R.string.recording_context_menu_show) { plugin.playRecording(view.getContext(), r); } else if (itemId == R.string.recording_context_menu_delete) { deleteRecording(r); } - return true; } diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index b82a09876d..10e6123538 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -414,13 +414,12 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { public void registerLayerContextMenuActions(final OsmandMapTileView mapView, ContextMenuAdapter adapter, final MapActivity mapActivity) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.layer_recordings) { dialog.dismiss(); SHOW_RECORDINGS.set(!SHOW_RECORDINGS.get()); updateLayers(mapView, mapActivity); } - return true; } }; adapter.item(R.string.layer_recordings).selected(SHOW_RECORDINGS.get() ? 1 : 0) @@ -434,26 +433,23 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { recordAudio(latitude, longitude, mapActivity); - return true; } }).position(6).reg(); adapter.item(R.string.recording_context_menu_vrecord).icons(R.drawable.ic_action_video_dark, R.drawable.ic_action_video_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { recordVideo(latitude, longitude, mapActivity); - return true; } }).position(7).reg(); adapter.item(R.string.recording_context_menu_precord).icons(R.drawable.ic_action_photo_dark, R.drawable.ic_action_photo_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { takePhoto(latitude, longitude, mapActivity); - return true; } }).position(8).reg(); @@ -1105,9 +1101,8 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { final RecordingLocalIndexInfo ri = (RecordingLocalIndexInfo) info; OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { playRecording(la, ri.rec); - return true; } }; if (ri.rec.isPhoto()) { @@ -1123,13 +1118,13 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { .icons(R.drawable.ic_action_marker_dark, R.drawable.ic_action_marker_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { SHOW_RECORDINGS.set(true); app.getSettings().setMapLocationToShow(ri.rec.lat, ri.rec.lon, app.getSettings().getLastKnownMapZoom()); MapActivity.launchMapActivityMoveToTop(la); - return true; + } }).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/configuremap/ConfigureSettingsMenu.java b/OsmAnd/src/net/osmand/plus/configuremap/ConfigureSettingsMenu.java deleted file mode 100644 index 5cca16e0d6..0000000000 --- a/OsmAnd/src/net/osmand/plus/configuremap/ConfigureSettingsMenu.java +++ /dev/null @@ -1,527 +0,0 @@ -package net.osmand.plus.configuremap; - -import android.app.AlertDialog; -import android.content.DialogInterface; -import android.content.Intent; -import android.graphics.Typeface; -import android.os.Build; -import android.preference.*; -import android.util.TypedValue; -import android.view.KeyEvent; -import android.view.View; -import android.view.ViewGroup; -import android.widget.*; -import net.osmand.CallbackWithObject; -import net.osmand.access.AccessibleToast; -import net.osmand.data.AmenityType; -import net.osmand.plus.*; -import net.osmand.plus.activities.*; -import net.osmand.plus.helpers.GpxUiHelper; -import net.osmand.plus.render.RenderingIcons; -import net.osmand.plus.views.mapwidgets.AppearanceWidgetsFactory; -import net.osmand.plus.views.mapwidgets.MapWidgetRegistry; -import net.osmand.render.RenderingRuleProperty; -import net.osmand.render.RenderingRulesStorage; - -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; - -/** - * Created by Denis on 14.10.2014. - */ -public class ConfigureSettingsMenu { - - public static final int BACK_HEADER = 0; - public static final int HEADER = 1; - public static final int LAYER = 2; - public static final int MAP_REDNDER = 3; - public static final int RENDERING_PROPERTY = 4; - - - private ListView listView; - private OsmandApplication app; - List items = new ArrayList(); - - public class ConfigureMapMenuItem { - int nameId; - int type; - int darkIcon = -1; - int lightIcon = -1; - Object preference; - - - ConfigureMapMenuItem(int type, int name, int darkIcon, int whiteIcon, Object preference) { - this.type = type; - this.nameId = name; - this.darkIcon = darkIcon; - this.lightIcon = whiteIcon; - this.preference = preference; - } - } - - public ConfigureSettingsMenu(OsmandApplication app) { - this.app = app; - } - - public void setListView(ListView list) { - this.listView = list; - listView.setAdapter(createSettingsAdapter()); - listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { - @Override - public void onItemClick(AdapterView adapterView, View view, int pos, long l) { - onMenuItemClick(items.get(pos), (CheckBox) view.findViewById(R.id.check)); - } - }); - } - - //checkBox should be set only if u have checkBox preference - private void onMenuItemClick(ConfigureMapMenuItem item, CheckBox ch) { - if (item.type == BACK_HEADER){ - app.getMapActivity().getMapActions().createOptionsMenuAsDrawer(false); - } else if (item.type == LAYER) { - if (ch != null){ - ch.setChecked(!ch.isChecked()); - } - - if (item.nameId == R.string.layer_poi) { - final OsmandSettings.OsmandPreference pref = (OsmandSettings.OsmandPreference) item.preference; - boolean value = !pref.get(); - if (value) { - selectPOIFilterLayer(null); - } - pref.set(!pref.get()); - } else if (item.nameId == R.string.layer_gpx_layer) { - if(app.getSelectedGpxHelper().isShowingAnyGpxFiles()){ - app.getSelectedGpxHelper().clearAllGpxFileToShow(); - } else { - showGPXFileDialog(null); - } - } else { - final OsmandSettings.OsmandPreference pref = (OsmandSettings.OsmandPreference) item.preference; - pref.set(!pref.get()); - } - } else if (item.type == MAP_REDNDER) { - if (item.nameId == R.string.map_widget_renderer) { - AlertDialog.Builder bld = new AlertDialog.Builder(app.getMapActivity()); - bld.setTitle(R.string.renderers); - Collection rendererNames = app.getRendererRegistry().getRendererNames(); - final String[] items = rendererNames.toArray(new String[rendererNames.size()]); - final String[] visibleNames = new String[items.length]; - int selected = -1; - final String selectedName = app.getRendererRegistry().getCurrentSelectedRenderer().getName(); - for (int j = 0; j < items.length; j++) { - if (items[j].equals(selectedName)) { - selected = j; - } - visibleNames[j] = items[j].replace('_', ' ').replace( - '-', ' '); - } - bld.setSingleChoiceItems(visibleNames, selected, new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - String renderer = items[which]; - RenderingRulesStorage loaded = app.getRendererRegistry().getRenderer(renderer); - if (loaded != null) { - app.getSettings().RENDERER.set(renderer); - app.getRendererRegistry().setCurrentSelectedRender(loaded); - app.getResourceManager().getRenderer().clearCache(); - listView.setAdapter(createSettingsAdapter()); - } else { - AccessibleToast.makeText(app, R.string.renderer_load_exception, Toast.LENGTH_SHORT).show(); - } - dialog.dismiss(); - createSettingsAdapter(); - } - }); - bld.show(); - } else if (item.nameId == R.string.map_widget_day_night) { - AlertDialog.Builder bld = new AlertDialog.Builder(app.getMapActivity()); - bld.setTitle(R.string.daynight); - final String[] items = new String[OsmandSettings.DayNightMode.values().length]; - for (int i = 0; i < items.length; i++) { - items[i] = OsmandSettings.DayNightMode.values()[i].toHumanString(app); - } - int i = app.getSettings().DAYNIGHT_MODE.get().ordinal(); - bld.setSingleChoiceItems(items, i, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - app.getSettings().DAYNIGHT_MODE.set(OsmandSettings.DayNightMode.values()[which]); - app.getResourceManager().getRenderer().clearCache(); - dialog.dismiss(); - } - }); - bld.show(); - } - } else if (item.type == RENDERING_PROPERTY) { - if (ch != null){ - ch.setChecked(!ch.isChecked()); - } - final RenderingRuleProperty p = (RenderingRuleProperty) item.preference; - final String propertyDescription = SettingsActivity.getStringPropertyDescription(app, p.getAttrName(), p.getName()); - if (p.isBoolean()) { - final OsmandSettings.CommonPreference pref = app.getSettings().getCustomRenderBooleanProperty(p.getAttrName()); - pref.set(!pref.get()); - app.getResourceManager().getRenderer().clearCache(); - } else { - final OsmandSettings.CommonPreference pref = app.getSettings().getCustomRenderProperty(p.getAttrName()); - AlertDialog.Builder b = new AlertDialog.Builder(app.getMapActivity()); - //test old descr as title - b.setTitle(propertyDescription); - - int i = Arrays.asList(p.getPossibleValues()).indexOf(pref.get()); - - String[] possibleValuesString = new String[p.getPossibleValues().length]; - - for (int j = 0; j < p.getPossibleValues().length; j++) { - possibleValuesString[j] = SettingsActivity.getStringPropertyValue(app, p.getPossibleValues()[j]); - } - - b.setSingleChoiceItems(possibleValuesString, i, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - pref.set(p.getPossibleValues()[which]); - app.getResourceManager().getRenderer().clearCache(); - dialog.dismiss(); - } - }); - b.show(); - - } - } - app.getMapActivity().getMapLayers().updateLayers(app.getMapActivity().getMapView()); - app.getMapActivity().getMapView().refreshMap(); - } - - private ArrayAdapter createSettingsAdapter() { - items.clear(); - items.add(new ConfigureMapMenuItem(BACK_HEADER, R.string.configure_map, R.drawable.ic_back_drawer_dark, R.drawable.ic_back_drawer_white, null)); - createLayersItems(items); - createRenderingAttributeItems(items); - return new ArrayAdapter(app, R.layout.map_settings_item, items) { - @Override - public View getView(int position,View convertView, ViewGroup parent) { - if (convertView == null) { - convertView = app.getMapActivity().getLayoutInflater().inflate(R.layout.map_settings_item, null); - } - final ConfigureMapMenuItem item = getItem(position); - prepareView(convertView, item); - if (item.type == BACK_HEADER) { - ((TextView) convertView.findViewById(R.id.name)).setText(item.nameId); - ImageButton button = (ImageButton) convertView.findViewById(R.id.back); - button.setImageResource(getIcon(item)); - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - app.getMapActivity().getMapActions().createOptionsMenuAsDrawer(false); - } - }); - } else if (item.type == HEADER) { - ((TextView) convertView.findViewById(R.id.name)).setText((String) item.preference); - } else if (item.type == LAYER) { - ((TextView) convertView.findViewById(R.id.name)).setText(item.nameId); - final CheckBox ch = (CheckBox) convertView.findViewById(R.id.check); - ch.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - onMenuItemClick(item, null); - } - }); - if (item.nameId == R.string.layer_gpx_layer){ - ch.setChecked(app.getSelectedGpxHelper().isShowingAnyGpxFiles()); - } else { - OsmandSettings.OsmandPreference pref = (OsmandSettings.OsmandPreference) item.preference; - ch.setChecked(pref.get()); - } - } else if (item.type == MAP_REDNDER) { - ((TextView) convertView.findViewById(R.id.name)).setText(item.nameId); - if (item.nameId == R.string.map_widget_renderer) { - ((TextView) convertView.findViewById(R.id.descr)).setText(app.getSettings().RENDERER.get()); - } else if (item.nameId == R.string.map_widget_day_night) { - ((TextView) convertView.findViewById(R.id.descr)).setText(app.getSettings().DAYNIGHT_MODE.get().toHumanString(app)); - } - } else if (item.type == RENDERING_PROPERTY) { - convertView.findViewById(R.id.icon).setVisibility(View.GONE); - final RenderingRuleProperty p = (RenderingRuleProperty) item.preference; - String propertyName = SettingsActivity.getStringPropertyName(app, p.getAttrName(), p.getName()); - TextView header = (TextView) convertView.findViewById(R.id.name); - header.setText(propertyName); - header.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); - convertView.findViewById(R.id.icon).setVisibility(View.GONE); - final String propertyDescription = SettingsActivity.getStringPropertyDescription(app, p.getAttrName(), p.getName()); - if (p.isBoolean()) { - OsmandSettings.CommonPreference pref = app.getSettings().getCustomRenderBooleanProperty(p.getAttrName()); - final CheckBox ch = (CheckBox) convertView.findViewById(R.id.check); - ch.setChecked(pref.get()); - ch.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - onMenuItemClick(item, null); - } - }); - } - } - return convertView; - } - - //Hiding and showing items based on current item - //setting proper visual property - private void prepareView(View convertView, ConfigureMapMenuItem item) { - ((TextView) convertView.findViewById(R.id.descr)).setTypeface(null, Typeface.ITALIC); - - int type = item.type; - //setting name textview - if (type == BACK_HEADER) { - TextView header = (TextView) convertView.findViewById(R.id.name); - header.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22); - header.setTypeface(Typeface.DEFAULT_BOLD); - } else if (type == HEADER) { - TextView header = (TextView) convertView.findViewById(R.id.name); - header.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20); - header.setTypeface(Typeface.DEFAULT_BOLD); - } else { - TextView header = ((TextView) convertView.findViewById(R.id.name)); - header.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); - header.setTypeface(Typeface.DEFAULT); - - } - - //setting backbutton - if (type == BACK_HEADER) { - convertView.findViewById(R.id.back).setVisibility(View.VISIBLE); - } else { - convertView.findViewById(R.id.back).setVisibility(View.GONE); - } - //other elements - if (type == BACK_HEADER) { - convertView.findViewById(R.id.check).setVisibility(View.GONE); - convertView.findViewById(R.id.descr).setVisibility(View.GONE); - convertView.findViewById(R.id.icon).setVisibility(View.GONE); - } else if (type == HEADER) { - convertView.findViewById(R.id.icon).setVisibility(View.GONE); - convertView.findViewById(R.id.check).setVisibility(View.GONE); - convertView.findViewById(R.id.descr).setVisibility(View.GONE); - } else if (type == LAYER) { - ((ImageView) convertView.findViewById(R.id.icon)).setImageResource(getIcon(item)); - convertView.findViewById(R.id.icon).setVisibility(View.VISIBLE); - convertView.findViewById(R.id.check).setVisibility(View.VISIBLE); - } else if (type == MAP_REDNDER) { - convertView.findViewById(R.id.icon).setVisibility(View.GONE); - convertView.findViewById(R.id.check).setVisibility(View.GONE); - convertView.findViewById(R.id.descr).setVisibility(View.VISIBLE); - } else if (type == RENDERING_PROPERTY) { - final RenderingRuleProperty p = (RenderingRuleProperty) item.preference; - if (p.isBoolean()) { - convertView.findViewById(R.id.check).setVisibility(View.VISIBLE); - } else { - convertView.findViewById(R.id.check).setVisibility(View.GONE); - } - - } - } - - private int getIcon(ConfigureMapMenuItem item) { - if (app.getSettings().isLightContent()) { - return item.lightIcon; - } else { - return item.darkIcon; - } - } - - }; - } - - private void createLayersItems(List items) { - items.add(new ConfigureMapMenuItem(HEADER, -1, -1, -1, "Show:")); - items.add(new ConfigureMapMenuItem(LAYER, R.string.layer_poi, R.drawable.ic_action_info_dark, - R.drawable.ic_action_info_light, app.getSettings().SHOW_POI_OVER_MAP)); - items.add(new ConfigureMapMenuItem(LAYER, R.string.layer_amenity_label, R.drawable.ic_action_text_dark, - R.drawable.ic_action_text_light, app.getSettings().SHOW_POI_LABEL)); - items.add(new ConfigureMapMenuItem(LAYER, R.string.layer_favorites, R.drawable.ic_action_fav_dark, - R.drawable.ic_action_fav_light, app.getSettings().SHOW_FAVORITES)); - items.add(new ConfigureMapMenuItem(LAYER, R.string.layer_gpx_layer, R.drawable.ic_action_polygom_dark, - R.drawable.ic_action_polygom_light, null)); - items.add(new ConfigureMapMenuItem(LAYER, R.string.layer_transport, R.drawable.ic_action_bus_dark, - R.drawable.ic_action_bus_light, app.getSettings().SHOW_TRANSPORT_OVER_MAP)); - if (TransportRouteHelper.getInstance().routeIsCalculated()) { - items.add(new ConfigureMapMenuItem(R.string.layer_transport, LAYER, - R.drawable.ic_action_bus_dark, R.drawable.ic_action_bus_light, 1)); - } - } - - private void createRenderingAttributeItems(List items) { - items.add(new ConfigureMapMenuItem(HEADER, -1, -1, -1, app.getString(R.string.map_widget_map_rendering))); - items.add(new ConfigureMapMenuItem(MAP_REDNDER, R.string.map_widget_renderer, -1, -1, null)); - items.add(new ConfigureMapMenuItem(MAP_REDNDER, R.string.map_widget_day_night, -1, -1, null)); - - RenderingRulesStorage renderer = app.getRendererRegistry().getCurrentSelectedRenderer(); - if (renderer != null && AppearanceWidgetsFactory.EXTRA_SETTINGS) { - createMapRenderingPreferences(items); - } - } - - private void createMapRenderingPreferences(List items) { - items.add(new ConfigureMapMenuItem(HEADER, -1, -1, -1, app.getString(R.string.map_widget_vector_attributes))); - RenderingRulesStorage renderer = app.getRendererRegistry().getCurrentSelectedRenderer(); - List customRules = renderer.PROPS.getCustomRules(); - for (RenderingRuleProperty p : customRules) { - items.add(new ConfigureMapMenuItem(RENDERING_PROPERTY, -1, -1, -1, p)); - } - } - - public AlertDialog selectPOIFilterLayer(final PoiFilter[] selected) { - final List userDefined = new ArrayList(); - final PoiFiltersHelper poiFilters = app.getPoiFilters(); - final ContextMenuAdapter adapter = new ContextMenuAdapter(app.getMapActivity()); - - ContextMenuAdapter.Item is = adapter.item(app.getString(R.string.any_poi)); - if (RenderingIcons.containsBigIcon("null")) { - is.icon(RenderingIcons.getBigIconResourceId("null")); - } - is.reg(); - // 2nd custom - adapter.item(app.getString(R.string.poi_filter_custom_filter)).icon(RenderingIcons.getBigIconResourceId("user_defined")).reg(); - - for (PoiFilter f : poiFilters.getUserDefinedPoiFilters()) { - ContextMenuAdapter.Item it = adapter.item(f.getName()); - if (RenderingIcons.containsBigIcon(f.getSimplifiedId())) { - it.icon(RenderingIcons.getBigIconResourceId(f.getSimplifiedId())); - } else { - it.icon(RenderingIcons.getBigIconResourceId("user_defined")); - } - it.reg(); - userDefined.add(f); - } - final AmenityType[] categories = AmenityType.getCategories(); - for (AmenityType t : categories) { - ContextMenuAdapter.Item it = adapter.item(OsmAndFormatter.toPublicString(t, app)); - if (RenderingIcons.containsBigIcon(t.toString().toLowerCase())) { - it.icon(RenderingIcons.getBigIconResourceId(t.toString().toLowerCase())); - } - it.reg(); - } - final AlertDialog.Builder builder = new AlertDialog.Builder(app.getMapActivity()); - final ListAdapter listAdapter; - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { - listAdapter = - adapter.createListAdapter(app.getMapActivity(), R.layout.list_menu_item, app.getSettings().isLightContentMenu()); - } else { - listAdapter = - adapter.createListAdapter(app.getMapActivity(), R.layout.list_menu_item_native, app.getSettings().isLightContentMenu()); - } - builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - if (which == 1) { - String filterId = PoiFilter.CUSTOM_FILTER_ID; - app.getSettings().setPoiFilterForMap(filterId); - Intent newIntent = new Intent(app, EditPOIFilterActivity.class); - newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, filterId); - newIntent.putExtra(EditPOIFilterActivity.SEARCH_LAT, app.getMapActivity().getMapView().getLatitude()); - newIntent.putExtra(EditPOIFilterActivity.SEARCH_LON, app.getMapActivity().getMapView().getLongitude()); - app.getMapActivity().startActivity(newIntent); - } else { - String filterId; - if (which == 0) { - filterId = PoiFiltersHelper.getOsmDefinedFilterId(null); - } else if (which <= userDefined.size() + 1) { - filterId = userDefined.get(which - 2).getFilterId(); - } else { - filterId = PoiFiltersHelper.getOsmDefinedFilterId(categories[which - userDefined.size() - 2]); - } - app.getSettings().setPoiFilterForMap(filterId); - PoiFilter f = poiFilters.getFilterById(filterId); - if (f != null) { - f.clearNameFilter(); - } - app.getMapActivity().getMapLayers().setPoiFilter(f); - app.getMapActivity().getMapView().refreshMap(); - if (selected != null && selected.length > 0) { - selected[0] = f; - } - listView.setAdapter(createSettingsAdapter()); - } - } - - }); - builder.setOnKeyListener(new DialogInterface.OnKeyListener() { - @Override - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent event) { - if (i == KeyEvent.KEYCODE_BACK && - event.getAction() == KeyEvent.ACTION_UP && - !event.isCanceled()) { - dialogInterface.cancel(); - app.getSettings().SHOW_POI_OVER_MAP.set(false); - listView.setAdapter(createSettingsAdapter()); - return true; - } - return false; - } - }); - return builder.show(); - } - - public void showGPXFileDialog(List files) { - CallbackWithObject callbackWithObject = new CallbackWithObject() { - @Override - public boolean processResult(GPXUtilities.GPXFile[] result) { - GPXUtilities.WptPt locToShow = null; - for (GPXUtilities.GPXFile g : result) { - if (g.showCurrentTrack) { - if (!app.getSettings().SAVE_TRACK_TO_GPX.get() && ! - app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()) { - AccessibleToast.makeText(app.getMapActivity(), R.string.gpx_monitoring_disabled_warn, Toast.LENGTH_SHORT).show(); - } - break; - } - if (!g.showCurrentTrack || locToShow == null) { - locToShow = g.findPointToShow(); - } - } - app.getSelectedGpxHelper().setGpxFileToDisplay(result); - listView.setAdapter(createSettingsAdapter()); - return true; - } - }; - - AlertDialog dialog; - if (files == null) { - dialog = GpxUiHelper.selectGPXFile(app.getMapActivity(), true, true, callbackWithObject); - } else { - dialog = GpxUiHelper.selectGPXFile(files, app.getMapActivity(), true, true, callbackWithObject); - } - if (dialog != null) { - dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { - @Override - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent event) { - if (i == KeyEvent.KEYCODE_BACK && - event.getAction() == KeyEvent.ACTION_UP && - !event.isCanceled()) { - dialogInterface.cancel(); - listView.setAdapter(createSettingsAdapter()); - return true; - } - return false; - } - }); - } - } - - private List getAlreadySelectedGpx() { - GpxSelectionHelper gpxSelectionHelper = app.getSelectedGpxHelper(); - if (gpxSelectionHelper == null) { - return null; - } - List selectedGpxFiles = gpxSelectionHelper.getSelectedGPXFiles(); - List files = new ArrayList(); - for (GpxSelectionHelper.SelectedGpxFile file : selectedGpxFiles) { - files.add(file.getGpxFile().path); - } - return files; - } - -} diff --git a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java index 781f387705..01f967f65f 100644 --- a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java +++ b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java @@ -584,7 +584,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.delete_point) { for (int i = 0; i < measurementPoints.size(); i++) { Iterator it = measurementPoints.get(i).iterator(); @@ -596,7 +596,6 @@ public class DistanceCalculatorPlugin extends OsmandPlugin { } calculateDistance(); } - return true; } }; adapter.item(R.string.delete_point).icons(R.drawable.ic_action_delete_dark, diff --git a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java index 96dcc4b41a..c4713e031a 100644 --- a/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/LocalIndexesFragment.java @@ -158,7 +158,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { private void basicFileOperation(final LocalIndexInfo info, ContextMenuAdapter adapter) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.local_index_mi_rename) { renameFile(info); } else if (resId == R.string.local_index_mi_restore) { @@ -177,7 +177,6 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { } else if (resId == R.string.local_index_mi_backup) { new LocalIndexOperationTask(BACKUP_OPERATION).execute(info); } - return true; } }; if(info.getType() == LocalIndexType.MAP_DATA || info.getType() == LocalIndexType.SRTM_DATA){ @@ -476,9 +475,8 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment { optionsMenuAdapter = new ContextMenuAdapter(getDownloadActivity()); OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { localOptionsMenu(itemId); - return true; } }; optionsMenuAdapter.item(R.string.local_index_mi_reload) diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index 8638557d74..0366481bad 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -128,7 +128,7 @@ public class GpxUiHelper { return description.toString(); } - public static AlertDialog selectGPXFile(List selectedGpxList, final Activity activity, + public static void selectGPXFile(List selectedGpxList, final Activity activity, final boolean showCurrentGpx, final boolean multipleChoice, final CallbackWithObject callbackWithObject){ OsmandApplication app = (OsmandApplication) activity.getApplication(); final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); @@ -142,12 +142,11 @@ public class GpxUiHelper { allGpxList.add(0, activity.getString(R.string.show_current_gpx_title)); } final ContextMenuAdapter adapter = createGpxContextMenuAdapter(activity,allGpxList, selectedGpxList, multipleChoice); - return createDialog(activity, showCurrentGpx, multipleChoice, callbackWithObject, allGpxList, adapter); + createDialog(activity, showCurrentGpx, multipleChoice, callbackWithObject, allGpxList, adapter); } - return null; } - public static AlertDialog selectGPXFile(final Activity activity, + public static void selectGPXFile(final Activity activity, final boolean showCurrentGpx, final boolean multipleChoice, final CallbackWithObject callbackWithObject) { OsmandApplication app = (OsmandApplication) activity.getApplication(); final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR); @@ -161,9 +160,8 @@ public class GpxUiHelper { } final ContextMenuAdapter adapter = createGpxContextMenuAdapter(activity, list, null, multipleChoice); - return createDialog(activity, showCurrentGpx, multipleChoice, callbackWithObject, list, adapter); + createDialog(activity, showCurrentGpx, multipleChoice, callbackWithObject, list, adapter); } - return null; } private static ContextMenuAdapter createGpxContextMenuAdapter(Activity activity, List allGpxList, List selectedGpxList, boolean multipleChoice) { @@ -209,7 +207,7 @@ public class GpxUiHelper { }, dir, null, filename); } - private static AlertDialog createDialog(final Activity activity, final boolean showCurrentGpx, + private static void createDialog(final Activity activity, final boolean showCurrentGpx, final boolean multipleChoice, final CallbackWithObject callbackWithObject, final List list, final ContextMenuAdapter adapter) { final OsmandApplication app = (OsmandApplication) activity.getApplication(); @@ -338,7 +336,6 @@ public class GpxUiHelper { // java.lang.ClassCastException: com.android.internal.widget.RoundCornerListAdapter // Unknown reason but on some devices fail } - return dlg; } private static List getSortedGPXFilenames(File dir,String sub) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index f7053535f8..ce4b560020 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -3,6 +3,7 @@ package net.osmand.plus.helpers; import java.util.ArrayList; import java.util.List; +import android.support.v4.widget.DrawerLayout; import android.widget.*; import net.osmand.Location; import net.osmand.data.LatLon; @@ -12,7 +13,6 @@ import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener; import net.osmand.plus.OsmandApplication; import net.osmand.plus.PoiFilter; import net.osmand.plus.R; -import net.osmand.plus.activities.IntermediatePointsDialog; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.WaypointHelper.LocationPointWrapper; import net.osmand.plus.views.AnimateDraggingMapThread; @@ -44,9 +44,6 @@ public class WaypointDialogHelper implements OsmAndLocationListener { private LinearLayout mainLayout; private WaypointHelper waypointHelper; - private final static String POI_RADIUS = "poi_radius"; - private final static String SEARCH_RADIUS = "favorite_radius"; - public final static boolean OVERLAP_LAYOUT = true; // only true is supported private View closePointDialog; private List many = new ArrayList(); @@ -194,16 +191,14 @@ public class WaypointDialogHelper implements OsmAndLocationListener { public static void showWaypointsDialogFlat(FragmentActivity fragmentActivity) { Bundle args = new Bundle(); args.putBoolean(WaypointDialogFragment.FLAT_ARG, true); - //TODO remove this method totally - WaypointDialogFragment wdf = new WaypointDialogFragment(new WaypointDialogHelper(null)); + WaypointDialogFragment wdf = new WaypointDialogFragment(); wdf.setArguments(args); fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit(); } public static void showWaypointsDialog(FragmentActivity fragmentActivity) { Bundle args = new Bundle(); - //TODO remove this method totally - WaypointDialogFragment wdf = new WaypointDialogFragment(new WaypointDialogHelper(null)); + WaypointDialogFragment wdf = new WaypointDialogFragment(); wdf.setArguments(args); fragmentActivity.getSupportFragmentManager().beginTransaction().add(wdf, "tag").commit(); } @@ -212,14 +207,9 @@ public class WaypointDialogHelper implements OsmAndLocationListener { WaypointHelper waypointHelper; private OsmandApplication app; - private WaypointDialogHelper dialogHelper; public static final String FLAT_ARG = "FLAT_ARG"; - public WaypointDialogFragment(WaypointDialogHelper helper){ - this.dialogHelper = helper; - } - @Override public void onAttach(Activity activity) { super.onAttach(activity); @@ -229,7 +219,80 @@ public class WaypointDialogHelper implements OsmAndLocationListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - return createWaypointsDialogFlat(waypointHelper.getAllPoints()); + if (getArguments() != null && getArguments().getBoolean(FLAT_ARG)) { + return createWaypointsDialogFlat(waypointHelper.getAllPoints()); + } + return createWaypointsDialog(); + } + + private void selectPoi(final int[] running, final ArrayAdapter listAdapter, final int type, + final boolean enable) { + if (getActivity() instanceof MapActivity && !PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) { + MapActivity map = (MapActivity) getActivity(); + final PoiFilter[] selected = new PoiFilter[1]; + AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected); + dlg.setOnDismissListener(new OnDismissListener() { + + @Override + public void onDismiss(DialogInterface dialog) { + if (selected != null) { + enableType(running, listAdapter, type, enable); + } + } + }); + } else { + enableType(running, listAdapter, type, enable); + } + } + + private void enableType(final int[] running, final ArrayAdapter listAdapter, final int type, + final boolean enable) { + new AsyncTask() { + + protected void onPreExecute() { + } + + ; + + @Override + protected Void doInBackground(Void... params) { + app.getWaypointHelper().enableWaypointType(type, enable); + return null; + } + + protected void onPostExecute(Void result) { + running[0] = -1; + listAdapter.clear(); + for (Object point : getPoints()) { + listAdapter.add(point); + } + listAdapter.notifyDataSetChanged(); + } + }.execute((Void) null); + } + + protected String getHeader(int type, boolean checked) { + FragmentActivity ctx = getActivity(); + String str = ctx.getString(R.string.waypoints); + switch (type) { + case WaypointHelper.TARGETS: + str = ctx.getString(R.string.targets); + break; + case WaypointHelper.ALARMS: + str = ctx.getString(R.string.way_alarms); + break; + case WaypointHelper.FAVORITES: + str = ctx.getString(R.string.my_favorites); + break; + case WaypointHelper.WAYPOINTS: + str = ctx.getString(R.string.waypoints); + break; + case WaypointHelper.POI: + str = waypointHelper.getPoiFilter() == null || !checked ? ctx.getString(R.string.poi) : waypointHelper + .getPoiFilter().getName(); + break; + } + return str; } public AlertDialog createWaypointsDialogFlat(final List points) { @@ -285,6 +348,113 @@ public class WaypointDialogHelper implements OsmAndLocationListener { return builder.create(); } + public AlertDialog createWaypointsDialog() { + final List points = getPoints(); + final List deletedPoints = new ArrayList(); + final FragmentActivity ctx = getActivity(); + final ListView listView = new ListView(ctx); + final int[] running = new int[]{-1}; + final ArrayAdapter listAdapter = new ArrayAdapter(ctx, + R.layout.waypoint_reached, R.id.title, points) { + @Override + public View getView(final int position, View convertView, ViewGroup parent) { + // User super class to create the View + View v = convertView; + final ArrayAdapter thisAdapter = this; + boolean labelView = (getItem(position) instanceof Integer); + boolean viewText = v != null && v.findViewById(R.id.info_close) == null; + if (v == null || viewText != labelView) { + v = ctx.getLayoutInflater().inflate(labelView ? R.layout.waypoint_header : R.layout.waypoint_reached, null); + } + if (labelView) { + final int type = (Integer) getItem(position); + final CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item); + btn.setVisibility(waypointHelper.isTypeConfigurable(type) ? View.VISIBLE : View.GONE); + btn.setOnCheckedChangeListener(null); + final boolean checked = waypointHelper.isTypeEnabled(type); + btn.setChecked(checked); + btn.setEnabled(running[0] == -1); + v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE); + btn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + running[0] = position; + thisAdapter.notifyDataSetInvalidated(); + if (type == WaypointHelper.POI && isChecked) { + selectPoi(running, thisAdapter, type, isChecked); + } else { + enableType(running, thisAdapter, type, isChecked); + } + } + + }); + TextView tv = (TextView) v.findViewById(R.id.header_text); + tv.setText(getHeader(type, checked)); + } else { + updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), WaypointDialogFragment.this); + View remove = v.findViewById(R.id.info_close); + ((ImageButton) remove).setImageDrawable(ctx.getResources().getDrawable( + app.getSettings().isLightContent() ? R.drawable.ic_action_gremove_light + : R.drawable.ic_action_gremove_dark)); + remove.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + LocationPointWrapper point = (LocationPointWrapper) points.get(position); + remove(point); + deletedPoints.add(point); + notifyDataSetChanged(); + } + }); + } + return v; + } + }; + + listView.setAdapter(listAdapter); + listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int item, long l) { + if (listAdapter.getItem(item) instanceof LocationPointWrapper) { + LocationPointWrapper ps = (LocationPointWrapper) listAdapter.getItem(item); + showOnMap(app, ctx, ps.getPoint(), WaypointDialogFragment.this); + } + } + }); + AlertDialog.Builder builder = new AlertDialog.Builder(ctx); + builder.setView(listView); + builder.setNeutralButton(R.string.flat_list_waypoints, new OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + showWaypointsDialogFlat(getActivity()); + } + + }); + builder.setPositiveButton(R.string.default_buttons_ok, new OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + waypointHelper.removeVisibleLocationPoint(deletedPoints); + } + }); + builder.setNegativeButton(ctx.getString(R.string.default_buttons_cancel), null); + return builder.create(); + } + + protected List getPoints() { + final List points = new ArrayList(); + for (int i = 0; i < WaypointHelper.MAX; i++) { + List tp = waypointHelper.getWaypoints(i); + if (waypointHelper.isTypeVisible(i)) { + points.add(new Integer(i)); + if (tp != null && tp.size() > 0) { + points.addAll(tp); + } + } + } + return points; + } } @@ -320,257 +490,5 @@ public class WaypointDialogHelper implements OsmAndLocationListener { } } - public ArrayAdapter getWaypointsAdapter(final Activity ctx, final List deletedPoints){ - final List points = getPoints(); - final int[] running = new int[]{-1}; - return new ArrayAdapter(ctx, - R.layout.waypoint_reached, R.id.title, points) { - @Override - public View getView(final int position, View convertView, ViewGroup parent) { - // User super class to create the View - View v = convertView; - final ArrayAdapter thisAdapter = this; - boolean labelView = (getItem(position) instanceof Integer); - boolean viewText = v != null && v.findViewById(R.id.info_close) == null; - if (v == null || viewText != labelView) { - v = ctx.getLayoutInflater().inflate(labelView ? R.layout.waypoint_header : R.layout.waypoint_reached, null); - } - if (getItem(position) instanceof String && getItem(position).equals(POI_RADIUS)){ - v = ctx.getLayoutInflater().inflate(R.layout.radius_search_list_element, null); - v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE); - final TextView radius = (TextView) v.findViewById(R.id.radius); - radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getPoiSearchDeviationRadius(), app)); - radius.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - int length = WaypointHelper.SEARCH_RADIUS_VALUES.length; - String[] names = new String[length]; - int selected = 0; - for (int i = 0; i < length; i++) { - names[i] = OsmAndFormatter.getFormattedDistance(WaypointHelper.SEARCH_RADIUS_VALUES[i], app); - if (WaypointHelper.SEARCH_RADIUS_VALUES[i] == waypointHelper.getPoiSearchDeviationRadius()){ - selected = i; - } - } - new AlertDialog.Builder(ctx) - .setSingleChoiceItems(names, selected, new OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - int value = WaypointHelper.SEARCH_RADIUS_VALUES[i]; - if (waypointHelper.getPoiSearchDeviationRadius() != value){ - running[0] = position; - thisAdapter.notifyDataSetInvalidated(); - waypointHelper.setPoiSearchDeviationRadius(value); - radius.setText(OsmAndFormatter.getFormattedDistance(value, app)); - recalculatePoints(running, thisAdapter, WaypointHelper.POI); - dialogInterface.dismiss(); - } - } - }).setTitle(app.getString(R.string.search_radius_proximity)+ " " + app.getString(R.string.poi)) - .setNegativeButton(R.string.default_buttons_cancel, null) - .show(); - } - }); - } else if (getItem(position) instanceof String && getItem(position).equals(SEARCH_RADIUS)){ - v = ctx.getLayoutInflater().inflate(R.layout.radius_search_list_element, null); - v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE); - final TextView radius = (TextView) v.findViewById(R.id.radius); - radius.setText(OsmAndFormatter.getFormattedDistance(waypointHelper.getSearchDeviationRadius(), app)); - radius.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - int length = WaypointHelper.SEARCH_RADIUS_VALUES.length; - String[] names = new String[length]; - int selected = 0; - for (int i = 0; i < length; i++) { - names[i] = OsmAndFormatter.getFormattedDistance(WaypointHelper.SEARCH_RADIUS_VALUES[i], app); - if (WaypointHelper.SEARCH_RADIUS_VALUES[i] == waypointHelper.getSearchDeviationRadius()){ - selected = i; - } - } - new AlertDialog.Builder(ctx) - .setSingleChoiceItems(names, selected, new OnClickListener() { - @Override - public void onClick(DialogInterface dialogInterface, int i) { - int value = WaypointHelper.SEARCH_RADIUS_VALUES[i]; - if (waypointHelper.getSearchDeviationRadius() != value){ - running[0] = position; - thisAdapter.notifyDataSetInvalidated(); - waypointHelper.setSearchDeviationRadius(value); - radius.setText(OsmAndFormatter.getFormattedDistance(value, app)); - recalculatePoints(running, thisAdapter, -1); - dialogInterface.dismiss(); - } - } - }).setTitle(app.getString(R.string.search_radius_proximity)) - .setNegativeButton(R.string.default_buttons_cancel, null) - .show(); - } - }); - } else if (labelView) { - v = ctx.getLayoutInflater().inflate(R.layout.waypoint_header, null); - final int type = (Integer) getItem(position); - ImageView sort = (ImageView) v.findViewById(R.id.sort); - //sort button in Destination header - if (type == 0 && sort != null){ - sort.setVisibility(View.VISIBLE); - if (app.getSettings().isLightContent()){ - sort.setImageResource(R.drawable.ic_sort_waypoint_white); - } else { - sort.setImageResource(R.drawable.ic_sort_waypoint_dark); - } - sort.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - IntermediatePointsDialog.openIntermediatePointsDialog(ctx, app, true); - } - }); - } - final CompoundButton btn = (CompoundButton) v.findViewById(R.id.check_item); - btn.setVisibility(waypointHelper.isTypeConfigurable(type) ? View.VISIBLE : View.GONE); - btn.setOnCheckedChangeListener(null); - final boolean checked = waypointHelper.isTypeEnabled(type); - btn.setChecked(checked); - btn.setEnabled(running[0] == -1); - v.findViewById(R.id.ProgressBar).setVisibility(position == running[0] ? View.VISIBLE : View.GONE); - btn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - running[0] = position; - thisAdapter.notifyDataSetInvalidated(); - if (type == WaypointHelper.POI && isChecked) { - selectPoi(running, thisAdapter, type, isChecked, mapActivity); - } else { - enableType(running, thisAdapter, type, isChecked); - } - } - - }); - TextView tv = (TextView) v.findViewById(R.id.header_text); - tv.setText(getHeader(ctx, type, checked)); - } else { - v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null); - updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), null); - View remove = v.findViewById(R.id.info_close); - ((ImageButton) remove).setImageDrawable(ctx.getResources().getDrawable( - app.getSettings().isLightContent() ? R.drawable.ic_action_gremove_light - : R.drawable.ic_action_gremove_dark)); - remove.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - LocationPointWrapper point = (LocationPointWrapper) points.get(position); - remove(point); - deletedPoints.add(point); - notifyDataSetChanged(); - } - }); - } - return v; - } - }; - } - - protected String getHeader(Activity ctx, int type, boolean checked) { - String str = ctx.getString(R.string.waypoints); - switch (type) { - case WaypointHelper.TARGETS: - str = ctx.getString(R.string.targets); - break; - case WaypointHelper.ALARMS: - str = ctx.getString(R.string.way_alarms); - break; - case WaypointHelper.FAVORITES: - str = ctx.getString(R.string.my_favorites); - break; - case WaypointHelper.WAYPOINTS: - str = ctx.getString(R.string.waypoints); - break; - case WaypointHelper.POI: - str = waypointHelper.getPoiFilter() == null || !checked ? ctx.getString(R.string.poi) : waypointHelper - .getPoiFilter().getName(); - break; - } - return str; - } - - private void selectPoi(final int[] running, final ArrayAdapter listAdapter, final int type, - final boolean enable, MapActivity map) { - if (!PoiFilter.CUSTOM_FILTER_ID.equals(app.getSettings().getPoiFilterForMap())) { - final PoiFilter[] selected = new PoiFilter[1]; - AlertDialog dlg = map.getMapLayers().selectPOIFilterLayer(map.getMapView(), selected); - dlg.setOnDismissListener(new OnDismissListener() { - - @Override - public void onDismiss(DialogInterface dialog) { - if (selected != null) { - enableType(running, listAdapter, type, enable); - } - } - }); - } else { - enableType(running, listAdapter, type, enable); - } - } - - private void recalculatePoints(final int[] running, final ArrayAdapter listAdapter, final int type){ - new AsyncTask() { - - @Override - protected Void doInBackground(Void... params) { - app.getWaypointHelper().recalculatePoints(type); - return null; - } - - protected void onPostExecute(Void result) { - running[0] = -1; - listAdapter.clear(); - for (Object point : getPoints()) { - listAdapter.add(point); - } - listAdapter.notifyDataSetChanged(); - } - }.execute((Void) null); - } - - protected List getPoints() { - final List points = new ArrayList(); - for (int i = 0; i < WaypointHelper.MAX; i++) { - List tp = waypointHelper.getWaypoints(i); - if (waypointHelper.isTypeVisible(i)) { - points.add(new Integer(i)); - if (i == WaypointHelper.POI && waypointHelper.isTypeEnabled(WaypointHelper.POI)){ - points.add(POI_RADIUS); - } else if (i == WaypointHelper.FAVORITES && waypointHelper.isTypeEnabled(WaypointHelper.FAVORITES)){ - points.add(SEARCH_RADIUS); - } - if (tp != null && tp.size() > 0) { - points.addAll(tp); - } - } - } - return points; - } - - private void enableType(final int[] running, final ArrayAdapter listAdapter, final int type, - final boolean enable) { - new AsyncTask() { - - @Override - protected Void doInBackground(Void... params) { - app.getWaypointHelper().enableWaypointType(type, enable); - return null; - } - - protected void onPostExecute(Void result) { - running[0] = -1; - listAdapter.clear(); - for (Object point : getPoints()) { - listAdapter.add(point); - } - listAdapter.notifyDataSetChanged(); - } - }.execute((Void) null); - } } diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index ef6bdd8d43..22eba272f7 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -44,7 +44,6 @@ public class WaypointHelper { private static final int ANNOUNCED_DONE = 2; private int searchDeviationRadius = 500; - private int poiSearchDeviationRadius = 150; private static final int LONG_ANNOUNCE_RADIUS = 700; private static final int SHORT_ANNOUNCE_RADIUS = 150; private static final int ALARMS_ANNOUNCE_RADIUS = 150; @@ -57,7 +56,6 @@ public class WaypointHelper { public static final int FAVORITES = 3; public static final int ALARMS = 4; public static final int MAX = 5; - public static final int[] SEARCH_RADIUS_VALUES = {50, 100, 250, 500, 1000, 1500}; private List> locationPoints = new ArrayList>(); private ConcurrentHashMap locationPointsStates = new ConcurrentHashMap(); @@ -212,9 +210,7 @@ public class WaypointHelper { recalculatePoints(route, type, locationPoints); } - public void recalculatePoints(int type){ - recalculatePoints(route, type, locationPoints); - } + public boolean isTypeConfigurable(int waypointType) { @@ -510,7 +506,7 @@ public class WaypointHelper { PoiFilter pf = getPoiFilter(); if (pf != null) { final List locs = route.getImmutableAllLocations(); - List amenities = app.getResourceManager().searchAmenitiesOnThePath(locs, getPoiSearchDeviationRadius(), + List amenities = app.getResourceManager().searchAmenitiesOnThePath(locs, getSearchRadius(POI), pf, new ResultMatcher() { @Override @@ -537,6 +533,12 @@ public class WaypointHelper { } + protected int getSearchRadius(int type) { + // app.getAppCustomization().getWaypointSearchRadius(searchDeviationRadius, type); + return searchDeviationRadius; + } + + private void calculateAlarms(RouteCalculationResult route, List array) { for(AlarmInfo i : route.getAlarmInfo()) { @@ -575,7 +577,7 @@ public class WaypointHelper { int[] ind = new int[1]; for(LocationPoint p : points) { float dist = dist(p, immutableAllLocations, ind); - if(dist <= getSearchDeviationRadius() && type != POI) { + if(dist <= getSearchRadius(type)) { LocationPointWrapper lpw = new LocationPointWrapper(rt, type, p, dist, ind[0]); lpw.setAnnounce(announce); locationPoints.add(lpw); @@ -703,22 +705,6 @@ public class WaypointHelper { } } - - public int getSearchDeviationRadius(){ - return searchDeviationRadius; - } - - public void setSearchDeviationRadius(int radius){ - this.searchDeviationRadius = radius; - } - - public int getPoiSearchDeviationRadius() { - return poiSearchDeviationRadius; - } - - public void setPoiSearchDeviationRadius(int radius) { - this.poiSearchDeviationRadius = radius; - } private class AmenityLocationPoint implements LocationPoint { diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index 8df4641293..31e9291da8 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -115,11 +115,10 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn ContextMenuAdapter adapter, Object selectedObj) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.context_menu_item_add_waypoint) { mapActivity.getMapActions().addWaypoint(latitude, longitude); } - return true; } }; adapter.item(R.string.context_menu_item_add_waypoint).icons(R.drawable.ic_action_gnew_label_dark, R.drawable.ic_action_gnew_label_light) @@ -448,7 +447,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn int draw = !bgoff ? R.drawable.monitoring_rec_big : R.drawable.monitoring_rec_inactive; qa.item(msgId).icon(draw).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (view.getApplication().getNavigationService() == null) { final ValueHolder vs = new ValueHolder(); final ValueHolder choice = new ValueHolder(); @@ -466,7 +465,6 @@ public class OsmandMonitoringPlugin extends OsmandPlugin implements MonitoringIn } else { view.getContext().stopService(serviceIntent); } - return true; } }).position(0).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java index 080d2c1b9e..52fd47762a 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmBugsLayer.java @@ -495,13 +495,12 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.osb_comment_menu_item) { commentBug(bug); } else if (itemId == R.string.osb_close_menu_item) { closeBug(bug); } - return true; } }; adapter.item(R.string.osb_comment_menu_item).icons( diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 407d1067d6..ff8fdfef20 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -122,7 +122,7 @@ public class OsmEditingPlugin extends OsmandPlugin { final Object selectedObj) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.context_menu_item_create_poi) { getPoiActions(mapActivity).showCreateDialog(latitude, longitude); } else if (resId == R.string.context_menu_item_open_bug) { @@ -135,7 +135,6 @@ public class OsmEditingPlugin extends OsmandPlugin { } else if (resId == R.string.poi_context_menu_modify) { getPoiActions(mapActivity).showEditDialog((Amenity) selectedObj); } - return true; } }; if(selectedObj instanceof Amenity) { @@ -157,11 +156,10 @@ public class OsmEditingPlugin extends OsmandPlugin { .icons(R.drawable.ic_action_bug_dark, R.drawable.ic_action_bug_light).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.layer_osm_bugs) { settings.SHOW_OSM_BUGS.set(isChecked); } - return true; } }).position(7).reg(); @@ -180,9 +178,8 @@ public class OsmEditingPlugin extends OsmandPlugin { .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { sendGPXFiles(la, (AvailableGPXFragment) fragment, (GpxInfo) info); - return true; } }).reg(); } @@ -197,7 +194,7 @@ public class OsmEditingPlugin extends OsmandPlugin { .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { f.openSelectionMode(R.string.local_index_mi_upload_gpx, R.drawable.ic_action_gup_dark, R.drawable.ic_action_gup_light, new OnClickListener() { @Override @@ -207,7 +204,6 @@ public class OsmEditingPlugin extends OsmandPlugin { selectedItems.toArray(new GpxInfo[selectedItems.size()])); } }); - return true; } }).position(5).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java index 27a5ce28dd..fe681a56aa 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoPlugin.java @@ -136,14 +136,13 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer R.drawable.ic_action_gloc_light).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { OsMoDevice o = (OsMoDevice) selectedObj; double lat = o.getLastLocation() == null ? latitude : o.getLastLocation().getLatitude(); double lon = o.getLastLocation() == null ? longitude : o.getLastLocation().getLongitude(); mapActivity.getMapView().setLatLon(lat, lon); MapActivity.getMapViewTrackingUtilities().setMapLinkedToLocation(false); OsMoPositionLayer.setFollowTrackerId(o); - return true; } }).position(0).reg(); if(OsMoPositionLayer.getFollowDestinationId() != null) { @@ -151,10 +150,9 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer R.drawable.ic_action_close_light).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { OsMoPositionLayer.setFollowDestination(null); - return true; } }).position(0).reg(); @@ -163,14 +161,13 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer R.drawable.ic_action_flag_light).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { OsMoDevice o = (OsMoDevice) selectedObj; if(o.getLastLocation() != null) { TargetPointsHelper targets = mapActivity.getMyApplication().getTargetPointsHelper(); targets.navigateToPoint(new LatLon(o.getLastLocation().getLatitude(), o.getLastLocation().getLongitude()), true, -1); } OsMoPositionLayer.setFollowDestination(o); - return true; } }).position(1).reg(); } @@ -294,11 +291,10 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { final double lat = view.getLatitude(); final double lon = view.getLongitude(); tracker.sendCoordinate(lat, lon); - return true; } }).reg(); } @@ -325,10 +321,9 @@ public class OsMoPlugin extends OsmandPlugin implements MonitoringInfoControlSer helper.item(R.string.osmo_groups).icons(R.drawable.ic_action_eye_dark, R.drawable.ic_action_eye_light).position(6) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { Intent intent = new Intent(mapActivity, OsMoGroupsActivity.class); mapActivity.startActivity(intent); - return true; } }).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java index 459f87049b..9664add743 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java @@ -200,12 +200,11 @@ public class ParkingPositionPlugin extends OsmandPlugin { if (selectedObj == parkingPosition && parkingPosition != null) { OnContextMenuClick removeListener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if ((resId == R.string.context_menu_item_delete_parking_point)) { showDeleteDialog(mapActivity); } - return true; } }; adapter.item(R.string.context_menu_item_delete_parking_point) @@ -214,12 +213,11 @@ public class ParkingPositionPlugin extends OsmandPlugin { OnContextMenuClick addListener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.context_menu_item_add_parking_point) { showAddParkingDialog(mapActivity, latitude, longitude); } - return true; } }; adapter.item(R.string.context_menu_item_add_parking_point) @@ -421,9 +419,8 @@ public class ParkingPositionPlugin extends OsmandPlugin { helper.item(R.string.osmand_parking_delete) .icons(R.drawable.ic_action_remove_dark, R.drawable.ic_action_remove_light).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { showDeleteDialog(mapActivity); - return true; } }).reg(); diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index 30524217a5..577adeb357 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -186,7 +186,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { final MapActivityLayers layers = mapActivity.getMapLayers(); OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.layer_map) { dialog.dismiss(); layers.selectMapLayer(mapView); @@ -210,7 +210,6 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { mapActivity); } } - return true; } }; adapter.item(R.string.layer_map).icons(R.drawable.ic_action_globus_dark, R.drawable.ic_action_globus_light) @@ -229,14 +228,13 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { if (mapView.getMainLayer() instanceof MapTileLayer) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int resId, int pos, boolean isChecked, DialogInterface dialog) { if (resId == R.string.context_menu_item_update_map) { mapActivity.getMapActions().reloadTile(mapView.getZoom(), latitude, longitude); } else if (resId == R.string.context_menu_item_download_map) { DownloadTilesDialog dlg = new DownloadTilesDialog(mapActivity, (OsmandApplication) mapActivity.getApplication(), mapView); dlg.openDialog(); } - return true; } }; adapter.item(R.string.context_menu_item_update_map).icons(R.drawable.ic_action_refresh_dark, R.drawable.ic_action_refresh_light) diff --git a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java index d4f4055a42..abdea19a7f 100644 --- a/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java +++ b/OsmAnd/src/net/osmand/plus/routepointsnavigation/RoutePointsLayer.java @@ -75,7 +75,7 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye final GPXUtilities.WptPt point = (GPXUtilities.WptPt) o; ContextMenuAdapter.OnContextMenuClick listener = new ContextMenuAdapter.OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.mark_as_not_visited){ plugin.getCurrentRoute().markPoint(point,false); plugin.saveCurrentRoute(); @@ -91,7 +91,6 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye plugin.saveCurrentRoute(); } map.refreshMap(); - return true; } }; diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java index 503610ffd9..60cec5bfd6 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java @@ -513,9 +513,8 @@ public class SherpafyCustomization extends OsmAndAppCustomization { adapter.item(R.string.show_waypoint_information).icons(R.drawable.ic_action_info_dark, R.drawable.ic_action_info_light ).position(0) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { showFavoriteDialog(mapActivity, selectedStage, sf); - return true; } }).reg(); @@ -565,21 +564,19 @@ public class SherpafyCustomization extends OsmAndAppCustomization { R.drawable.ic_action_gremove_dark, R.drawable.ic_action_gremove_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { app.getSettings().SHOW_POI_OVER_MAP.set(false); mapActivity.getMapLayers().updateLayers(mapActivity.getMapView()); - return true; } }).reg(); } else { adapter.item(R.string.poi).icons(R.drawable.ic_action_layers_dark, R.drawable.ic_action_layers_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { mapActivity.getMapLayers().selectPOIFilterLayer(mapActivity.getMapView(), null); app.getSettings().SHOW_POI_OVER_MAP.set(true); mapActivity.getMapLayers().updateLayers(mapActivity.getMapView()); - return true; } }).reg(); } @@ -587,11 +584,10 @@ public class SherpafyCustomization extends OsmAndAppCustomization { adapter.item(R.string.sherpafy_tour_info_txt).icons(R.drawable.ic_action_info_dark, R.drawable.ic_action_info_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { Intent newIntent = new Intent(mapActivity, TourViewActivity.class); // newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mapActivity.startActivity(newIntent); - return true; } }).reg(); //complete stage @@ -601,10 +597,9 @@ public class SherpafyCustomization extends OsmAndAppCustomization { .icons(R.drawable.ic_action_finish_flag_dark, R.drawable.ic_action_finish_flag_light) .listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { markStageAsCompleted(stage); showCompleteStageFragment(mapActivity, stage, false); - return true; } }).reg(); } @@ -612,13 +607,12 @@ public class SherpafyCustomization extends OsmAndAppCustomization { adapter.item(R.string.context_menu_item_share_location).icons( R.drawable.ic_action_gshare_dark, R.drawable.ic_action_gshare_light).listen(new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (app.getLocationProvider().getLastKnownLocation() != null) { new ShareLocation(mapActivity).run(); } else { Toast.makeText(app, R.string.unknown_location, Toast.LENGTH_LONG).show(); } - return true; } }).reg(); } diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java index bbaf0446f5..db28d9df22 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java @@ -95,12 +95,11 @@ public class SRTMPlugin extends OsmandPlugin { public void registerLayerContextMenuActions(final OsmandMapTileView mapView, ContextMenuAdapter adapter, final MapActivity mapActivity) { OnContextMenuClick listener = new OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.layer_hillshade) { HILLSHADE.set(!HILLSHADE.get()); updateLayers(mapView, mapActivity); } - return true; } }; adapter.item(R.string.layer_hillshade).selected(HILLSHADE.get()? 1 : 0) diff --git a/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java b/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java index 605e2c5048..5044449f5a 100644 --- a/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/FavoritesLayer.java @@ -198,7 +198,7 @@ public class FavoritesLayer extends OsmandMapLayer implements ContextMenuLayer. final FavouritePoint a = (FavouritePoint) o; OnContextMenuClick listener = new ContextMenuAdapter.OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.favourites_context_menu_delete) { final Resources resources = view.getContext().getResources(); Builder builder = new AlertDialog.Builder(view.getContext()); @@ -213,7 +213,6 @@ public class FavoritesLayer extends OsmandMapLayer implements ContextMenuLayer. }); builder.create().show(); } - return true; } }; adapter.item(R.string.favourites_context_menu_delete) diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index 8d67a10bf2..d6f7645a0d 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -65,11 +65,12 @@ public class MapControlsLayer extends OsmandMapLayer { private LinearLayout transparencyBarLayout; private static CommonPreference settingsToTransparency; private OsmandSettings settings; - + private WaypointDialogHelper waypointDialogHelper; public MapControlsLayer(MapActivity activity){ this.mapActivity = activity; settings = activity.getMyApplication().getSettings(); + waypointDialogHelper = new WaypointDialogHelper(activity); } @@ -121,7 +122,8 @@ public class MapControlsLayer extends OsmandMapLayer { mapCancelNavigationControl.setMargin(mapSmallMenuControls.getWidth()); mapInfoNavigationControl.setMargin(mapSmallMenuControls.getWidth() + mapCancelNavigationControl.getWidth()); mapAppModeControl.setMargin(mapNavigationControl.getWidth()); - + + waypointDialogHelper.init(); initTransparencyBar(view, parent); } @@ -148,7 +150,7 @@ public class MapControlsLayer extends OsmandMapLayer { @Override public void destroyLayer() { - + waypointDialogHelper.removeListener(); } @Override @@ -335,6 +337,10 @@ public class MapControlsLayer extends OsmandMapLayer { mapInfoNavigationControl.setShowDialog(); } + public WaypointDialogHelper getWaypointDialogHelper() { + return waypointDialogHelper; + } + private int getScreenOrientation() { int rotation = mapActivity.getWindowManager().getDefaultDisplay().getRotation(); DisplayMetrics dm = new DisplayMetrics(); diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 40e8b07b37..c439d16acf 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -256,7 +256,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon final Amenity a = (Amenity) o; OnContextMenuClick listener = new ContextMenuAdapter.OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.poi_context_menu_call) { try { Intent intent = new Intent(Intent.ACTION_VIEW); @@ -278,7 +278,6 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } else if (itemId == R.string.poi_context_menu_showdescription) { showDescriptionDialog(a); } - return true; } }; if (OsmAndFormatter.getAmenityDescriptionContent(view.getApplication(), a, false).length() > 0) { diff --git a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java index b766b6bfc0..b2752fa749 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointNavigationLayer.java @@ -220,7 +220,7 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu final TargetPoint a = (TargetPoint) o; OnContextMenuClick listener = new ContextMenuAdapter.OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (itemId == R.string.delete_target_point) { TargetPointsHelper targetPointsHelper = map.getMyApplication().getTargetPointsHelper(); if(a.intermediate) { @@ -230,7 +230,6 @@ public class PointNavigationLayer extends OsmandMapLayer implements IContextMenu } } map.getMapLayers().getContextMenuLayer().setLocation(null, ""); - return true; } }; diff --git a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java index 5d6165e37c..51859ac09f 100644 --- a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java @@ -216,9 +216,8 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa final TransportStop a = (TransportStop) o; OnContextMenuClick listener = new ContextMenuAdapter.OnContextMenuClick() { @Override - public boolean onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { showDescriptionDialog(a); - return true; } }; adapter.item(R.string.poi_context_menu_showdescription) From 253e422c8d5529f229b0d4fb78fca4b2c27bc130 Mon Sep 17 00:00:00 2001 From: Leif Larsson Date: Mon, 20 Oct 2014 20:40:27 +0200 Subject: [PATCH 06/26] Translated using Weblate (Swedish) Currently translated at 99.4% (1531 of 1540 strings) --- OsmAnd/res/values-sv/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index bf56754efd..8ade5fd188 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -1713,4 +1713,6 @@ En anonym användare kan inte:\n- skapa grupper;\n- synkronisera grupper och enheter med servern;\n- hantera grupper och enheter i ett privat kontor. Anonym användare Inloggad som %1$s - + Konfigurera karta + I närheten av + From b47e0d7be26078f8034dd67c0d027733275d25e5 Mon Sep 17 00:00:00 2001 From: Taranenko Roman Date: Mon, 20 Oct 2014 21:46:18 +0300 Subject: [PATCH 07/26] Fixed crash when pressed back on map in Android version 2.3 --- OsmAnd/res/layout/gl_surface.xml | 7 +++++++ OsmAnd/res/layout/main.xml | 10 +++++----- OsmAnd/src/net/osmand/plus/activities/MapActivity.java | 5 +++-- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 OsmAnd/res/layout/gl_surface.xml diff --git a/OsmAnd/res/layout/gl_surface.xml b/OsmAnd/res/layout/gl_surface.xml new file mode 100644 index 0000000000..5a93699ddb --- /dev/null +++ b/OsmAnd/res/layout/gl_surface.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/main.xml b/OsmAnd/res/layout/main.xml index f10d26a96a..6d54fed7de 100644 --- a/OsmAnd/res/layout/main.xml +++ b/OsmAnd/res/layout/main.xml @@ -12,11 +12,11 @@ android:keepScreenOn="true" android:orientation="vertical" > - + Date: Mon, 20 Oct 2014 21:43:15 +0200 Subject: [PATCH 08/26] Fix NPE --- .../plus/helpers/WaypointDialogHelper.java | 51 +++++++++++-------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index ce4b560020..1e127ac78e 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -3,8 +3,6 @@ package net.osmand.plus.helpers; import java.util.ArrayList; import java.util.List; -import android.support.v4.widget.DrawerLayout; -import android.widget.*; import net.osmand.Location; import net.osmand.data.LatLon; import net.osmand.data.LocationPoint; @@ -35,6 +33,15 @@ import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.CompoundButton; +import android.widget.FrameLayout; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; /** */ @@ -81,29 +88,16 @@ public class WaypointDialogHelper implements OsmAndLocationListener { removeDialog(); } else { boolean created = false; - if (closePointDialog == null) { + View dlg = closePointDialog; + if (dlg == null) { created = true; final LayoutInflater vi = (LayoutInflater) app.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - closePointDialog = vi.inflate(R.layout.waypoint_reached, null); + dlg = vi.inflate(R.layout.waypoint_reached, null); } - updatePointInfoView(app, mapActivity, closePointDialog, point, null); - View all = closePointDialog.findViewById(R.id.all_points); + updatePointInfoView(app, mapActivity, dlg, point, null); + View all = dlg.findViewById(R.id.all_points); all.setVisibility(/*many.size() <= 1 ? View.GONE : */View.VISIBLE); - if (created) { - closePointDialog.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.view_black_selection)); - ((TextView) closePointDialog.findViewById(R.id.waypoint_text)).setTextColor(Color.WHITE); - all.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - showWaypointsDialog(mapActivity); - } - }); - - - mainLayout.addView(closePointDialog, getDialogLayoutParams()); - waitBeforeLayoutIsResized(closePointDialog); - } - View btnN = closePointDialog.findViewById(R.id.info_close); + View btnN = dlg.findViewById(R.id.info_close); btnN.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -111,6 +105,21 @@ public class WaypointDialogHelper implements OsmAndLocationListener { updateDialog(); } }); + if (created) { + dlg.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.view_black_selection)); + ((TextView) dlg.findViewById(R.id.waypoint_text)).setTextColor(Color.WHITE); + all.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + showWaypointsDialog(mapActivity); + } + }); + + closePointDialog = dlg; + mainLayout.addView(closePointDialog, getDialogLayoutParams()); + waitBeforeLayoutIsResized(dlg); + } + } } From 70032017a0ee8e8e80a1f61efd8767561bf65113 Mon Sep 17 00:00:00 2001 From: Nicolas Palix Date: Mon, 20 Oct 2014 22:36:12 +0200 Subject: [PATCH 09/26] Translated using Weblate (French) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-fr/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 288f6e9f0a..baa41b22df 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -1833,4 +1833,9 @@ Afghanistan, Albanie, Algérie, Allemagne, Andorre, Angola, Anguilla, Antigua-et Le nom de votre favoris sera %1$s car il n\'est pas possible d\'utiliser les émoticônes. Marge tolérée aux limites de vitesse Indiquez la marge à tolérer aux limitations de vitesse avant le déclenchement des annonces vocales. + Périphérique introuvable + Le service OsMo n\'est pas disponible :\n- Vérifier la connexion;\n- Vérifier les paramètres;\n- Vérifier notre Twitter: https://twitter.com/OsMomobi + Un utilisateur anonyme ne peut pas :\n- Créer des groupes;\n- Synchroniser les groupes et les périphériques avec le serveur;\n- Gérer les groupes et les périphériques dans un espace privé. + Utilisateur anonyme + Connecté entant que %1$s From dd429d1923faa08d25140cec147b0a14e99511fe Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 21 Oct 2014 22:35:35 +0200 Subject: [PATCH 10/26] Fix text rendering & add comment --- .../src/net/osmand/router/GeneralRouter.java | 24 +++++++++---------- .../net/osmand/plus/render/TextRenderer.java | 7 +++--- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java index 6f5cc4ce94..36155c9f0a 100644 --- a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java @@ -317,23 +317,23 @@ public class GeneralRouter implements VehicleRouter { } @Override public double calculateTurnTime(RouteSegment segment, int segmentEnd, RouteSegment prev, int prevSegmentEnd) { - int[] pt = prev.getRoad().getPointTypes(prevSegmentEnd); - if(pt != null) { - RouteRegion reg = prev.getRoad().region; - for (int i = 0; i < pt.length; i++) { - RouteTypeRule r = reg.quickGetEncodingRule(pt[i]); - if ("highway".equals(r.getTag()) && "traffic_signals".equals(r.getValue())) { - // traffic signals don't add turn info -// return 0; - } - } - } - float ts = getPenaltyTransition(segment.getRoad()); float prevTs = getPenaltyTransition(prev.getRoad()); if(prevTs != ts) { if(ts > prevTs) return (ts - prevTs); } +// int[] pt = prev.getRoad().getPointTypes(prevSegmentEnd); +// if(pt != null) { +// RouteRegion reg = prev.getRoad().region; +// for (int i = 0; i < pt.length; i++) { +// RouteTypeRule r = reg.quickGetEncodingRule(pt[i]); +// if ("highway".equals(r.getTag()) && "traffic_signals".equals(r.getValue())) { +// // traffic signals don't add turn info +// return 0; +// } +// } +// } + if(segment.getRoad().roundabout() && !prev.getRoad().roundabout()) { double rt = getRoundaboutTurn(); diff --git a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java index 81da950309..b1d6d09611 100644 --- a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java @@ -241,13 +241,15 @@ public class TextRenderer { paintText.setColor(text.textShadowColor); paintText.setStyle(Style.STROKE); paintText.setStrokeWidth(2 + text.textShadow); - cv.drawTextOnPath(text.text, text.drawOnPath, 0, text.vOffset, paintText); + cv.drawTextOnPath(text.text, text.drawOnPath, 0, + text.vOffset - ( paintText.ascent()/2 + paintText.descent()), paintText); // reset paintText.setStyle(Style.FILL); paintText.setStrokeWidth(2); paintText.setColor(text.textColor); } - cv.drawTextOnPath(text.text, text.drawOnPath, 0, text.vOffset, paintText); + cv.drawTextOnPath(text.text, text.drawOnPath, 0, + text.vOffset - ( paintText.ascent()/2 + paintText.descent()), paintText); } else { if (text.shieldRes != null) { float coef = rc.getDensityValue(rc.screenDensityRatio * rc.textScale); @@ -513,7 +515,6 @@ public class TextRenderer { p.centerX = points[startInd].x + scale * px + ox; p.centerY = points[startInd].y + scale * py + oy; - p.vOffset += p.textSize / 2 - 1; // p.hOffset = 0; if (inverse) { From 8e4407106464dab03d856e1adf39dc5b02ba55ac Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 21 Oct 2014 23:17:46 +0200 Subject: [PATCH 11/26] Add impassable road implementation --- .../src/net/osmand/router/GeneralRouter.java | 20 +++++++++++++ .../osmand/router/RoutingConfiguration.java | 29 ++++++++++++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java index 36155c9f0a..709c620f86 100644 --- a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java @@ -1,5 +1,7 @@ package net.osmand.router; +import gnu.trove.set.hash.TLongHashSet; + import java.io.PrintStream; import java.util.ArrayList; import java.util.BitSet; @@ -50,6 +52,8 @@ public class GeneralRouter implements VehicleRouter { // speed in m/s private float maxDefaultSpeed = 10; + private TLongHashSet impassableRoads; + public enum RouteDataObjectAttribute { ROAD_SPEED("speed"), @@ -180,9 +184,16 @@ public class GeneralRouter implements VehicleRouter { @Override public boolean acceptLine(RouteDataObject way) { int res = getObjContext(RouteDataObjectAttribute.ACCESS).evaluateInt(way, 0); + if(impassableRoads != null && impassableRoads.contains(way.id)) { + return false; + } return res >= 0; } + public long[] getImpassableRoadIds() { + return impassableRoads.toArray(); + } + private int registerTagValueAttribute(String tag, String value) { String key = tag +"$"+value; if(universalRules.containsKey(key)) { @@ -860,5 +871,14 @@ public class GeneralRouter implements VehicleRouter { } } + + public void addImpassableRoads(TLongHashSet impassableRoads) { + if (impassableRoads != null && !impassableRoads.isEmpty()) { + if (this.impassableRoads == null) { + this.impassableRoads = new TLongHashSet(); + } + this.impassableRoads.addAll(impassableRoads); + } + } } diff --git a/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java b/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java index ccadfc0ebc..037cd619cd 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java +++ b/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java @@ -1,12 +1,17 @@ package net.osmand.router; +import gnu.trove.set.hash.TLongHashSet; + import java.io.IOException; import java.io.InputStream; +import java.util.ArrayList; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; import java.util.Stack; import net.osmand.PlatformUtil; +import net.osmand.binary.RouteDataObject; import net.osmand.router.GeneralRouter.GeneralRouterProfile; import net.osmand.router.GeneralRouter.RouteAttributeContext; import net.osmand.router.GeneralRouter.RouteDataObjectAttribute; @@ -45,12 +50,18 @@ public class RoutingConfiguration { public float recalculateDistance = 10000f; - public static class Builder { // Design time storage private String defaultRouter = ""; private Map routers = new LinkedHashMap(); private Map attributes = new LinkedHashMap(); + private TLongHashSet impassableRoadIds = new TLongHashSet(); + private List impassableRoads = new ArrayList(); + + // Example +// { +// impassableRoadIds.add(23000069L); +// } public RoutingConfiguration build(String router, int memoryLimitMB) { return build(router, null, memoryLimitMB, null); @@ -76,6 +87,7 @@ public class RoutingConfiguration { i.initialDirection = direction; i.recalculateDistance = parseSilentFloat(getAttribute(i.router, "recalculateDistanceHelp"), i.recalculateDistance) ; i.heuristicCoefficient = parseSilentFloat(getAttribute(i.router, "heuristicCoefficient"), i.heuristicCoefficient); + i.router.addImpassableRoads(impassableRoadIds); i.ZOOM_TO_LOAD_TILES = parseSilentInt(getAttribute(i.router, "zoomToLoadTiles"), i.ZOOM_TO_LOAD_TILES); int desirable = parseSilentInt(getAttribute(i.router, "memoryLimitInMB"), 0); if(desirable != 0) { @@ -92,6 +104,21 @@ public class RoutingConfiguration { return i; } + + public List getImpassableRoads() { + return impassableRoads; + } + + public TLongHashSet getImpassableRoadIds() { + return impassableRoadIds; + } + + public void addImpassableRoad(RouteDataObject r) { + impassableRoadIds.add(r.id); + impassableRoads.add(r); + } + + private String getAttribute(VehicleRouter router, String propertyName) { if (router.containsAttribute(propertyName)) { return router.getAttribute(propertyName); From e9799e50e83aa016ed52be298ff58e4135dff86a Mon Sep 17 00:00:00 2001 From: jan madsen Date: Tue, 21 Oct 2014 21:41:35 +0200 Subject: [PATCH 12/26] Translated using Weblate (Danish) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-da/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 699f729003..96caecee9a 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1832,11 +1832,11 @@ Nogle af de centrale funktioner: Brug indbygget optegning Brug C++ optegning i stedet for Java Udskriv rute - Favoritnavn er ændret til %1$s for korrekt at kan gemme strengen med humørikoner til en fil. + Favoritnavn er ændret til %1$s for at kunne gemme navnet med humørikoner til en fil. Tolerance for hastighedsgrænse - Vælg hastighedsgrænse tolerancen, over hvilken du vil modtage en stemme advarsel. + Vælg hvor meget hastighedsgrænsen skal overskrides, for at få en stemmeadvarsel. Enheden blev ikke fundet - OsMo tjenesten er ikke tilgængelig:\n- check forbindelsen;\n- kontrollere indstillingerne;\n- Tjek vores Twitter: https://twitter.com/OsMomobi + OsMo tjenesten er ikke tilgængelig:\n- kontrollere forbindelsen;\n- kontrollere indstillingerne;\n- se på Twitter: https://twitter.com/OsMomobi En anonym bruger kan ikke:\n- oprette grupper;\n- synkronisere grupper og enheder med serveren;\n- administrere grupper og enheder i et privat kontor. Anonym bruger Logget ind som %1$s From 741af0bcda66e0bd921465530fcb42a17fe4faad Mon Sep 17 00:00:00 2001 From: Yannis Gyftomitros Date: Tue, 21 Oct 2014 16:35:18 +0200 Subject: [PATCH 13/26] Translated using Weblate (Greek) Currently translated at 93.6% (1440 of 1538 strings) --- OsmAnd/res/values-el/strings.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-el/strings.xml b/OsmAnd/res/values-el/strings.xml index d6cdc4790f..d44f5ba165 100644 --- a/OsmAnd/res/values-el/strings.xml +++ b/OsmAnd/res/values-el/strings.xml @@ -1673,4 +1673,7 @@ Κάμερα ταχύτητας Ορίστε το μέγεθος του κειμένου στο χάρτη. Μέγεθος κειμένου - + Η συσκευή δεν βρέθηκε + Ανώνυμος χρήστης + Συνδεδεμένος ως %1$s + From 5614efecd4d25f9091ba71b77e24eae52d80b67d Mon Sep 17 00:00:00 2001 From: Mirco Zorzo Date: Tue, 21 Oct 2014 12:14:54 +0200 Subject: [PATCH 14/26] Translated using Weblate (Italian) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-it/strings.xml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index fd4aada324..c7fed2308d 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -289,15 +289,14 @@ \n\nPer ricevere indicazioni partendo da un punto diverso alla tua posizione attuale, seleziona il punto voluto sulla mappa e scegli \'Indicazioni da\'. \n\nSe usi \'Indicazioni da\' insieme ad \'Avvia navigazione\', OsmAnd passerà alla tua posizione attuale on appena essa sarà disponibile (questo modo è stato studiato proprio per permettere di avviare immediatamente la navigazione ancor prima che la posizione sia stata individuata), mentre \'Indicazioni da\' insieme a \'Mostra percorso\' calcola il percorso da un punto arbitrario senza effettuare alcun aggiornamento. " Ricerca - Puoi cercare i luoghi direttamente sulla mappa attraverso \'Utilizza la posizione\' → \'Cerca nelle vicinanze\', oppure andando in \'Menu\' → \'Ricerca\'. - \n\nLa schermata di ricerca fornisce varie schede per effettuare ricerche - \n\tper indirizzo - \n\tdalle coordinate - \n\tda un PDI (dal tipo o dal nome) - \n\tdalla tua cronologia ricerche - \n\toppure fra i tuoi preferiti. - \n\nPer ogni risultato un menù contestuale permetterà di scegliere tra \'Indicazioni\' o \'Visualizza nella mappa\', etc. - + "Puoi cercare i luoghi direttamente sulla mappa attraverso \'Utilizza la posizione\' → \'Cerca nelle vicinanze\', oppure andando in \'Menu\' → \'Ricerca\'. +\n\nLa schermata di ricerca fornisce varie schede per effettuare ricerche +\n\tper indirizzo +\n\tdalle coordinate +\n\tda un PDI (dal tipo o dal nome) +\n\tdalla tua cronologia ricerche +\n\toppure fra i tuoi preferiti. +\n\nPer ogni risultato un menù contestuale permetterà di scegliere tra \'Indicazioni per\' o \'Visualizza nella mappa\', etc. " Menu \'Utilizza la posizione\' Il menu contestuale \'Utilizza la posizione…\' mostra tutte le azioni possibili per un punto (posizione). \n\nViene visualizzato selezionando a lungo sulla mappa, premendo il pulsante trackball o selezionando \'Menù\' → \'Utilizza la posizione…\' (gli ultimi due modi prendono il centro della mappa come riferimento). @@ -1661,7 +1660,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Evita le autostrade Evita le autostrade Limite di peso - Specifica il limite di peso del veicolo + Specifica il peso del veicolo permesso sul percorso Scegli GPX… Scegli la destinazione Scegli sulla mappa… @@ -1914,7 +1913,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Nomi locali Swahili Avanti - Home + Casa Invia il tracciamento a un specifico servizio web se la registrazione GPX è abilitata. Tracciamento online (GPX richiesto) Avvia il tracciamento online @@ -1941,12 +1940,12 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Per favore specifica l\'id Prosegui la navigazione Metti in pausa la navigazione - Vista escursionismo alpino + Scala escursionismo alpino (SAC) Disegna i sentieri in base alla scala SAC Strato simboli escursionistici Disegna i percorsi in base alle tracce OSMC - Edifici colorati + Edifici colorati per tipologia Presto Normale Tardi From d0206f1040737bd975f31260373a5b5ef8740930 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Tue, 21 Oct 2014 00:44:28 +0200 Subject: [PATCH 15/26] Translated using Weblate (Slovak) Currently translated at 99.8% (1536 of 1538 strings) --- OsmAnd/res/values-sk/strings.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 3e1f5ec120..3b86ca6210 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2004,4 +2004,7 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Vytlačiť trasu Tolerancia prekročenia povolenej rýchlosti Zvoľte toleranciu prekročenia povolenej rýchlosti, po ktorej dostanete hlasové oznámenie. + Zariadenie sa nenašlo + Anonymný používateľ + Prihlásený ako %1$s From a76e3e9a1c92fc63adab000396d70d931ca30906 Mon Sep 17 00:00:00 2001 From: Bars107 Date: Wed, 22 Oct 2014 17:10:58 +0300 Subject: [PATCH 16/26] Fix to null pointer. --- OsmAnd/src/net/osmand/plus/render/RendererRegistry.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java b/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java index a7545ef8ec..d69fa29265 100644 --- a/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java +++ b/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java @@ -132,7 +132,9 @@ public class RendererRegistry { @SuppressWarnings("resource") private InputStream getInputStream(String name) throws FileNotFoundException { InputStream is = null; - if(externalRenderers.containsKey(name)){ + if("default".equalsIgnoreCase(name)) { + name = DEFAULT_RENDER; + } else if(externalRenderers.containsKey(name)){ is = new FileInputStream(externalRenderers.get(name)); } else if(internalRenderers.containsKey(name)){ is = RenderingRulesStorage.class.getResourceAsStream(internalRenderers.get(name)); From 7f8ef362ad8a262e94e538c383d05650a8c87b00 Mon Sep 17 00:00:00 2001 From: Ludek M Date: Wed, 22 Oct 2014 10:45:14 +0200 Subject: [PATCH 17/26] Translated using Weblate (Czech) Currently translated at 99.8% (1535 of 1538 strings) --- OsmAnd/res/values-cs/strings.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index 259ed7f65a..419c7f4fd0 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1746,4 +1746,9 @@ s často kladenými otázkami. Jméno oblíbeného bodu bylo změněno na %1$s, aby bylo možné uložit název emotikonu do souboru. Tolerance překročení rychlosti Zvolte toleranci překročení povolené rychlosti, po které uslyšíte hlasové varování. + Zařízení nenalezeno + Služba OsMo není k dispozici:\n- zkontrolujte připojení;\n- zkontrolujte nastavení;\n- podívejte se na náš Twitter: https://twitter.com/OsMomobi + Anonymní uživatel nemůže:\n- vytvářet skupiny;\n- synchronizovat skupiny a zařízení se serverem;\n- manage groups and devices in a private office. + Anonymní uživatel + Přihlášen jako %1$s From 93080ca472152fa26d236a65dc95e738c4f5abf4 Mon Sep 17 00:00:00 2001 From: ace shadow Date: Wed, 22 Oct 2014 19:34:49 +0200 Subject: [PATCH 18/26] Translated using Weblate (Slovak) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-sk/strings.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 3b86ca6210..061418cedb 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -2007,4 +2007,6 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Zariadenie sa nenašlo Anonymný používateľ Prihlásený ako %1$s - + Služba OsMo nie je dostupná:\n- skontrolujte pripojenie;\n- skontrolujte nastavenie;\n- pozrite na náš Twitter: https://twitter.com/OsMomobi + Anonymný používateľ nemôže:\n- vytvárať skupiny;\n- synchronizovať skupiny a zariadenia so serverom;\n- spravovať skupiny a zariadenia v súkromnej kancelárii. + From da0fa41023865480768108bcce538f40216f8dcb Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Thu, 23 Oct 2014 13:14:44 +0300 Subject: [PATCH 19/26] Fix rendering --- OsmAnd/src/net/osmand/plus/render/RendererRegistry.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java b/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java index d69fa29265..d5afedf332 100644 --- a/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java +++ b/OsmAnd/src/net/osmand/plus/render/RendererRegistry.java @@ -23,7 +23,7 @@ public class RendererRegistry { private final static Log log = PlatformUtil.getLog(RendererRegistry.class); - public final static String DEFAULT_RENDER = "default"; //$NON-NLS-1$ + public final static String DEFAULT_RENDER = "OsmAnd"; //$NON-NLS-1$ private RenderingRulesStorage defaultRender = null; private RenderingRulesStorage currentSelectedRender = null; @@ -134,7 +134,8 @@ public class RendererRegistry { InputStream is = null; if("default".equalsIgnoreCase(name)) { name = DEFAULT_RENDER; - } else if(externalRenderers.containsKey(name)){ + } + if(externalRenderers.containsKey(name)){ is = new FileInputStream(externalRenderers.get(name)); } else if(internalRenderers.containsKey(name)){ is = RenderingRulesStorage.class.getResourceAsStream(internalRenderers.get(name)); From 6338b73f917929bed26f0982d6a212aec8fa3d44 Mon Sep 17 00:00:00 2001 From: Marco Antonio Date: Thu, 23 Oct 2014 07:56:45 +0200 Subject: [PATCH 20/26] Translated using Weblate (Spanish) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-es/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index 18642f917d..1202c8f859 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -1549,7 +1549,7 @@ Afganistán, Albania, Alemania, Andorra, Angola, Anguila, Antigua y Barbuda, Ant Evitar autopistas Evita las autopistas Límite de peso - Indicar peso del vehículo permitido en rutas + Indicar el peso del vehículo permitido en rutas Desde la versión Android KitKat (4.4), no puedes descargar ni actualizar el mapa en el anterior lugar de almacenamiento (%s). ¿Quieres cambiar a una nueva localización permitida y copiar todos los archivos allí? \n Nota: los archivos antiguos permanecerán intactos. \n Nota: no será posible compartir archivos entre OsmAnd y OsmAnd+. @@ -1882,9 +1882,9 @@ Afganistán, Albania, Alemania, Andorra, Angola, Anguila, Antigua y Barbuda, Ant Nombre de punto favorito duplicado Hemos cambiado el nombre de tu punto favorito a %1$s para evitar nombres duplicados. Probar renderización nativa - Iniciar actividad con renderización nativa + Iniciar la actividad con renderización nativa Usar renderización nativa - Usar C++ para la renderización en vez de Java + Usar el renderizado C++ en lugar de Java Imprimir ruta El nombre de punto favorito ha sido cambiado a %1$s para facilitar el guardado de la cadena con emoticonos a un archivo. Tolerancia de límite de velocidad From fd100a1f2509f728c9904b1c3b7859d1a0d98c8c Mon Sep 17 00:00:00 2001 From: Dmitriy Prodchenko Date: Thu, 23 Oct 2014 14:18:10 +0300 Subject: [PATCH 21/26] New icons for change waypoint order. --- OsmAnd/res/drawable-hdpi/av_download.png | Bin 0 -> 1260 bytes OsmAnd/res/drawable-hdpi/av_upload.png | Bin 0 -> 1249 bytes OsmAnd/res/drawable-mdpi/av_download.png | Bin 1230 -> 1165 bytes OsmAnd/res/drawable-mdpi/av_upload.png | Bin 1211 -> 1162 bytes OsmAnd/res/drawable-xhdpi/av_download.png | Bin 0 -> 1320 bytes OsmAnd/res/drawable-xhdpi/av_upload.png | Bin 0 -> 1309 bytes OsmAnd/res/drawable-xxhdpi/av_download.png | Bin 0 -> 1430 bytes OsmAnd/res/drawable-xxhdpi/av_upload.png | Bin 0 -> 1412 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 OsmAnd/res/drawable-hdpi/av_download.png create mode 100644 OsmAnd/res/drawable-hdpi/av_upload.png create mode 100644 OsmAnd/res/drawable-xhdpi/av_download.png create mode 100644 OsmAnd/res/drawable-xhdpi/av_upload.png create mode 100644 OsmAnd/res/drawable-xxhdpi/av_download.png create mode 100644 OsmAnd/res/drawable-xxhdpi/av_upload.png diff --git a/OsmAnd/res/drawable-hdpi/av_download.png b/OsmAnd/res/drawable-hdpi/av_download.png new file mode 100644 index 0000000000000000000000000000000000000000..805ae32444c34ef5a7387c2704c984d8cc9a6ba6 GIT binary patch literal 1260 zcmbVLTWB0r7@kBhp|&N6Hh4i!CRQqRt~-~VG261)$=a1{y4`G>^@2J(b9OT%bLq_4 z>}K(yBw#3*fVUD~RIIOBEw(;H+Rz*1p;l2O6+zIVthNf)*hE1*v)PS4gg$s+&gGx~ z|Nig49nB0qzHQ6>TL^;KmfELf@yUi?=bd;TX;-*`GAZ6<% zn1#AId3Xu-5yTx6RxXe7=|R35fn~K?<1v1(57Xo5*HO&7?CJR79b__f?K z*(le-+00%}iaf@UL{ShpZa`3?LcCvy%E<)V9~Y9*mTk%jknR|;<=eu(o3`R@ZPkPi zb>#Xv*Bx(lL1xrNZZPV4AdzTP9qbyh9Mi1?kA`Jhk6MGiH37|}@7kb|XVuz-gCq$N zsF*rc5JZELOrby(_##I|a5N^AMFAQGvT1Mr-~2I{6caYff10Ny!W|i2H%0+JHiij0 zc!GR9Dr?U^cNamlZB1$MT=nbg^N($xX1BhWx;R;ze{)yIPh<7vIrigVf#*MD-~RH@ zbnal=&dkoa-=97?H8s1s$Yd_flclToyn!+BdiV9;-s&EHVs@r>PP?+k)Ki^34SBeI zP<-LZztV#@ugo30(SNI>&aLc5J$Co%sjpI2t^xbV?8?awTq ze)-sid+T4E{{`CcV9(8^#fT*vmwp@?r%$~!vEy8Mde0H^Ph#f4jpY-u#Gux@@b|-( zaqDFL!ng31m9Bj8`|@{3&)$99oB84LLaC>#qwA?9cD5aye(j;d?;XGV$J~SOeDYby k5M+DLKhPk0-850MMz9W%77sqIdH~{4KWMJ&u=dG+IJ?oC*pw4}z58lp zS{3G@X3XwighK#y954$dRLbp^b;pWn5hfN|E@lHTv@3KqeF`F?46CNCkiUI+l_X3< zA&Wwe$+>A*Gso&4+*2Pf==CXGGRR%S#84<>0~SOY5n9u>FNX@*uq)$zbWM{)1A?X$ za#d6*H$kKw4-!HwLFo+36QUGjg@h=H&k`Iy(@c`)7>bc(Aucl<(R@hk%`+-;K9g_(59Rxuvh{qhSO0$wA(F{j(9EA~-KWif`q-?*hWg!E7-7{TeIyMnm)XL5b zQb??HH3ZAe<<<<_elt-xWpt>yG#g`R%ZlP^pna5w|H@bw?H6WUNavyN%y>GkN2RYt z#<{z{qX>xA$S-;(E{Zmtar7Ar+DOePB>odKOhZnvNr8d!1eFkZNQoTJQ%OVQC^2b7 zSrtSk$+qmQ#}~5#hi#+;f#+Fvl$VlxYJ^XU*)%hf;EhFH>c%!cuV@jR8f0hkBW8@{RwSKN^doqh|R}^R%vTM@HMVQNV|_ zVS+ZEAPo2?&&(aI zcZ&S^&+=XM#lwreKdwA<<yt;_j>fct*E!|Z(wq6YZ;yPiyl{8$_=UfI zx;d>DuN;2k`%@#e+$-wilS{)asOE1e#oOE4F7AA*{m?J(`I`pR;PmpjCw6`p?mh%A zJd?UQeDP=Y>CbzT*<)j0>VLGI{WMT-Y+YEnbLyZ3?uEstdOMcR@2x!Y!;uF}@%OVY z?EQG~?-L(QesZw8{Eq$PwUh0uasYU3>#OJb({%q=C{tRvepBk2e|U1^jtu~Ofwt}2 f)IdFVW^Tiypy%cO-fNf1zUWFF9nZW!vTyz$w?vjJ literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-mdpi/av_download.png b/OsmAnd/res/drawable-mdpi/av_download.png index 678ecfad451e3332eea75f579180cf03e1a6f763..91c4c44a14e3efdca46a5c8c1cc8784aec8e610d 100644 GIT binary patch delta 505 zcmX@d*~>Y>ld)`~SD&hxZnA-)iGsPMo}sCkxuv;|f)S9fZ(yNsWT0zcX=Q3`WneV% zZ^`6Yj46||7&Unce0{C_i!#$Q^Ad9=7chw^n;BY|8l)PV>6)3Fr0SX*nV9HWq?jA& znp>oROf)q&u$Y|AB&%R)Zf@#m;pA#+YGPt&=xSnVZeZqQYU$?YWai{%;$}8khe-ye z$OWgOUyLdO&R{nxXoP3xrR0|vYffImWT0ziW@4ObnUbiRWMZ1EYnEb?q?=@vW~gfn zv@9jn+|(pBIY~*OxFjew%_?PbA(Jps4%cUPuHW-lN|1qpVXdc&V@SoVq(A@v+aGpd zQfp&mTg)d>%D`>dB_S!fk<(n@!C}UIbIhbzLBa^^S1;Z3&he^{vygZ)HzLZaai|5s=8LaL7(kr5FIXVkS2=Oj1WsK}B*kUDD hdSF8tgF^!&Lvfh-0v;YMZ=lN=JYD@<);T3K0RVc*nxOyy delta 584 zcmeC>JjXe~lTl@&SD&hZZnA-yp@Nx-o}r0>rHQ4Ef{}rtfxe-UzJa-}p@EgDxs`$8 z#J?qz?=UJ&&SK1-ypKtNFW6MiP{B7bIWw;$zc^!Z9g~c_shg>Zi-n7`sgr?=p`ojx zrHP@XtBI4dqnoLrxrx(cMCS4+bU z*$&BtKiCEG*&fBWn9Q>*X4}u)!BXS!hKJWt;2+D8+nt3B2L%*_8o2uR2S~O2=XH_# z(ck7?%or=%pu6$!5-+nO%tsbVr0isgib`Nhip?lXVSd!^@Mq#JJ_gA-j7MS|{;=zc zZ(uIu6DW4jeZRz2#D?vWYkh#(x}5K<9nYOkv(8%5DD1F@zr%9liH%GjvlRBZzjoQd z)$!h`S(eR#&x-Fz^~;Ie4xG7+0`={$*nj?!6wqIsZdSv<%gL8f72)8uCwQ?QL*rkE zHLOR@H~wI|x++=dpiaiLlm*L}XDpl{@j-mmv`&_<^_-Rmq&wD5Y5vwnCM!hm>cPu zTcm&tG&MJ{n4Hcet6<@1X6b6+>||tA737y&eRdHh-2v3>-diO(Q$`Ajq?H-E{XFTk#RV~ zmuh_RGGm#8PWO@Ntz8$7GVaiEE*J5YY0%%1c=3>*H+zM%u>8K3m(E>{Jx4;^EH))F zGuj2Z-z?aoB2#)`1vA?n#wk;nU78(Z`8GWGP{rHQ4Ef{}rtfxe-UzJa-}p@EgDxs`$8 z#J?qz?=UJ&&SK1-ypKtNFW6MiP{B7bIWw;$zc^!Z9g~c_nYoFHqoJFTsgr?=p`ojx zrHP@XtBI4dqnoLrxrx(cMMv> ziKmOLQblfoUP@+)71Vq~9C{}=GCOnJYqeX*z`&?G`3$o}{jP@2PEO5VsSQ7*1@l;l>~80-Ko%nFNY2pJvPn;I3@= zp)c^CDalfyZ^?A#rp5@_SJe_f_N#dN2~$!yO;_Yt}ypp5QuD;qA@e`VZ-tO9wwmx_5(Hl**p9l zWIdbgkJIT lbY7fyaRsy69%cq69tIm`^DK)1lQ#@N;OXk;vd$@?2>^|Rxy%3n diff --git a/OsmAnd/res/drawable-xhdpi/av_download.png b/OsmAnd/res/drawable-xhdpi/av_download.png new file mode 100644 index 0000000000000000000000000000000000000000..6b1ee162d49fa23881b6597e06e4cd132b1a614a GIT binary patch literal 1320 zcmbVLZD<>H7{4%au2Nn5K~aZ0Z&f<+a__m^+4Lp3#0HmI)5vN!n3ubMnls7W?e5wn zg|TUUnGUxPPS91hu0!fZTNH{+rF1DXAR-&G&El9H%KRY1O$OrY=Ku0i`=RWE2lsz_ zp5OEQp0_u8d!A}+c(4IMkj7}Y6o-4K``>jZTu*2_zlYlcPPpIcGg3}owgA$l8cBdg zbMhdF16eKZ{1UVw$eLj-(eL!fwup+6^UAJ{w~#X-8bR7R3Z|@NfP*H%pr!|~YoE_! zsHO(6tz3+ZnIVwYx<@R~H`0?(Mly<^Vjb;hTS0^da=?+%LN2S@Vj+N4?27R0J`)&P zQE@T>tV*gs){BM=3!t3Whbtt-qP*axI3F+YPoOls6QrM@Nt_f!juA;3t$i5uW~nJL zE=6j-;4Ofq9mf<2BA?HD^NiQ91_??K1cIaqn#Q39ZWnb&F5tSoscu06wqj|fqZvBt zT9lK&@hrf3nq_gn z%F{USSKX{~Jn5(Ec2>nlm`ErR3UeIGQdF4jVnRM4C@~aG`F*6s)Ui?Bc4S=vb>Eun zyNZ==ixoo_kR8KH7)G|<1-)s*G3>NqqM=Zw>S*g$O;?S)z1b~OHEIc1+AvTfmXSj% zc^0+RIQUow2&#-HSx&)yDx1WUbc(_m7>x>ejs;2*tKrrEn?C}QBHU(K(LD7h*pcpW zc@*Gfd6<9>C&+@M^5e5#?MDz#cU0<16u!Iq-h9IXx&HNse%*D)(rNzZ8?D&hV`sl8 zMa?F0oqo>`Oyxboql%W{Mlh=Ei}MGt=pxF77%Nbh7gM$M#>j)O>PZd1Bir zrHkcD-v%zX9GV}T4o#h3eEZti<(}E$z1uR`^^>RK&hHDi#;MYV(O1*hXBV!|oiLgP z9yXg|;WG_KCjZ1|E z^w^f&&)2Tj@Z%rGB3?|PEJ2^bHkN(muctP$vszZ9=~_vqe}9zxJ+Y fMM$2-r}ub}xv}SN{PpJSqAQ4od!(7*3ori*0^_H7{6}Q&Td6S2RiC{y>_Co%e`Ncqp?kM&6>HiH4P+4eYxEI+uWMFOYZ(% zl5WybrC3_$3;IP@$2R?7)oF+G1uGVHjKG|J5wS?8g6PJuO6M4g#s4Kuw-03>Jovvo z_xzsc_q?55wG5Bq>Uau97NIe$wXKj<)FA-z6d2Ua0I~GRX9TWm z0U{wp>1Z|t(t6j34f;m9eq<22l3W|gbWw}DtN)jn2uBk5M{d(y1QbEz{@Id zC_q$5C8ND~$g%-0ctldA86NlgJ&YiF{oY+Ti{2FNqga}x{gS{*G>fl(1oCEU15!*5 zulho-0Fj0;D^XNFpZDZBk7W;1jNk94XqIAG5^0c5(S%BYG@a(E1sOQ1t!JTbnYe3F zNm;`%Kp>`-5R7azx@OpPRuhF%MirDS#dv7SFxonHYcH+e>pklzWhHVwq zW1zVTM!CDWBUcfzk$P+$6-CL&mO5+z6Gr3!f&O?jU6Vw{C(wWsNzuy#(#!HZ>C?O{ z>Gf%DRs}EZW2$!6#fQ0YC@iyr!1D~#$p^WR=;`bN{UTRGV9z{v#OZVTT{x-IQp!<+1X_R<@@fnfMAGRGDuQy(ap0+OEIp2Niw{J#|sdHE|vS%{) z#^HPUdD(uye{t&Y^ww?jXSSSA9<4pmw4tG;uXgzyJh?RY^7oltBj)(bYiFm;@oPJ7 zU|PPmANp%@speC(e%OEnhfZ9&a{C>{zZ0Xg@budqr}o7AYbua~I``$a>*ybYflYT~ XZ6Dp&eAf|auPcvqcFQL_o*4TNhuyIx literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xxhdpi/av_download.png b/OsmAnd/res/drawable-xxhdpi/av_download.png new file mode 100644 index 0000000000000000000000000000000000000000..4ae7e1c4d9e7b8f804c58fb25eec5b79ce0a2cbb GIT binary patch literal 1430 zcmbVMe@xtD7%q$`8=J$7gy9U; zVuB!=p;qf^05iVWMAw!&*ZX2lxa8@jb$YeZsK?+I&a{zW=UD_0ZmY) zs4gioYFgw&N}KM+V5G|_M54jqs$p4M5eiC17<`nlSxF)iG4onNYkC#-mW)0VQc7N7Ccq}R!^3`5g4TPf}FlBCa1(RQcbTk7$YrnmuF z(|K6{Dc=(Gy~1_elgpK;fY%kZMp0T)T~HZTbVUm*QM9CFsp{zCwUR6pk)OzXoWD*pq9l55`{{J^8?8oxk$@!Mw(q*}!%wT~DttiY|G>XRprY_9e1j=|s|t zku#FmubGXAXi>HM=Z8?!wb|AAgUE-OB8WBl-z zV_6@qpMK)zrQ}O<(Uu-9Zk;K3E%Mpz;nwm8bH;mGAMy9|gS);wXSrq>;s@+soK0v2 zqxEO@jvuAw*}<;F&A!w5IR_Tr&YBrLzwJVP&cOxdk2J;defLQ1J0G1^grDckkBv4xJ8}v4G{S8FV=oA0| literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xxhdpi/av_upload.png b/OsmAnd/res/drawable-xxhdpi/av_upload.png new file mode 100644 index 0000000000000000000000000000000000000000..a4084e1798186f68f7c53b8e816d0136dc4d3975 GIT binary patch literal 1412 zcmbVMYfKzf6u#7|2*DPU*3^ zLoBR{2^fW<-1G9cum*q!x|QY@t0nRRFX^gH%-h&9s)5h|)Cd_vlsce=#bH9xJouj% zzrry^_Tc;32o*8>Fsan{ny{(2p;_wfklZpZ?7?a>JR(q`C1M%1Q%ms~55B_7qj`Rt z#IY3jA)Q{8%3&WKCcz)lof^lg|VS^s=3F2 zWE7_KE>lAFXx~);Bkk_*C~t_O;a@ZrR1~o@pi5mU)U0s8gQF9htjN66?qVtEa1u_A zfdof04B?VFn&4b=UR9Q(T=oLbMtC;FP(ByuV_Al=+k=ePM^S+g%{W{kU(o9f7O-J0 zWr>;u3%(WPdkyQoFP8V4P_%TjS=T!YUC@}+Ej^Xg4b1OfsXA7*U(sYeo!Xr*(`wcM zXe!-M4w<@&t?0}v8^qvrG7jjLMIz3y65*7YI1#7Y?SunmBSVg5pcKc~@bdrFk3>O{ z`DVGRc?w&oBlFYstAG~kmkDa<2ASxpl>X4V06@`);efX}^W)6V>fTM>im!ihj@x47 zsk8Ou2PdzcpPeatF4&fRZEUpGn;jW(j7`q=KY1cD`pojwdEb~eeDTV1*KfN4s0E-H zaRCf~&EQo4wgRyCr>Ac8bCDDCxkE?WglJ9X_{WD&99_<6qrJz6g-i2v-%Yl(W9L<7 zQ2laC?MJPn*`-?t(+k^b-_2fF9+_S`a&9}gId6fu{LgM zx~_s7QiQV)#>x|mpYHptavT^t6AM?a{*@>?_V+7?lKak74m@hiObm4kRXbvCAr#} z&)yDHpE16ep1Xc{dhk{WwSItr{sW73>JR|;aBQBep5Gn=nY2wNYkRh#-y#SH8v=vA GSl_<|S>mJs literal 0 HcmV?d00001 From c89414ab2ac90c10272f60978fa9b8f40a662d0a Mon Sep 17 00:00:00 2001 From: Carsten Gerlach Date: Thu, 23 Oct 2014 14:49:23 +0200 Subject: [PATCH 22/26] Translated using Weblate (German) Currently translated at 99.6% (1533 of 1538 strings) --- OsmAnd/res/values-de/strings.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 53e643dcf5..614f9ddd25 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1970,7 +1970,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Ziele Verkehrswarnungen Speichern Sie Ihre Tracks mit einem Klick. Zeigt die Einstellung, wie Strecken aufgezeichnet werden – in lokale GPX-Dateien oder online via Web-Service. - + Antippen eines Elements um mehr Details zu erfahren, Tippen und Halten zum Deaktivieren oder Löschen des Elements. Aktuell auf dem Gerät vorhandene Daten (%1$s frei): Karten-Schriftgröße festlegen Schriftgröße @@ -1984,4 +1984,5 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Route drucken Toleranz für Tempolimit Schwellenwert für Warnung bei Überschreiten der Höchstgeschwindigkeit. - + Gerät wurde nicht gefunden + From d73569f946220be2306fb51085e6e50fb52b21b3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 24 Oct 2014 11:24:59 +0200 Subject: [PATCH 23/26] Add rendering attribute support as parameter --- .../net/osmand/binary/BinaryInspector.java | 6 +-- .../src/net/osmand/render/RenderingRule.java | 26 ++++++++--- .../render/RenderingRuleSearchRequest.java | 19 +++++--- .../osmand/render/RenderingRulesStorage.java | 43 ++++++++++--------- 4 files changed, 60 insertions(+), 34 deletions(-) diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java b/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java index c7af5f2624..e8f437df18 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java @@ -61,13 +61,13 @@ public class BinaryInspector { if(args.length == 1 && "test".equals(args[0])) { in.inspector(new String[]{ //"-vpoi", - "-vmap", "-vmapobjects", +// "-vmap", "-vmapobjects", // "-vrouting", // "-vaddress", "-vcities", "-vstreets", "-vstreetgroups","-vbuildings", //"-zoom=16", //"-bbox=4,55,7,50", - "/home/victor/projects/osmand/osm-gen/Map.obf" -// "/home/victor/projects/osmand/osm-gen/Netherlands_europe.obf" +// "/home/victor/projects/osmand/osm-gen/Map.obf" + "/home/victor/projects/osmand/osm-gen/Ukraine_europe.obf" // "/home/victor/projects/osmand/osm-gen/World_basemap_2_b.obf___" // "/home/victor/projects/osmand/osm-gen/World_basemap_2.obf__" }); diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRule.java b/OsmAnd-java/src/net/osmand/render/RenderingRule.java index f51c7e3759..74657b6f93 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRule.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRule.java @@ -14,6 +14,7 @@ public class RenderingRule { private RenderingRuleProperty[] properties; private int[] intProperties; + private RenderingRule[] attributesRef; private float[] floatProperties; private List ifElseChildren; private List ifChildren; @@ -41,6 +42,7 @@ public class RenderingRule { ArrayList props = new ArrayList(attributes.size()); intProperties = new int[attributes.size()]; floatProperties = null; + attributesRef = null; int i = 0; Iterator> it = attributes.entrySet().iterator(); while (it.hasNext()) { @@ -48,18 +50,23 @@ public class RenderingRule { RenderingRuleProperty property = storage.PROPS.get(e.getKey()); if (property != null) { props.add(property); - - if (property.isString()) { - intProperties[i] = storage.getDictionaryValue(e.getValue()); + String vl = e.getValue(); + if(vl.startsWith("$")){ + if (attributesRef == null) { + attributesRef = new RenderingRule[attributes.size()]; + } + attributesRef[i] = storage.getRenderingAttributeRule(vl.substring(1)); + } else if (property.isString()) { + intProperties[i] = storage.getDictionaryValue(vl); } else if (property.isFloat()) { if (floatProperties == null) { // lazy creates floatProperties = new float[attributes.size()]; } - floatProperties[i] = property.parseFloatValue(e.getValue()); - intProperties[i] = property.parseIntValue(e.getValue()); + floatProperties[i] = property.parseFloatValue(vl); + intProperties[i] = property.parseIntValue(vl); } else { - intProperties[i] = property.parseIntValue(e.getValue()); + intProperties[i] = property.parseIntValue(vl); } i++; } @@ -114,6 +121,13 @@ public class RenderingRule { return intProperties[ind]; } + protected RenderingRule getAttrProp(int ind) { + if(attributesRef == null) { + return null; + } + return attributesRef[ind]; + } + protected float getFloatProp(int ind){ return floatProperties[ind]; } diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java b/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java index 0f94db895f..56d04b461a 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRuleSearchRequest.java @@ -157,7 +157,7 @@ public class RenderingRuleSearchRequest { if(!input) { return false; } - if (!loadOutput) { + if (!loadOutput && !rule.isGroup()) { return true; } // accept it @@ -171,7 +171,8 @@ public class RenderingRuleSearchRequest { break; } } - if (match || !rule.isGroup()) { + boolean fit = (match || !rule.isGroup()); + if (fit && loadOutput) { if (rule.isGroup()) { loadOutputProperties(rule, false); } @@ -179,9 +180,8 @@ public class RenderingRuleSearchRequest { for (RenderingRule rr : rule.getIfChildren()) { visitRule(rr, loadOutput); } - return true; } - return false; + return fit; } @@ -191,7 +191,16 @@ public class RenderingRuleSearchRequest { RenderingRuleProperty rp = properties[i]; if (rp.isOutputProperty()) { if (!isSpecified(rp) || override) { - if (rp.isFloat()) { + RenderingRule rr = rule.getAttrProp(i); + if(rr != null) { + visitRule(rr, true); + if(isSpecified(storage.PROPS.R_ATTR_COLOR_VALUE)){ + values[rp.getId()] = getIntPropertyValue(storage.PROPS.R_ATTR_COLOR_VALUE); + } else if(isSpecified(storage.PROPS.R_ATTR_INT_VALUE)){ + values[rp.getId()] = getIntPropertyValue(storage.PROPS.R_ATTR_INT_VALUE); + fvalues[rp.getId()] = getFloatPropertyValue(storage.PROPS.R_ATTR_INT_VALUE); + } + } else if (rp.isFloat()) { fvalues[rp.getId()] = rule.getFloatProp(i); values[rp.getId()] = rule.getIntProp(i); } else { diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java b/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java index 0625a5124b..9cb0422760 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java @@ -48,7 +48,7 @@ public class RenderingRulesStorage { public TIntObjectHashMap[] tagValueGlobalRules = new TIntObjectHashMap[LENGTH_RULES]; protected Map renderingAttributes = new LinkedHashMap(); - protected Map renderingConstants= new LinkedHashMap(); + protected Map renderingConstants = new LinkedHashMap(); private String renderingName; private String internalRenderingName; @@ -335,10 +335,13 @@ public class RenderingRulesStorage { String vl = parser.getAttributeValue(i); if (vl != null && vl.startsWith("$")) { String cv = vl.substring(1); - if (!renderingConstants.containsKey(cv)) { - throw new IllegalStateException("Rendering constant '" + cv + "' was not specified."); + if (!renderingConstants.containsKey(cv) && + !renderingAttributes.containsKey(cv)) { + throw new IllegalStateException("Rendering constant or attribute '" + cv + "' was not specified."); + } + if(renderingConstants.containsKey(cv)){ + vl = renderingConstants.get(cv); } - vl = renderingConstants.get(cv); } m.put(name, vl); } @@ -470,7 +473,7 @@ public class RenderingRulesStorage { }; storage.parseRulesFromXmlInputStream(is, resolver); - printAllRules(storage); +// printAllRules(storage); testSearch(storage); } @@ -479,22 +482,22 @@ public class RenderingRulesStorage { // int count = 100000; // for (int i = 0; i < count; i++) { RenderingRuleSearchRequest searchRequest = new RenderingRuleSearchRequest(storage); - searchRequest.setStringFilter(storage.PROPS.R_TAG, "natural"); - searchRequest.setStringFilter(storage.PROPS.R_VALUE, "tree"); - searchRequest.setStringFilter(storage.PROPS.R_ADDITIONAL, "leaf_type=broadleaved"); + searchRequest.setStringFilter(storage.PROPS.R_TAG, "highway"); + searchRequest.setStringFilter(storage.PROPS.R_VALUE, "primary"); +// searchRequest.setStringFilter(storage.PROPS.R_ADDITIONAL, "leaf_type=broadleaved"); // searchRequest.setIntFilter(storage.PROPS.R_LAYER, 1); - searchRequest.setIntFilter(storage.PROPS.R_MINZOOM, 18); - searchRequest.setIntFilter(storage.PROPS.R_MAXZOOM, 18); - // searchRequest.setBooleanFilter(storage.PROPS.R_NIGHT_MODE, true); - // searchRequest.setBooleanFilter(storage.PROPS.get("hmRendered"), true); - for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) { - if (customProp.isBoolean()) { - searchRequest.setBooleanFilter(customProp, false); - } else { - searchRequest.setStringFilter(customProp, ""); - } - } - boolean res = searchRequest.search(POINT_RULES); + searchRequest.setIntFilter(storage.PROPS.R_MINZOOM, 9); + searchRequest.setIntFilter(storage.PROPS.R_MAXZOOM, 9); +// searchRequest.setBooleanFilter(storage.PROPS.R_NIGHT_MODE, true); +// for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) { +// if (customProp.isBoolean()) { +// searchRequest.setBooleanFilter(customProp, false); +// } else { +// searchRequest.setStringFilter(customProp, ""); +// } +// } + searchRequest.setBooleanFilter(storage.PROPS.get("noPolygons"), true); + boolean res = searchRequest.search(LINE_RULES); System.out.println("Result " + res); printResult(searchRequest, System.out); // } From 06fae3c926eda4a90af74ba5f9b7426a00583a5d Mon Sep 17 00:00:00 2001 From: jan madsen Date: Fri, 24 Oct 2014 10:24:20 +0200 Subject: [PATCH 24/26] Translated using Weblate (Danish) Currently translated at 100.0% (1538 of 1538 strings) --- OsmAnd/res/values-da/strings.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 96caecee9a..4ef84d261e 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -840,7 +840,7 @@ Nogle af de centrale funktioner: m Forældet kortdataformat \'{0}\' er ikke understøttet Nærmeste interessepunkt - Tilpasset filter + Brugerdefineret filter Online navne-søger Læser cachelagrede delkort… Ikke nok hukommelse for indeks \'{0}\' @@ -879,7 +879,7 @@ Nogle af de centrale funktioner: \n\nFor at få kørselsvejledning til destinationen fra et andet punkt end den aktuelle position, vælges det på kortet, og tryk \'Kørselsvejledning fra\'. \n\nVælg enten \'Begynd navigation\', hvilket betyder, at OsmAnd giver vejledning og talte instruktioner (hvis aktiveret) mv. Eller vælg \'Vis rute\', hvilket resulterer i statisk rute uden vejledning eller justeringer, mens du flytter. \n\nBruges \'Kørselsvejledning fra\' sammen med \'Begynd navigation\', vil OsmAnd skifte til den faktiske position, så snart den er fundet (dette kan bruges til at komme hurtigt i gang med rutevejledning før positionen findes), mens \'Kørselsvejledning fra\' i kombination med \'Vis rute\' kun viser ruten fra ethvert vilkårligt valgt punkt uden efterfølgende opdateringer.\nHvis du bruger \"Kørselsvejledning fra \'sammen med\' Start navigation\", vil Osmand så hurtigt skifte til din aktuelle position som det findes (så dette kan bruges til at kickstarte routing før positionen er fundet), mens \"Kørselsvejledning fra \'i kombination med \'Vis rute\' bare viser dig ruten fra enhver vilkårlig punkt, du havde valgt uden efterfølgende opdateringer. " - Brug af landområder + Arealanvendelse Mad og drikke Talevejledning er ikke tilgængelig. Gå til \'Indstillinger - Datahåndtering\', vælg den ønskede stemmepakke og hent den. {0} enheder valgt @@ -1837,7 +1837,7 @@ Nogle af de centrale funktioner: Vælg hvor meget hastighedsgrænsen skal overskrides, for at få en stemmeadvarsel. Enheden blev ikke fundet OsMo tjenesten er ikke tilgængelig:\n- kontrollere forbindelsen;\n- kontrollere indstillingerne;\n- se på Twitter: https://twitter.com/OsMomobi - En anonym bruger kan ikke:\n- oprette grupper;\n- synkronisere grupper og enheder med serveren;\n- administrere grupper og enheder i et privat kontor. + En anonym bruger kan ikke:\n- oprette grupper;\n- synkronisere grupper og enheder med serveren;\n- administrere grupper og enheder i et privat område. Anonym bruger Logget ind som %1$s Konfigurer kort From f3159637731c79de7cd8203280cd1540d32cf2eb Mon Sep 17 00:00:00 2001 From: stephan 75 Date: Thu, 23 Oct 2014 14:53:54 +0200 Subject: [PATCH 25/26] Translated using Weblate (German) Currently translated at 99.9% (1537 of 1538 strings) --- OsmAnd/res/values-de/strings.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 614f9ddd25..e2fe7a10dc 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1985,4 +1985,8 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Toleranz für Tempolimit Schwellenwert für Warnung bei Überschreiten der Höchstgeschwindigkeit. Gerät wurde nicht gefunden + OsMo-Dienst ist nicht verfügbar:\n- bitte Verbindung prüfen;\n- bitte Einstellungen prüfen;\n- ggf. Meldung auf Twitter: https://twitter.com/OsMomobi + Anonymer Benutzer + angemeldet als %1$s + Anynyme Benutzer können nicht::\n- Gruppen bilden;\n- Synchronisieren von Gruppen und Geräten auf dem Server;\n- Verwalten von Gruppen und Geräten im Privatbereich. From 4565612ee6c458f1ee530944ea8c25899fef2ae5 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 25 Oct 2014 14:15:10 +0200 Subject: [PATCH 26/26] Fix issues with app crash --- OsmAnd-java/src/net/osmand/router/GeneralRouter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java index 709c620f86..f54dba0f3c 100644 --- a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java @@ -191,6 +191,9 @@ public class GeneralRouter implements VehicleRouter { } public long[] getImpassableRoadIds() { + if(impassableRoads == null) { + return new long[0]; + } return impassableRoads.toArray(); }