diff --git a/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/ControlTracking.java b/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/ControlTracking.java index 557521c5..75a3101d 100644 --- a/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/ControlTracking.java +++ b/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/ControlTracking.java @@ -55,6 +55,7 @@ * @version $Id$ */ public class ControlTracking extends AppCompatActivity { + public static final String EXTRA_DEFAULT_NAME = "EXTRA_DEFAULT_NAME"; private final View.OnClickListener mLoggingControlListener = new View.OnClickListener() { @Override public void onClick(View v) { @@ -66,7 +67,11 @@ public void onClick(View v) { int precision = Integer.valueOf(preferences.getString(Helper.PRECISION_PREFERENCE, Integer.toString(ExternalConstants.LOGGING_NORMAL))); int interval = Integer.valueOf(preferences.getString(Helper.CUSTOMPRECISIONTIME_PREFERENCE, "1")); float distance = Float.valueOf(preferences.getString(Helper.CUSTOMPRECISIONDISTANCE_PREFERENCE, "1")); - GPSLoggerServiceManager.startGPSLogging(ControlTracking.this, precision, interval, distance, null); + String trackName = null; + if (getIntent().getBooleanExtra(EXTRA_DEFAULT_NAME, false)) { + trackName = NameTrack.createDefaultTrackName(ControlTracking.this); + } + GPSLoggerServiceManager.startGPSLogging(ControlTracking.this, precision, interval, distance, trackName); // Create data for the caller that a new track has been started ComponentName caller = ControlTracking.this.getCallingActivity(); if (caller != null) { diff --git a/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/NameTrack.java b/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/NameTrack.java index 87c015c3..22abae83 100644 --- a/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/NameTrack.java +++ b/studio/app/src/main/java/nl/sogeti/android/gpstracker/actions/NameTrack.java @@ -190,8 +190,7 @@ protected void onPrepareDialog(int id, Dialog dialog) { switch (id) { case DIALOG_TRACKNAME: String trackName; - Calendar c = Calendar.getInstance(); - trackName = String.format(getString(R.string.dialog_routename_default), c, c, c, c, c); + trackName = createDefaultTrackName(this); mTrackNameView.setText(trackName); mTrackNameView.setSelection(0, trackName.length()); break; @@ -200,5 +199,13 @@ protected void onPrepareDialog(int id, Dialog dialog) { break; } } + + public static String createDefaultTrackName(Context ctx) { + String trackName; + Calendar c = Calendar.getInstance(); + trackName = String.format(ctx.getString(R.string.dialog_routename_default), c, c, c, c, c); + + return trackName; + } } \ No newline at end of file diff --git a/studio/app/src/main/java/nl/sogeti/android/gpstracker/viewer/LoggerMap.java b/studio/app/src/main/java/nl/sogeti/android/gpstracker/viewer/LoggerMap.java index f96e63f7..0382a010 100644 --- a/studio/app/src/main/java/nl/sogeti/android/gpstracker/viewer/LoggerMap.java +++ b/studio/app/src/main/java/nl/sogeti/android/gpstracker/viewer/LoggerMap.java @@ -461,9 +461,7 @@ private void updateDataOverlays() { } private boolean isHardwareAccelerated() { - int trackColoringMethod = Integer.valueOf(mSharedPreferences.getString(Constants.TRACKCOLORING, "3")).intValue(); - return trackColoringMethod != SegmentOverlay.DRAW_CALCULATED && trackColoringMethod != SegmentOverlay - .DRAW_MEASURED; + return false; } private void updateSpeedColoring() { diff --git a/studio/app/src/main/java/nl/sogeti/android/gpstracker/widget/ControlWidgetProvider.java b/studio/app/src/main/java/nl/sogeti/android/gpstracker/widget/ControlWidgetProvider.java index 401ffe67..b744981f 100644 --- a/studio/app/src/main/java/nl/sogeti/android/gpstracker/widget/ControlWidgetProvider.java +++ b/studio/app/src/main/java/nl/sogeti/android/gpstracker/widget/ControlWidgetProvider.java @@ -198,6 +198,7 @@ public void onReceive(Context context, Intent intent) { int buttonId = Integer.parseInt(data.getSchemeSpecificPart()); if (buttonId == BUTTON_TRACKINGCONTROL) { Intent controlIntent = new Intent(context, ControlTracking.class); + controlIntent.putExtra(ControlTracking.EXTRA_DEFAULT_NAME, true); controlIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); controlIntent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK); context.startActivity(controlIntent);