updated functionality of context menu

This commit is contained in:
unknown 2014-06-20 16:40:46 +03:00
parent 0bcf203a88
commit 8f68ed500b
2 changed files with 7 additions and 3 deletions

View file

@ -80,6 +80,7 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
} else if (itemId == R.string.mark_as_visited) { } else if (itemId == R.string.mark_as_visited) {
plugin.getCurrentRoute().markPoint(point, true); plugin.getCurrentRoute().markPoint(point, true);
} else if (itemId == R.string.mark_as_current){ } else if (itemId == R.string.mark_as_current){
plugin.getCurrentRoute().markPoint(point, false);
plugin.getCurrentRoute().navigateToPoint(point); plugin.getCurrentRoute().navigateToPoint(point);
} else if (itemId == R.string.navigate_to_next){ } else if (itemId == R.string.navigate_to_next){
plugin.getCurrentRoute().naviateToNextPoint(); plugin.getCurrentRoute().naviateToNextPoint();
@ -89,10 +90,10 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
if (plugin.getCurrentRoute().getPointStatus(point)){ if (plugin.getCurrentRoute().getPointStatus(point)){
adapter.item(R.string.mark_as_not_visited).icons( adapter.item(R.string.mark_as_not_visited).icons(
R.drawable.ic_action_ok_dark, R.drawable.ic_action_ok_light).listen(listener).reg(); R.drawable.ic_action_gremove_dark, R.drawable.ic_action_gremove_light).listen(listener).reg();
} else { } else {
adapter.item(R.string.mark_as_visited).icons( adapter.item(R.string.mark_as_visited).icons(
R.drawable.ic_action_gremove_dark, R.drawable.ic_action_gremove_light).listen(listener).reg(); R.drawable.ic_action_ok_dark, R.drawable.ic_action_ok_light).listen(listener).reg();
} }
RoutePointsPlugin.RoutePoint routePoint = plugin.getCurrentRoute().getRoutePointFromWpt(point); RoutePointsPlugin.RoutePoint routePoint = plugin.getCurrentRoute().getRoutePointFromWpt(point);

View file

@ -119,6 +119,10 @@ public class RoutePointsPlugin extends OsmandPlugin {
@Override @Override
public void updateLayers(OsmandMapTileView mapView, MapActivity activity) { public void updateLayers(OsmandMapTileView mapView, MapActivity activity) {
if (routePointsLayer == null){
registerLayers(activity);
}
if (routeStepsControl == null) { if (routeStepsControl == null) {
registerWidget(activity); registerWidget(activity);
} }
@ -384,7 +388,6 @@ public class RoutePointsPlugin extends OsmandPlugin {
RoutePoint routePoint = getRoutePointFromWpt(point); RoutePoint routePoint = getRoutePointFromWpt(point);
if (routePoint != null) { if (routePoint != null) {
navigateToPoint(routePoint); navigateToPoint(routePoint);
} }
} }