Merge pull request #703 from Bars107/master

Fixes to route points plugin.
This commit is contained in:
vshcherb 2014-06-19 16:12:29 +02:00
commit 14cc9bd1b4
2 changed files with 9 additions and 4 deletions

View file

@ -77,7 +77,9 @@ public class RoutePointsActivity extends OsmandListActivity {
app.getSelectedGpxHelper().setGpxFileToDisplay(gpx);
plugin.setCurrentRoute(gpx);
SelectedRouteGpxFile sgpx = plugin.getCurrentRoute();
sgpx.naviateToNextPoint();
if (!sgpx.getCurrentPoints().get(0).isNextNavigate){
sgpx.naviateToNextPoint();
}
prepareView();
return false;
}
@ -265,6 +267,7 @@ public class RoutePointsActivity extends OsmandListActivity {
if (menuItem.getItemId() == MARK_AS_CURRENT_ID) {
plugin.getCurrentRoute().navigateToPoint(rp);
saveGPXAsync();
prepareView();
} else if (menuItem.getItemId() == POI_ON_MAP_ID) {
LatLon point = rp.getPoint();
app.getSettings().setMapLocationToShow(point.getLatitude(), point.getLongitude(),
@ -274,6 +277,7 @@ public class RoutePointsActivity extends OsmandListActivity {
// inverts selection state of item
plugin.getCurrentRoute().markPoint(rp, !rp.isVisited());
saveGPXAsync();
prepareView();
}
actionMode.finish();
return true;

View file

@ -135,7 +135,7 @@ public class RoutePointsPlugin extends OsmandPlugin {
}
});
routeStepsControl.setText(null, null);
routeStepsControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_parking));
routeStepsControl.setImageDrawable(map.getResources().getDrawable(R.drawable.widget_target));
return routeStepsControl;
}
@ -213,7 +213,7 @@ public class RoutePointsPlugin extends OsmandPlugin {
public int getVisitedCount() {
int k = 0;
for(RoutePoint rp : currentPoints) {
if(!rp.isVisited()) {
if(rp.isVisited()) {
k++;
}
}
@ -300,6 +300,7 @@ public class RoutePointsPlugin extends OsmandPlugin {
WptPt wptPt = rt.points.get(i);
RoutePoint rtp = new RoutePoint();
rtp.gpxOrder = i;
rtp.wpt = wptPt;
String time = wptPt.getExtensionsToRead().get(VISITED_KEY);
try {
rtp.visitedTime = Long.parseLong(time);
@ -309,7 +310,7 @@ public class RoutePointsPlugin extends OsmandPlugin {
if(rtp.isNextNavigate) {
locName = null;
}
currentPoints.add(rtp);
}
sortPoints();
}