Merge remote-tracking branch 'origin/plan_route_options' into plan_route_options

This commit is contained in:
Dima-1 2020-08-04 12:10:44 +03:00
commit d1d3129996

View file

@ -1465,6 +1465,8 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
private ProgressDialog progressDialog; private ProgressDialog progressDialog;
private File toSave; private File toSave;
private boolean exportRouteAsGpx = false;
@Override @Override
protected void onPreExecute() { protected void onPreExecute() {
cancelModes(); cancelModes();
@ -1505,6 +1507,7 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
gpx.tracks.add(track); gpx.tracks.add(track);
} else if (saveType == SaveType.ROUTE_POINT) { } else if (saveType == SaveType.ROUTE_POINT) {
if (editingCtx.isInSnapToRoadMode()) { if (editingCtx.isInSnapToRoadMode()) {
exportRouteAsGpx = true;
editingCtx.exportRouteAsGpx(trackName, new ExportAsGpxListener() { editingCtx.exportRouteAsGpx(trackName, new ExportAsGpxListener() {
@Override @Override
public void onExportAsGpxFinished(GPXFile gpx) { public void onExportAsGpxFinished(GPXFile gpx) {
@ -1589,8 +1592,10 @@ public class MeasurementToolFragment extends BaseOsmAndFragment {
@Override @Override
protected void onPostExecute(Exception warning) { protected void onPostExecute(Exception warning) {
if (!exportRouteAsGpx) {
onGpxSaved(warning); onGpxSaved(warning);
} }
}
private void onGpxSaved(Exception warning) { private void onGpxSaved(Exception warning) {
final MapActivity mapActivity = getMapActivity(); final MapActivity mapActivity = getMapActivity();