fixed bug with wrong xml tags on saving

This commit is contained in:
unknown 2014-06-12 14:25:30 +03:00
commit 67288e79be
2 changed files with 57 additions and 45 deletions

View file

@ -21,7 +21,6 @@ public class RouteStepsPlugin extends OsmandPlugin {
private static final String VISITED_KEY = "IsVisited";
private static final String POINT_KEY = "Point";
private static final String CURRENT_ROUTE_KEY = "CurrentRoute";
private int routeKey;
private OsmandApplication app;
@ -35,6 +34,7 @@ public class RouteStepsPlugin extends OsmandPlugin {
private List<Boolean> pointsStatus;
public RouteStepsPlugin(OsmandApplication app){
this.app = app;
this.file = new File("/storage/emulated/0/osmand/tracks/","504.gpx");
@ -45,13 +45,9 @@ public class RouteStepsPlugin extends OsmandPlugin {
getAllPointsStatus();
}
public void setGpxFile(GPXUtilities.GPXFile file) {
this.gpx = file;
}
public void setGpxFile(GPXUtilities.GPXFile file){ this.gpx = file;}
public void saveGPXFile() {
GPXUtilities.writeGpxFile(file, gpx, app);
}
public void saveGPXFile(){ GPXUtilities.writeGpxFile(file,gpx,app); }
public void setCurrentPoint(GPXUtilities.WptPt point){
currentPoint = point;
@ -95,14 +91,13 @@ public class RouteStepsPlugin extends OsmandPlugin {
//registerWidget(activity);
}
public List<GPXUtilities.WptPt> getPoints() {
return currentRoute.points;
}
public List<GPXUtilities.WptPt> getPoints() {return currentRoute.points;}
public boolean getPointStatus(int numberOfPoint) {
Map<String, String> map = gpx.getExtensionsToRead();
Map<String, String> map = currentRoute.getExtensionsToRead();
String mapKey = routeKey + POINT_KEY + numberOfPoint + VISITED_KEY;
String mapKey = POINT_KEY + numberOfPoint + VISITED_KEY;
if (map.containsKey(mapKey)){
String value = map.get(mapKey);
return (value.equals("true"));
@ -113,9 +108,9 @@ public class RouteStepsPlugin extends OsmandPlugin {
//saves point status value to gpx extention file
public void setPointStatus(int numberOfPoint, boolean status) {
Map<String, String> map = gpx.getExtensionsToWrite();
Map<String, String> map = currentRoute.getExtensionsToWrite();
String mapKey = routeKey + POINT_KEY + numberOfPoint + VISITED_KEY;
String mapKey = POINT_KEY + numberOfPoint + VISITED_KEY;
if (status){
map.put(mapKey, "true");
} else {
@ -143,14 +138,11 @@ public class RouteStepsPlugin extends OsmandPlugin {
for(GPXUtilities.Route route : gpx.routes){
if (route.name.equals(routeName)){
currentRoute = route;
routeKey = i;
return;
}
i++;
}
}
routeKey = 0;
currentRoute = gpx.routes.get(0);
}

View file

@ -0,0 +1,20 @@
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}