updated icons. Added saving on changing route state

This commit is contained in:
unknown 2014-06-20 19:33:35 +03:00
parent 8f68ed500b
commit 6e2459b3c5
6 changed files with 26 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 406 B

After

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 704 B

View file

@ -3,6 +3,7 @@ package net.osmand.plus.routepointsnavigation;
import android.content.DialogInterface;
import android.graphics.Canvas;
import android.graphics.PointF;
import android.os.AsyncTask;
import net.osmand.data.LatLon;
import net.osmand.data.RotatedTileBox;
import net.osmand.plus.ContextMenuAdapter;
@ -77,13 +78,17 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) {
if (itemId == R.string.mark_as_not_visited){
plugin.getCurrentRoute().markPoint(point,false);
saveGPXAsync();
} else if (itemId == R.string.mark_as_visited) {
plugin.getCurrentRoute().markPoint(point, true);
saveGPXAsync();
} else if (itemId == R.string.mark_as_current){
plugin.getCurrentRoute().markPoint(point, false);
plugin.getCurrentRoute().navigateToPoint(point);
saveGPXAsync();
} else if (itemId == R.string.navigate_to_next){
plugin.getCurrentRoute().naviateToNextPoint();
saveGPXAsync();
}
}
};
@ -106,4 +111,25 @@ public class RoutePointsLayer extends OsmandMapLayer implements ContextMenuLaye
}
}
}
private void saveGPXAsync() {
new AsyncTask<RoutePointsPlugin.SelectedRouteGpxFile, Void, Void>() {
protected void onPreExecute() {
}
@Override
protected Void doInBackground(RoutePointsPlugin.SelectedRouteGpxFile... params) {
if(plugin.getCurrentRoute() != null) {
plugin.getCurrentRoute().saveFile();
}
return null;
}
protected void onPostExecute(Void result) {
}
}.execute(plugin.getCurrentRoute());
}
}