From 4604ec38dce3e08acf8f09102349806aaf1ba30f Mon Sep 17 00:00:00 2001 From: Denis Date: Wed, 15 Oct 2014 19:09:16 +0300 Subject: [PATCH] Implemented search radius for POI in waypoints dialog --- .../drawable-hdpi/ic_sort_waypoint_dark.png | Bin 0 -> 1204 bytes .../drawable-hdpi/ic_sort_waypoint_white.png | Bin 0 -> 1204 bytes .../drawable-xhdpi/ic_sort_waypoint_dark.png | Bin 0 -> 1344 bytes .../drawable-xhdpi/ic_sort_waypoint_white.png | Bin 0 -> 1350 bytes .../drawable-xxhdpi/ic_sort_waypoint_dark.png | Bin 0 -> 1459 bytes .../ic_sort_waypoint_white.png | Bin 0 -> 1460 bytes .../res/layout/radius_search_list_element.xml | 34 +++++++ OsmAnd/res/layout/waypoint_header.xml | 20 ++-- OsmAnd/res/values/strings.xml | 1 + .../plus/helpers/WaypointDialogHelper.java | 87 ++++++++++++++++-- .../osmand/plus/helpers/WaypointHelper.java | 13 ++- 11 files changed, 142 insertions(+), 13 deletions(-) create mode 100644 OsmAnd/res/drawable-hdpi/ic_sort_waypoint_dark.png create mode 100644 OsmAnd/res/drawable-hdpi/ic_sort_waypoint_white.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_dark.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_white.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_dark.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_white.png create mode 100644 OsmAnd/res/layout/radius_search_list_element.xml diff --git a/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_dark.png b/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..b4b0f6f746b777f0fedc0efb599d066cef216acd GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_white.png b/OsmAnd/res/drawable-hdpi/ic_sort_waypoint_white.png new file mode 100644 index 0000000000000000000000000000000000000000..d255baea1c03bd21200d6da82ba986ab56e68940 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_dark.png b/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..19e922e93059939acae1cdb80e9ab85264932ce2 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_white.png b/OsmAnd/res/drawable-xhdpi/ic_sort_waypoint_white.png new file mode 100644 index 0000000000000000000000000000000000000000..1a83dced108f093c79b7bb51fef51e072f9cd407 GIT binary patch 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 literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_dark.png b/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..4de1c9e4e394115461e722d68018e334990a35cf GIT binary patch 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+?% literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_white.png b/OsmAnd/res/drawable-xxhdpi/ic_sort_waypoint_white.png new file mode 100644 index 0000000000000000000000000000000000000000..2ab38b4b05e5fcb6b0f7e7c843990ae7586eaf7f GIT binary patch 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/waypoint_header.xml b/OsmAnd/res/layout/waypoint_header.xml index 534d0e80cc..a0b74947ce 100644 --- a/OsmAnd/res/layout/waypoint_header.xml +++ b/OsmAnd/res/layout/waypoint_header.xml @@ -7,12 +7,12 @@ 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 06257f9037..abca04b331 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,7 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Search radius 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/helpers/WaypointDialogHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java index ce4b560020..7bf257a9e6 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java @@ -13,6 +13,7 @@ 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,6 +45,8 @@ public class WaypointDialogHelper implements OsmAndLocationListener { private LinearLayout mainLayout; private WaypointHelper waypointHelper; + private final static String POI_RADIUS = "poi_radius"; + public final static boolean OVERLAP_LAYOUT = true; // only true is supported private View closePointDialog; private List many = new ArrayList(); @@ -245,15 +248,30 @@ public class WaypointDialogHelper implements OsmAndLocationListener { } } + 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); + } + 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); @@ -356,6 +374,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener { 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 @@ -366,8 +385,60 @@ public class WaypointDialogHelper implements OsmAndLocationListener { if (v == null || viewText != labelView) { v = ctx.getLayoutInflater().inflate(labelView ? R.layout.waypoint_header : R.layout.waypoint_reached, null); } - if (labelView) { + 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.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(getActivity()) + .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; + waypointHelper.setSearchDeviationRadius(value); + radius.setText(OsmAndFormatter.getFormattedDistance(value, app)); + recalculatePoints(running, thisAdapter, WaypointHelper.POI); + dialogInterface.dismiss(); + } + } + }).setTitle(app.getString(R.string.search_radius)+ " " + app.getString(R.string.poi)) + .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); @@ -392,6 +463,7 @@ public class WaypointDialogHelper implements OsmAndLocationListener { TextView tv = (TextView) v.findViewById(R.id.header_text); tv.setText(getHeader(type, checked)); } else { + v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null); updatePointInfoView(app, ctx, v, (LocationPointWrapper) getItem(position), WaypointDialogFragment.this); View remove = v.findViewById(R.id.info_close); ((ImageButton) remove).setImageDrawable(ctx.getResources().getDrawable( @@ -448,6 +520,9 @@ public class WaypointDialogHelper implements OsmAndLocationListener { 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); + } if (tp != null && tp.size() > 0) { points.addAll(tp); } diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index 22eba272f7..f5b0193a41 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -56,6 +56,7 @@ 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(); @@ -210,7 +211,9 @@ public class WaypointHelper { recalculatePoints(route, type, locationPoints); } - + public void recalculatePoints(int type){ + recalculatePoints(route, type, locationPoints); + } public boolean isTypeConfigurable(int waypointType) { @@ -705,6 +708,14 @@ public class WaypointHelper { } } + + public int getSearchDeviationRadius(){ + return searchDeviationRadius; + } + + public void setSearchDeviationRadius(int radius){ + this.searchDeviationRadius = radius; + } private class AmenityLocationPoint implements LocationPoint {