From a34fc80999181f9dd7ee36783ad1cf1e35cd9fde Mon Sep 17 00:00:00 2001 From: Denis Date: Tue, 15 Jul 2014 16:00:11 +0400 Subject: [PATCH] Updated new sleep mode functionality --- OsmAnd/res/values/strings.xml | 4 +++- .../views/mapwidgets/MapInfoWidgetsFactory.java | 14 +++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 36b811ee21..40061edb64 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -1919,7 +1919,9 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A Play sound on photo shot Choose whether to play a sound when shooting photos Invalid format: %s - Do you want to stop service? + Do you want to stop sleep mode service? Keep Stop + Enable sleep mode + Service off interval diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index f82a7843c2..140d2557eb 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -101,7 +101,7 @@ public class MapInfoWidgetsFactory { public void onClick(View view) { if (app.getNavigationService() != null){ AlertDialog.Builder dlg = new AlertDialog.Builder(map); - dlg.setTitle(app.getString(R.string.navigation_stop_dialog)); + dlg.setTitle(app.getString(R.string.sleep_mode_stop_dialog)); dlg.setPositiveButton(app.getString(R.string.keep_navigation_service), null); dlg.setNegativeButton(app.getString(R.string.stop_navigation_service), new DialogInterface.OnClickListener() { @Override @@ -114,19 +114,15 @@ public class MapInfoWidgetsFactory { } else { final MonitoringInfoControl.ValueHolder vs = new MonitoringInfoControl.ValueHolder(); - vs.value = app.getSettings().SAVE_GLOBAL_TRACK_INTERVAL.get(); - OsmandMonitoringPlugin.showIntervalChooseDialog(map, app.getString(R.string.save_track_interval) + " : %s", - app.getString(R.string.save_track_to_gpx), + vs.value = app.getSettings().SERVICE_OFF_INTERVAL.get(); + OsmandMonitoringPlugin.showIntervalChooseDialog(map, app.getString(R.string.gps_wake_up_timer) + " : %s", + app.getString(R.string.enable_sleep_mode), OsmandMonitoringPlugin.SECONDS, OsmandMonitoringPlugin.MINUTES, vs, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - app.getSettings().SAVE_GLOBAL_TRACK_INTERVAL.set(vs.value); - app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.set(true); - if (app.getNavigationService() == null) { - app.getSettings().SERVICE_OFF_INTERVAL.set(0); - } + app.getSettings().SERVICE_OFF_INTERVAL.set(vs.value); app.startNavigationService(NavigationService.USED_BY_GPX); } });