From 8210315c7b1d4fd0d6bc461bc034185c55f7c8e4 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 2 Nov 2014 16:45:49 +0100 Subject: [PATCH 1/3] Add icons and category --- .../drawable-hdpi/ic_action_road_works_dark.png | Bin 0 -> 2143 bytes .../drawable-hdpi/ic_action_road_works_light.png | Bin 0 -> 2063 bytes .../drawable-xhdpi/ic_action_road_works_dark.png | Bin 0 -> 2530 bytes .../ic_action_road_works_light.png | Bin 0 -> 2485 bytes .../ic_action_road_works_dark.png | Bin 0 -> 3521 bytes .../ic_action_road_works_light.png | Bin 0 -> 3440 bytes OsmAnd/res/values/strings.xml | 1 + .../osmand/plus/dialogs/ConfigureMapMenu.java | 8 ++++++-- .../plus/rastermaps/OsmandRasterMapsPlugin.java | 2 +- 9 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 OsmAnd/res/drawable-hdpi/ic_action_road_works_dark.png create mode 100644 OsmAnd/res/drawable-hdpi/ic_action_road_works_light.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_road_works_dark.png create mode 100644 OsmAnd/res/drawable-xhdpi/ic_action_road_works_light.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_road_works_dark.png create mode 100644 OsmAnd/res/drawable-xxhdpi/ic_action_road_works_light.png diff --git a/OsmAnd/res/drawable-hdpi/ic_action_road_works_dark.png b/OsmAnd/res/drawable-hdpi/ic_action_road_works_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7603e05c52f04044ea627b792057ac892971d48e GIT binary patch literal 2143 zcmbVNdpMN&9v}DI#*#YNWOl}4%UsQvi%VtW|EQ{7P{c#S8}@FW73Kxa@q7z7e( z^+Chllma1x%MM)i1+RS2VhB<&@c7i!R9vbDPOcQ;iF7(0Paxq*BrI%!Ri()wK#i5D zFl!8KP{mhD6p%zNLoG7`Jb5zYgN7r0e+8)`B;*6JOtmT$EE!%6DDXra0WXy<-)qHM z1#!XuhVfBrRYaNs#B)KFJXy(y^C85nfnn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jL{AwP~VX4>|{D z;vAT&yg5Z2eO^D2f8Keji?b#9i&m9Rt2dAp6KnjI=f7`A8#a*Db>RSyIj-|NQkgS) wr6E6kxUFLTYS@MC3r{cXH~Age-n4+xA~Zv@snUJeL(9MX;DAu}C02swKjZ&sdjJ3c literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-hdpi/ic_action_road_works_light.png b/OsmAnd/res/drawable-hdpi/ic_action_road_works_light.png new file mode 100644 index 0000000000000000000000000000000000000000..b3774733e0179cd5664a35babc6270c1d912c597 GIT binary patch literal 2063 zcmbVNdsGu=77s`SLX}ulgrLTtmPa0wK%Np_3DJay0i!{*E0bgrA|#WSNu<6?L14w* z$`)CX0;{d23a&iFx_}4>R0}Ee)T&VtyREPaN~;zWE1e*?`-i80?03%0_uX&q?>>I_ z-ZO>bq_y)f{umSrHBY#XpMvaw^YNIAyrr(s^O4QZ6qjn+04q%v&;X%g6tE1!3pJn$ zN`XMdPW=@q0)?7mR!dS%sfh_3IjkXrP93sUqeIXrR78|j2g)-c6J7?X)LJg#aZ@V+ zuU2pgQhFkgsN+Ey>UG%$XhU|AM4p`~XDbL%k@yHJ2Qi?5Od#H>$j4wpu5;9CC9fv}(SS(~q7#TLGC{#9^O#x^W8jXZ#kc>OECeTXK z8Utr7@FAnzpw^kxuomyM2+H6cCN2Sq^mPgvU1H)J!&>7EQ3z!eE2yJT$pA&8appCx zZ8W7o{|)1<+D6Gv9YjfijPMSF9I1yga2AYk_s5Q$ibyn^^#(Ok6flbq%XerXtx3q| z5|A%sg<8P@=^&FSV>3z2Fe;4%%ECbs2*~K9aD`GyR{%6NixEC+=WTdqcpML)vRDin zE0#))3ug=BVq;i9jDXGOv%=!|vsj_lXacozXx6tH@jZiO{vnpbGeDpTHb`JNYqkr- z8L$a9X23c;k2hU)e2`SFRlpWwu(M3Bv*tqvwHZ+mKfMnHcbw&!${$5 z5F*K;aEQc`DG?G7Vq|nCKn3Uu!VF&V|MEvcf}%K^<$s!I_6q4p=k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BEySit^1O0TDsEb3rJlz`4{%(&=0e4R49uH1P zzU}xHCrZx8CEw;Fr@tJESUTjBd(rY=M+B(K^&rFv% zQy}Y6mG|sb+(F%um9@t-o+a;xZwzFn4(AT+wCHS{B#Tzxkfo`fUAYD zsovMtEHzKQbIC+zi@|9Pv!1J}n6AG04P;UF>uIAMuC_09J{tH_7lVJTc*&xjptd&&HAN?k?O|+Pe11JJlAS z(5HVMe+vm% zA4Ne6rdZ#r7<;U%t)y<@y0RT-ojswMr4zEz^6yHmd(Q*4!-2NBNWR77?d$Ca*DZ`f zj%*7M1aA7%O^LuT$Xflv?9U+X{K2dpNcN*SE$Z1+q zWbKG1B{n85MDB11CEVF>8{zxLJF_*nKsB^^vPs`g!*ebPZ~nl9K)q&g&+L9C*2gCe zVG8iK=;gcy$hT83yT@Yvux^_(m0hO?tDJLg=Im_ONM4DD{_6~JVMeH~{jMOhkX<*k zxW(w20HbC*;(l~X9QnRsheu`^?y3o|+bG>$$W!h?nw*f%c`Kqvt(-p>^C&N|vvf9$ zId35Z6U6;@+m?|tZk^Vtv};t1xQE^pJx&U(e0SV@PoBva(C*tu_k@lovYRw&Uybna W`>n{_82EksuZ!!wj9uUvy7eDSqYD54 literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xhdpi/ic_action_road_works_light.png b/OsmAnd/res/drawable-xhdpi/ic_action_road_works_light.png new file mode 100644 index 0000000000000000000000000000000000000000..de9e82c1a047838c0317e2ab9e91720a64d78bbd GIT binary patch literal 2485 zcmbVOdpuNm8y^g2yvC&qCFMBXt-0UKtdYx@+(Yi!7&8ZhahN$W>0;Pfs#kj7YN=Ml zq-{})%B^*23e{GuilRkHwJiy`w2^mIdfz|#>>uy>ea`vap6~N~pWEki_IrD6#_5^q zp-?ECs|(jxJ=@Q}7#;PuM3mU8o|YrdLC97(5=rJuAe4g;j(`AHF+U3Oh4{jqi8mly z6iRD{$S(*9^7LQ}U@?I|FGG-t6VzxF%65}1fiH-K5Fi4I62)`Ck;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&wq&P~*s>3IM?N=D6&NjI%c1dEMkS3((Es zpSv&n1N*W*Saz@0em*TqJvX)Ipv!)(H@au8Mwe+jHfOn>IK168T!VcBC)Ox zI}s)J#^!hKzi`+&yn5{6Uk3M{2x!i*l0BQKvz=zcN3wy1@6^j=*L7%(j>@3vi>+x# zCmN~m6Kw*8)qNQj*?jPyxDDtwo_=YyQPaE5gI2xHty<=ntxJuKlysL1&2UfY_ok0k zF4tQ*9fjDoR4up$>t8OZuFt=T6;Y#4MYEMlt1K%bT67YTmY`&22m~~$!M7C_lVBon6J7*|6?}ffy_#os{9I;4Wh3qGs7O4>k_ulwn4-cTM)U*g z*&d^q8biz$!_t`?1OF zW0{J&-9@D?c{FQB%c@LGn3k%f{IO?+|QyLqX)y^&K3b{FI*hxcfX)ItJ&ZO*l-7`u!J;n3Vj5$ z?#&id@^kV=Z|zszS)OxxtB#Xcq!zKFnA5-hMdse9w{o3p8;dl&T*fP>n@pj5&tHm}zT9O&rNT)R;&joZs zzH!naw84ZQ*HF-vlPc$9b9;O1%<4}wY1*=LIbo@PM(T$X=qm<4H4nvqUX>peu8z~F zp?+0$fc_IBWa5G~WwYzHx})H-{rJ2$ZyTig;M1& literal 0 HcmV?d00001 diff --git a/OsmAnd/res/drawable-xxhdpi/ic_action_road_works_light.png b/OsmAnd/res/drawable-xxhdpi/ic_action_road_works_light.png new file mode 100644 index 0000000000000000000000000000000000000000..c1cc5eb59c7854a264e519c9257ea251e883257a GIT binary patch literal 3440 zcmbVPdpMN&9)D-tN42@rW=tdZ##{_Dquj@>%oz7kxr~{?BxcM^jF3wSu|#F9l-tHq zo0Kx)93vV+>W~^jx(H=s(~2d|Xlu`T&a=<{ao*>7-{0^1{e3^*`}cW%Z#ISOx*4(! z0sz2fcQ>N9bPe5j73HPh7sc^->7v7Trt*E*;rw_SmkBs9*kMeVdo(SA>CL1u5@PQ$ z_W*!Q9Ltx=r;Fj88+J=m|AetjZ1Hc|T0f$D9V)9{O%m`MD4ScSp4Gv>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Zg4HZZ}k%bi{Z1;^@qGl5^PJO6V7TFzRR)doa_f!}tFe7L^x59IDlCSG+6P5(Ee@xwL% literal 0 HcmV?d00001 diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 2d65f36877..3e7adf30cc 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -30,6 +30,7 @@ Share taxi routes Trolleybus routes Bus routes + Hide Routes Details Transport diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index cd81cb1d8b..accaf3e288 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -261,12 +261,16 @@ public class ConfigureMapMenu { RenderingRulesStorage renderer = activity.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer(); if (renderer != null) { List customRules = new ArrayList(renderer.PROPS.getCustomRules()); - createProperties(customRules, R.string.rendering_category_details, "details", + + createProperties(customRules, R.string.rendering_category_transport, "transport", adapter, activity); createProperties(customRules, R.string.rendering_category_routes, "routes", adapter, activity); - createProperties(customRules, R.string.rendering_category_transport, "transport", + createProperties(customRules, R.string.rendering_category_details, "details", adapter, activity); + createProperties(customRules, R.string.rendering_category_hide, "hide", + adapter, activity); + if(customRules.size() > 0) { adapter.item(R.string.rendering_category_others).setCategory(true).layout(R.layout.drawer_list_sub_header).reg(); createCustomRenderingProperties(adapter, activity, customRules); diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index cacea3bc36..95ceb3be41 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -210,7 +210,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { } }; adapter.item(R.string.layer_map).icons(R.drawable.ic_action_globus_dark, R.drawable.ic_action_globus_light) - .listen(listener).position(0).reg(); + .listen(listener).position(3).reg(); adapter.item(R.string.layer_overlay).selected(overlayLayer.getMap() != null ? 1 : 0). icons(R.drawable.ic_action_up_dark, R.drawable.ic_action_up_light).listen(listener).position(14).reg(); adapter.item(R.string.layer_underlay).selected(underlayLayer.getMap() != null ? 1 : 0) From ee2eff593fd3aac0c84340be590d43a485218428 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 2 Nov 2014 18:48:00 +0100 Subject: [PATCH 2/3] Add impassable road implementation --- .../osmand/router/RoutingConfiguration.java | 6 + OsmAnd/res/values/strings.xml | 2 + .../osmand/plus/CurrentPositionHelper.java | 8 +- .../osmand/plus/OsmAndLocationProvider.java | 4 + .../net/osmand/plus/OsmandApplication.java | 8 + .../plus/activities/MapActivityActions.java | 11 ++ .../osmand/plus/dialogs/ConfigureMapMenu.java | 1 - .../plus/helpers/AvoidSpecificRoads.java | 172 ++++++++++++++++++ .../osmand/plus/views/ContextMenuLayer.java | 17 ++ 9 files changed, 224 insertions(+), 5 deletions(-) create mode 100644 OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java diff --git a/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java b/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java index 037cd619cd..7b7d4ca14d 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java +++ b/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java @@ -135,6 +135,12 @@ public class RoutingConfiguration { return routers.get(applicationMode); } + + public void removeImpassableRoad(RouteDataObject obj) { + impassableRoadIds.remove(obj.id); + impassableRoads.remove(obj); + + } } private static int parseSilentInt(String t, int v) { diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 3e7adf30cc..ddc776da96 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,8 @@ 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 --> + Select on map + Avoid roads… Tram and train Changes in 1.9: * Updated maps styles with road surface rendering, transport layers and hiking symbols diff --git a/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java b/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java index 5057cc3d47..beff07b766 100644 --- a/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java +++ b/OsmAnd/src/net/osmand/plus/CurrentPositionHelper.java @@ -42,7 +42,7 @@ public class CurrentPositionHelper { ctx = new RoutePlannerFrontEnd(false).buildRoutingContext(cfg, null, app.getResourceManager().getRoutingMapFiles()); } - private RouteDataObject runUpdateInThread(Location loc) { + public synchronized RouteDataObject runUpdateInThread(double lat , double lon) { RoutePlannerFrontEnd rp = new RoutePlannerFrontEnd(false); try { if(ctx == null || am != app.getSettings().getApplicationMode()) { @@ -51,7 +51,7 @@ public class CurrentPositionHelper { return null; } } - RouteSegment sg = rp.findRouteSegment(loc.getLatitude(), loc.getLongitude(), ctx); + RouteSegment sg = rp.findRouteSegment(lat, lon, ctx); if(sg == null) { return null; } @@ -64,13 +64,13 @@ public class CurrentPositionHelper { private void scheduleRouteSegmentFind(final Location loc){ if(calculatingThread == Thread.currentThread()) { - lastFound = runUpdateInThread(loc); + lastFound = runUpdateInThread(loc.getLatitude(), loc.getLongitude()); } else if(calculatingThread == null && loc != null) { Runnable run = new Runnable() { @Override public void run() { try { - lastFound = runUpdateInThread(loc); + lastFound = runUpdateInThread(loc.getLatitude(), loc.getLongitude()); if (lastAskedLocation != loc) { // refresh and run new task if needed getLastKnownRouteSegment(lastAskedLocation); diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java index 85ccc9cf21..d4f4afbfd7 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java @@ -214,6 +214,10 @@ public class OsmAndLocationProvider implements SensorEventListener { currentPositionHelper = new CurrentPositionHelper(app); locationSimulation = new OsmAndLocationSimulation(app, this); } + + public RouteDataObject findRoute(double lat , double lon) { + return currentPositionHelper.runUpdateInThread(lat, lon); + } public void resumeAllUpdates() { final LocationManager service = (LocationManager) app.getSystemService(Context.LOCATION_SERVICE); diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index f00eeb7db9..a7e63613f8 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -25,6 +25,7 @@ import net.osmand.plus.activities.SettingsActivity; import net.osmand.plus.api.SQLiteAPI; import net.osmand.plus.api.SQLiteAPIImpl; import net.osmand.plus.download.DownloadActivity; +import net.osmand.plus.helpers.AvoidSpecificRoads; import net.osmand.plus.helpers.WaypointHelper; import net.osmand.plus.monitoring.LiveMonitoringHelper; import net.osmand.plus.render.NativeOsmandLibrary; @@ -109,6 +110,7 @@ public class OsmandApplication extends Application { private TargetPointsHelper targetPointsHelper; private RoutingConfiguration.Builder defaultRoutingConfig; private WaypointHelper waypointHelper; + private AvoidSpecificRoads avoidSpecificRoads; private boolean applicationInitializing = false; private Locale preferredLocale = null; @@ -161,6 +163,7 @@ public class OsmandApplication extends Application { taskManager = new OsmAndTaskManager(this); resourceManager = new ResourceManager(this); daynightHelper = new DayNightHelper(this); + avoidSpecificRoads = new AvoidSpecificRoads(this); locationProvider = new OsmAndLocationProvider(this); savingTrackHelper = new SavingTrackHelper(this); liveMonitoringHelper = new LiveMonitoringHelper(this); @@ -217,6 +220,10 @@ public class OsmandApplication extends Application { public OsmAndTaskManager getTaskManager() { return taskManager; } + + public AvoidSpecificRoads getAvoidSpecificRoads() { + return avoidSpecificRoads; + } public OsmAndLocationProvider getLocationProvider() { @@ -227,6 +234,7 @@ public class OsmandApplication extends Application { return appCustomization; } + public void setAppCustomization(OsmAndAppCustomization appCustomization) { this.appCustomization = appCustomization; this.appCustomization.setup(this); diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 6c49b9fc60..d9a87f8ee5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -758,6 +758,17 @@ public class MapActivityActions implements DialogProvider { } }).reg(); } + if(routingHelper.isRouteCalculated()) { + optionsMenuHelper.item(R.string.impassable_road) + .icons(R.drawable.ic_action_road_works_dark, R.drawable.ic_action_road_works_light) + .listen(new OnContextMenuClick() { + @Override + public boolean onContextMenuClick(ArrayAdapter adapter, int itemId, int pos, boolean isChecked) { + app.getAvoidSpecificRoads().showDialog(mapActivity); + return true; + } + }).reg(); + } // 5-9. Default actions (Layers, Configure Map screen, Settings, Search, Favorites) optionsMenuHelper.item(R.string.search_button) diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index accaf3e288..a6293ccb71 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -24,7 +24,6 @@ import net.osmand.render.RenderingRulesStorage; import android.app.AlertDialog; import android.content.DialogInterface; import android.view.View; -import android.view.View.OnClickListener; import android.widget.ArrayAdapter; import android.widget.Toast; diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java new file mode 100644 index 0000000000..56a5072d82 --- /dev/null +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -0,0 +1,172 @@ +package net.osmand.plus.helpers; + +import java.util.ArrayList; +import java.util.List; + +import net.osmand.CallbackWithObject; +import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; +import net.osmand.binary.RouteDataObject; +import net.osmand.data.LatLon; +import net.osmand.plus.OsmAndFormatter; +import net.osmand.plus.OsmandApplication; +import net.osmand.plus.R; +import net.osmand.plus.activities.MapActivity; +import net.osmand.plus.routing.RoutingHelper; +import net.osmand.plus.views.AnimateDraggingMapThread; +import net.osmand.plus.views.ContextMenuLayer; +import net.osmand.router.RoutingConfiguration; +import net.osmand.util.MapUtils; +import android.app.Activity; +import android.app.AlertDialog; +import android.app.AlertDialog.Builder; +import android.content.DialogInterface; +import android.os.AsyncTask; +import android.util.TypedValue; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +public class AvoidSpecificRoads { + private List missingRoads; + private OsmandApplication app; + + public AvoidSpecificRoads(OsmandApplication app) { + this.app = app; + missingRoads = getBuilder().getImpassableRoads(); + } + + + + protected net.osmand.router.RoutingConfiguration.Builder getBuilder() { + return RoutingConfiguration.getDefault(); + } + + + + public ArrayAdapter createAdapter(final MapActivity ctx) { + final ArrayList points = new ArrayList(); + points.add(new RouteDataObject((RouteRegion) null)); + points.addAll(missingRoads); + final LatLon mapLocation = ctx.getMapLocation(); + 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; + if (position == 0) { + TextView tv = new TextView(ctx); + tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); + v = tv; + } else { + if (v == null || v.findViewById(R.id.info_close) == null) { + v = ctx.getLayoutInflater().inflate(R.layout.waypoint_reached, null); + } + final RouteDataObject obj = getItem(position); + v.findViewById(R.id.all_points).setVisibility(View.GONE); + ((ImageView) v.findViewById(R.id.waypoint_icon)).setImageResource(app.getSettings().isLightContentMenu()? + R.drawable.ic_action_road_works_light : R.drawable.ic_action_road_works_dark); + double dist = MapUtils.getDistance(mapLocation, MapUtils.get31LatitudeY(obj.getPoint31YTile(0)) , + MapUtils.get31LongitudeX(obj.getPoint31XTile(0))); + ((TextView)v.findViewById(R.id.waypoint_dist)).setText(OsmAndFormatter.getFormattedDistance((float) dist, app)); + + ((TextView)v.findViewById(R.id.waypoint_text)).setText(getText(obj)); + View remove = v.findViewById(R.id.info_close); + remove.setVisibility(View.VISIBLE); + remove.setOnClickListener(new View.OnClickListener() { + + @Override + public void onClick(View v) { + remove(obj); + getBuilder().removeImpassableRoad(obj); + notifyDataSetChanged(); + } + }); + + } + return v; + } + + + }; + } + + + protected String getText(RouteDataObject obj) { + return RoutingHelper.formatStreetName(obj.getName(), obj.getRef(), obj.getDestinationName()); + } + + public void showDialog(final MapActivity mapActivity) { + Builder bld = new AlertDialog.Builder(mapActivity); + bld.setTitle(R.string.impassable_road); + final ArrayAdapter listAdapter = createAdapter(mapActivity); + bld.setAdapter(listAdapter, new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + if(which == 0) { + selectFromMap(mapActivity); + } else { + RouteDataObject obj = missingRoads.get(which - 1); + double lat = MapUtils.get31LatitudeY(obj.getPoint31YTile(0)); + double lon = MapUtils.get31LongitudeX(obj.getPoint31XTile(0)); + showOnMap(app, mapActivity, lat, lon, getText(obj), dialog); + } + } + + }); + bld.show(); + } + + + protected void selectFromMap(final MapActivity mapActivity) { + ContextMenuLayer cm = mapActivity.getMapLayers().getContextMenuLayer(); + cm.setSelectOnMap(new CallbackWithObject() { + + @Override + public boolean processResult(LatLon result) { + findRoad(mapActivity, result); + return true; + } + + }); + } + private void findRoad(final MapActivity activity, final LatLon loc) { + new AsyncTask() { + + @Override + protected RouteDataObject doInBackground(LatLon... params) { + return app.getLocationProvider().findRoute(loc.getLatitude(), loc.getLongitude()); + } + + protected void onPostExecute(RouteDataObject result) { + if(result != null) { + getBuilder().addImpassableRoad(result); + showDialog(activity); + } + }; + }.execute(loc); + } + + public static void showOnMap(OsmandApplication app, Activity a, double lat, double lon, String name, + DialogInterface dialog) { + if (!(a instanceof MapActivity)) { + return; + } + MapActivity ctx = (MapActivity) a; + AnimateDraggingMapThread thread = ctx.getMapView().getAnimatedDraggingThread(); + int fZoom = ctx.getMapView().getZoom() < 15 ? 15 : ctx.getMapView().getZoom(); + if (thread.isAnimating()) { + ctx.getMapView().setIntZoom(fZoom); + ctx.getMapView().setLatLon(lat, lon); + } else { + thread.startMoving(lat, lon, fZoom, true); + } + ctx.getMapLayers().getContextMenuLayer().setLocation(new LatLon(lat, lon), name); + dialog.dismiss(); + } + +} diff --git a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java index f5781ac746..29e81d39c7 100644 --- a/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/ContextMenuLayer.java @@ -7,11 +7,13 @@ import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; +import net.osmand.CallbackWithObject; import net.osmand.data.LatLon; import net.osmand.data.RotatedTileBox; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; +import alice.util.Sleep; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; @@ -70,6 +72,7 @@ public class ContextMenuLayer extends OsmandMapLayer { private Drawable boxLeg; private float scaleCoefficient = 1; private Rect textPadding; + private CallbackWithObject selectOnMap = null; public ContextMenuLayer(MapActivity activity){ this.activity = activity; @@ -170,6 +173,12 @@ public class ContextMenuLayer extends OsmandMapLayer { } } + + public void setSelectOnMap(CallbackWithObject selectOnMap) { + this.selectOnMap = selectOnMap; + } + + private void layoutText() { Rect padding = new Rect(); if (textView.getLineCount() > 0) { @@ -333,6 +342,14 @@ public class ContextMenuLayer extends OsmandMapLayer { public boolean onSingleTap(PointF point, RotatedTileBox tileBox) { boolean nativeMode = (Build.VERSION.SDK_INT >= 14) || view.getSettings().SCROLL_MAP_BY_GESTURES.get(); int val = pressedInTextView(tileBox, point.x, point.y); + if(selectOnMap != null) { + LatLon latlon = tileBox.getLatLonFromPixel(point.x, point.y); + CallbackWithObject cb = selectOnMap; + selectOnMap = null; + cb.processResult(latlon); + setLocation(latlon, null); + return true; + } if (val == 2) { setLocation(null, ""); //$NON-NLS-1$ view.refreshMap(); From b028cd622eb94dbd75fdc089934b77c5919497f5 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 3 Nov 2014 01:53:57 +0100 Subject: [PATCH 3/3] Add impassable road implementation --- OsmAnd/res/layout/main.xml | 2 +- OsmAnd/res/values/strings.xml | 2 +- .../net/osmand/plus/helpers/AvoidSpecificRoads.java | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/layout/main.xml b/OsmAnd/res/layout/main.xml index f99a56cb8f..6e501ee2aa 100644 --- a/OsmAnd/res/layout/main.xml +++ b/OsmAnd/res/layout/main.xml @@ -42,7 +42,7 @@ - Select on map + Select on map Avoid roads… Tram and train Changes in 1.9: diff --git a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java index 56a5072d82..8dacef0b7f 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java +++ b/OsmAnd/src/net/osmand/plus/helpers/AvoidSpecificRoads.java @@ -58,8 +58,9 @@ public class AvoidSpecificRoads { // User super class to create the View View v = convertView; if (position == 0) { - TextView tv = new TextView(ctx); - tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16); + TextView tv = (TextView) ctx.getLayoutInflater().inflate(R.layout.list_textview, null); + tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18); + tv.setText(app.getString(R.string.select_impassable_road)); v = tv; } else { if (v == null || v.findViewById(R.id.info_close) == null) { @@ -83,6 +84,10 @@ public class AvoidSpecificRoads { remove(obj); getBuilder().removeImpassableRoad(obj); notifyDataSetChanged(); + RoutingHelper rh = app.getRoutingHelper(); + if(rh.isRouteCalculated() || rh.isRouteBeingCalculated()) { + rh.recalculateRouteDueToSettingsChange(); + } } }); @@ -145,6 +150,10 @@ public class AvoidSpecificRoads { protected void onPostExecute(RouteDataObject result) { if(result != null) { getBuilder().addImpassableRoad(result); + RoutingHelper rh = app.getRoutingHelper(); + if(rh.isRouteCalculated() || rh.isRouteBeingCalculated()) { + rh.recalculateRouteDueToSettingsChange(); + } showDialog(activity); } };