fixed bug with points no loading. Fixed bug on first load of gpx file.

This commit is contained in:
unknown 2014-06-19 17:08:28 +03:00
parent e3dbd574d0
commit d00b5bff41
3 changed files with 11 additions and 6 deletions

View file

@ -83,10 +83,10 @@ public abstract class OsmandPlugin {
installedPlugins.add(parking);
}
if(Version.isRouteNavPluginInlined(app)) {
//if(Version.isRouteNavPluginInlined(app)) {
RoutePointsPlugin routePointsPlugin = new RoutePointsPlugin(app);
installedPlugins.add(routePointsPlugin);
}
//}
installPlugin(OSMODROID_PLUGIN_COMPONENT, OsMoDroidPlugin.ID, app, new OsMoDroidPlugin(app));
installedPlugins.add(new OsmEditingPlugin(app));

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();
}