Confirmation dialog for 'Clear recorded data'
This commit is contained in:
parent
92b9293e16
commit
f5886ee577
1 changed files with 12 additions and 2 deletions
|
@ -288,7 +288,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
|
|
||||||
public void controlDialog(final Activity activity, final boolean showTrackSelection) {
|
public void controlDialog(final Activity activity, final boolean showTrackSelection) {
|
||||||
final boolean wasTrackMonitored = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
final boolean wasTrackMonitored = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
||||||
boolean nightMode;
|
final boolean nightMode;
|
||||||
if (activity instanceof MapActivity) {
|
if (activity instanceof MapActivity) {
|
||||||
nightMode = app.getDaynightHelper().isNightModeForMapControls();
|
nightMode = app.getDaynightHelper().isNightModeForMapControls();
|
||||||
} else {
|
} else {
|
||||||
|
@ -328,7 +328,17 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
startGPXMonitoring(activity, showTrackSelection);
|
startGPXMonitoring(activity, showTrackSelection);
|
||||||
}
|
}
|
||||||
} else if (item == R.string.clear_recorded_data) {
|
} else if (item == R.string.clear_recorded_data) {
|
||||||
app.getSavingTrackHelper().clearRecordedData(true);
|
AlertDialog.Builder builder = new AlertDialog.Builder(UiUtilities.getThemedContext(activity, nightMode));
|
||||||
|
builder.setTitle(R.string.clear_recorded_data);
|
||||||
|
builder.setMessage(R.string.are_you_sure);
|
||||||
|
builder.setNegativeButton(R.string.shared_string_cancel, null).setPositiveButton(
|
||||||
|
R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
app.getSavingTrackHelper().clearRecordedData(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
builder.show();
|
||||||
} else if(item == R.string.gpx_monitoring_stop) {
|
} else if(item == R.string.gpx_monitoring_stop) {
|
||||||
stopRecording();
|
stopRecording();
|
||||||
} else if(item == R.string.gpx_start_new_segment) {
|
} else if(item == R.string.gpx_start_new_segment) {
|
||||||
|
|
Loading…
Reference in a new issue