diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 2eb0676d05..52961783f9 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -9,7 +9,12 @@
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
-->
- Preferred lanaguage for labels on the map (if it is not available will switch to English or to local names)
+ Keep
+ Stop
+ Enable sleep mode
+ GPS wake up interval
+ Keep GPS on?
+ Preferred lanaguage for labels on the map (if it is not available will switch to English or to local names)
Map prefferred language
Local names
Swahili
@@ -471,11 +476,11 @@
\n\t* Additional settings for stabilizing compass
\n\t* Top left button on the map screen replaces Menu button
- Logging services & Sleep mode
+ Logging services
Configure how to record trips and enable sleep mode
Enable tracking and navigation in sleep (screen off) mode via periodically waking up the GPS device.
Show settings facilitating to record your trips to local GPX files or online using a web service.
- Logging services & Sleep Mode
+ Logging services
Show settings to enable tracking and navigation in sleep (screen off) mode via periodically waking up the GPS device.
Install version
Choose application theme
diff --git a/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java b/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java
index 6b1962949a..e019245a45 100644
--- a/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java
+++ b/OsmAnd/src/net/osmand/plus/monitoring/SettingsMonitoringActivity.java
@@ -28,7 +28,7 @@ public class SettingsMonitoringActivity extends SettingsBaseActivity {
public static final int[] BG_SECONDS = new int[]{0, 30, 60, 90};
public static final int[] BG_MINUTES = new int[]{2, 3, 5, 10, 15, 30, 60, 90};
- private final static boolean REGISTER_BG_SETTINGS = true;
+ private final static boolean REGISTER_BG_SETTINGS = false;
private static final int[] SECONDS = OsmandMonitoringPlugin.SECONDS;
private static final int[] MINUTES = OsmandMonitoringPlugin.MINUTES;
diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
index 0e748d570c..140d2557eb 100644
--- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
+++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java
@@ -1,16 +1,18 @@
package net.osmand.plus.views.mapwidgets;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
import net.osmand.Location;
import net.osmand.access.AccessibleToast;
import net.osmand.binary.RouteDataObject;
-import net.osmand.plus.OsmAndFormatter;
-import net.osmand.plus.OsmAndLocationProvider;
+import net.osmand.plus.*;
import net.osmand.plus.OsmAndLocationProvider.GPSInfo;
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.routing.RouteDirectionInfo;
import net.osmand.plus.routing.RoutingHelper;
+import net.osmand.plus.views.MonitoringInfoControl;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.ShadowText;
@@ -94,6 +96,40 @@ public class MapInfoWidgetsFactory {
};
gpsInfoControl.setImageDrawable(app.getResources().getDrawable(R.drawable.widget_gps_info));
gpsInfoControl.setText(null, null);
+ gpsInfoControl.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (app.getNavigationService() != null){
+ AlertDialog.Builder dlg = new AlertDialog.Builder(map);
+ 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
+ public void onClick(DialogInterface dialogInterface, int i) {
+ Intent serviceIntent = new Intent(app, NavigationService.class);
+ app.stopService(serviceIntent);
+ }
+ });
+ dlg.show();
+
+ } else {
+ final MonitoringInfoControl.ValueHolder vs = new MonitoringInfoControl.ValueHolder();
+ 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().SERVICE_OFF_INTERVAL.set(vs.value);
+ app.startNavigationService(NavigationService.USED_BY_GPX);
+ }
+ });
+ }
+
+ }
+ });
return gpsInfoControl;
}