forked from upstream-mirrors/OpenTracks
Cleanup and default track name is location+date.
This commit is contained in:
+1
-28
@@ -45,10 +45,8 @@ public class AdvancedSettingsActivity extends AbstractSettingsActivity {
|
|||||||
|
|
||||||
private static final String TAG = AdvancedSettingsActivity.class.getSimpleName();
|
private static final String TAG = AdvancedSettingsActivity.class.getSimpleName();
|
||||||
|
|
||||||
private static final int DIALOG_CONFIRM_ALLOW_ACCESS_ID = 0;
|
|
||||||
private static final int DIALOG_CONFIRM_RESET_ID = 1;
|
private static final int DIALOG_CONFIRM_RESET_ID = 1;
|
||||||
|
|
||||||
private CheckBoxPreference allowAccessCheckBoxPreference;
|
|
||||||
private Preference resetPreference;
|
private Preference resetPreference;
|
||||||
|
|
||||||
private SharedPreferences sharedPreferences;
|
private SharedPreferences sharedPreferences;
|
||||||
@@ -90,20 +88,6 @@ public class AdvancedSettingsActivity extends AbstractSettingsActivity {
|
|||||||
setPhotoSizeSummaryAndOptions(summary, options, values);
|
setPhotoSizeSummaryAndOptions(summary, options, values);
|
||||||
configureListPreference(preference, summary, options, values, String.valueOf(value), null);
|
configureListPreference(preference, summary, options, values, String.valueOf(value), null);
|
||||||
|
|
||||||
allowAccessCheckBoxPreference = (CheckBoxPreference) findPreference(
|
|
||||||
getString(R.string.allow_access_key));
|
|
||||||
allowAccessCheckBoxPreference.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onPreferenceChange(Preference pref, Object newValue) {
|
|
||||||
if ((Boolean) newValue) {
|
|
||||||
showDialog(DIALOG_CONFIRM_ALLOW_ACCESS_ID);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
|
|
||||||
resetPreference = findPreference(getString(R.string.settings_reset_key));
|
resetPreference = findPreference(getString(R.string.settings_reset_key));
|
||||||
@@ -133,16 +117,6 @@ public class AdvancedSettingsActivity extends AbstractSettingsActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog(int id) {
|
protected Dialog onCreateDialog(int id) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case DIALOG_CONFIRM_ALLOW_ACCESS_ID:
|
|
||||||
return DialogUtils.createConfirmationDialog(this,
|
|
||||||
R.string.settings_sharing_allow_access_confirm_title,
|
|
||||||
getString(R.string.settings_sharing_allow_access_confirm_message),
|
|
||||||
new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int button) {
|
|
||||||
allowAccessCheckBoxPreference.setChecked(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
case DIALOG_CONFIRM_RESET_ID:
|
case DIALOG_CONFIRM_RESET_ID:
|
||||||
return DialogUtils.createConfirmationDialog(this, R.string.settings_reset_confirm_title,
|
return DialogUtils.createConfirmationDialog(this, R.string.settings_reset_confirm_title,
|
||||||
getString(R.string.settings_reset_confirm_message),
|
getString(R.string.settings_reset_confirm_message),
|
||||||
@@ -204,8 +178,7 @@ public class AdvancedSettingsActivity extends AbstractSettingsActivity {
|
|||||||
AdvancedSettingsActivity.this, R.string.settings_reset_done, Toast.LENGTH_SHORT)
|
AdvancedSettingsActivity.this, R.string.settings_reset_done, Toast.LENGTH_SHORT)
|
||||||
.show();
|
.show();
|
||||||
// Restart the settings activity so all changes are loaded
|
// Restart the settings activity so all changes are loaded
|
||||||
Intent intent = getIntent()
|
Intent intent = getIntent().addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -45,8 +45,7 @@ public class DialogUtils {
|
|||||||
* @param message the message
|
* @param message the message
|
||||||
* @param okListener the listener when OK is clicked
|
* @param okListener the listener when OK is clicked
|
||||||
*/
|
*/
|
||||||
public static Dialog createConfirmationDialog(
|
public static Dialog createConfirmationDialog(final Context context, int titleId, String message, DialogInterface.OnClickListener okListener) {
|
||||||
final Context context, int titleId, String message, DialogInterface.OnClickListener okListener) {
|
|
||||||
final AlertDialog alertDialog = new AlertDialog.Builder(context)
|
final AlertDialog alertDialog = new AlertDialog.Builder(context)
|
||||||
.setCancelable(true)
|
.setCancelable(true)
|
||||||
.setIcon(android.R.drawable.ic_dialog_alert)
|
.setIcon(android.R.drawable.ic_dialog_alert)
|
||||||
@@ -71,8 +70,7 @@ public class DialogUtils {
|
|||||||
* @param messageId the progress message id
|
* @param messageId the progress message id
|
||||||
* @param onCancelListener the cancel listener
|
* @param onCancelListener the cancel listener
|
||||||
*/
|
*/
|
||||||
public static ProgressDialog createSpinnerProgressDialog(
|
public static ProgressDialog createSpinnerProgressDialog(Context context, int messageId, DialogInterface.OnCancelListener onCancelListener) {
|
||||||
Context context, int messageId, DialogInterface.OnCancelListener onCancelListener) {
|
|
||||||
return createProgressDialog(true, context, messageId, onCancelListener);
|
return createProgressDialog(true, context, messageId, onCancelListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,8 +82,7 @@ public class DialogUtils {
|
|||||||
* @param onCancelListener the cancel listener
|
* @param onCancelListener the cancel listener
|
||||||
* @param formatArgs the format arguments for the messageId
|
* @param formatArgs the format arguments for the messageId
|
||||||
*/
|
*/
|
||||||
public static ProgressDialog createHorizontalProgressDialog(Context context, int messageId,
|
public static ProgressDialog createHorizontalProgressDialog(Context context, int messageId, DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
|
||||||
DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
|
|
||||||
return createProgressDialog(false, context, messageId, onCancelListener, formatArgs);
|
return createProgressDialog(false, context, messageId, onCancelListener, formatArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,8 +95,7 @@ public class DialogUtils {
|
|||||||
* @param onCancelListener the cancel listener
|
* @param onCancelListener the cancel listener
|
||||||
* @param formatArgs the format arguments for the message id
|
* @param formatArgs the format arguments for the message id
|
||||||
*/
|
*/
|
||||||
private static ProgressDialog createProgressDialog(boolean spinner, final Context context,
|
private static ProgressDialog createProgressDialog(boolean spinner, final Context context, int messageId, DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
|
||||||
int messageId, DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
|
|
||||||
final ProgressDialog progressDialog = new ProgressDialog(context);
|
final ProgressDialog progressDialog = new ProgressDialog(context);
|
||||||
progressDialog.setCancelable(true);
|
progressDialog.setCancelable(true);
|
||||||
progressDialog.setCanceledOnTouchOutside(false);
|
progressDialog.setCanceledOnTouchOutside(false);
|
||||||
@@ -107,8 +103,7 @@ public class DialogUtils {
|
|||||||
progressDialog.setIndeterminate(true);
|
progressDialog.setIndeterminate(true);
|
||||||
progressDialog.setMessage(context.getString(messageId, formatArgs));
|
progressDialog.setMessage(context.getString(messageId, formatArgs));
|
||||||
progressDialog.setOnCancelListener(onCancelListener);
|
progressDialog.setOnCancelListener(onCancelListener);
|
||||||
progressDialog.setProgressStyle(spinner ? ProgressDialog.STYLE_SPINNER
|
progressDialog.setProgressStyle(spinner ? ProgressDialog.STYLE_SPINNER : ProgressDialog.STYLE_HORIZONTAL);
|
||||||
: ProgressDialog.STYLE_HORIZONTAL);
|
|
||||||
progressDialog.setTitle(R.string.generic_progress_title);
|
progressDialog.setTitle(R.string.generic_progress_title);
|
||||||
progressDialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
progressDialog.setOnShowListener(new DialogInterface.OnShowListener() {
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class PreferencesUtils {
|
|||||||
public static final boolean STATS_SHOW_GRADE_ELEVATION_DEFAULT = false;
|
public static final boolean STATS_SHOW_GRADE_ELEVATION_DEFAULT = false;
|
||||||
public static final String STATS_UNITS_DEFAULT = "METRIC";
|
public static final String STATS_UNITS_DEFAULT = "METRIC";
|
||||||
|
|
||||||
public static final String TRACK_NAME_DEFAULT = "LOCATION";
|
public static final String TRACK_NAME_DEFAULT = "DATE_ISO_8601_LOCATION";
|
||||||
|
|
||||||
// Track widget
|
// Track widget
|
||||||
public static final int TRACK_WIDGET_ITEM1_DEFAULT = 3; // moving time
|
public static final int TRACK_WIDGET_ITEM1_DEFAULT = 3; // moving time
|
||||||
@@ -93,8 +93,6 @@ public class PreferencesUtils {
|
|||||||
public static final int TRACK_WIDGET_ITEM4_DEFAULT = 2; // average speed
|
public static final int TRACK_WIDGET_ITEM4_DEFAULT = 2; // average speed
|
||||||
public static final int VOICE_FREQUENCY_DEFAULT = 0;
|
public static final int VOICE_FREQUENCY_DEFAULT = 0;
|
||||||
|
|
||||||
private static final String TAG = PreferencesUtils.class.getSimpleName();
|
|
||||||
|
|
||||||
private PreferencesUtils() {}
|
private PreferencesUtils() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,8 +113,7 @@ public class PreferencesUtils {
|
|||||||
* @param defaultValue the default value
|
* @param defaultValue the default value
|
||||||
*/
|
*/
|
||||||
public static boolean getBoolean(Context context, int keyId, boolean defaultValue) {
|
public static boolean getBoolean(Context context, int keyId, boolean defaultValue) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
return sharedPreferences.getBoolean(getKey(context, keyId), defaultValue);
|
return sharedPreferences.getBoolean(getKey(context, keyId), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,8 +125,7 @@ public class PreferencesUtils {
|
|||||||
* @param value the value
|
* @param value the value
|
||||||
*/
|
*/
|
||||||
public static void setBoolean(Context context, int keyId, boolean value) {
|
public static void setBoolean(Context context, int keyId, boolean value) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
Editor editor = sharedPreferences.edit();
|
Editor editor = sharedPreferences.edit();
|
||||||
editor.putBoolean(getKey(context, keyId), value);
|
editor.putBoolean(getKey(context, keyId), value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
@@ -143,8 +139,7 @@ public class PreferencesUtils {
|
|||||||
* @param defaultValue the default value
|
* @param defaultValue the default value
|
||||||
*/
|
*/
|
||||||
public static int getInt(Context context, int keyId, int defaultValue) {
|
public static int getInt(Context context, int keyId, int defaultValue) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
return sharedPreferences.getInt(getKey(context, keyId), defaultValue);
|
return sharedPreferences.getInt(getKey(context, keyId), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,8 +151,7 @@ public class PreferencesUtils {
|
|||||||
* @param value the value
|
* @param value the value
|
||||||
*/
|
*/
|
||||||
public static void setInt(Context context, int keyId, int value) {
|
public static void setInt(Context context, int keyId, int value) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
Editor editor = sharedPreferences.edit();
|
Editor editor = sharedPreferences.edit();
|
||||||
editor.putInt(getKey(context, keyId), value);
|
editor.putInt(getKey(context, keyId), value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
@@ -171,8 +165,7 @@ public class PreferencesUtils {
|
|||||||
* @param defaultValue the default value
|
* @param defaultValue the default value
|
||||||
*/
|
*/
|
||||||
public static float getFloat(Context context, int keyId, float defaultValue) {
|
public static float getFloat(Context context, int keyId, float defaultValue) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
return sharedPreferences.getFloat(getKey(context, keyId), defaultValue);
|
return sharedPreferences.getFloat(getKey(context, keyId), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,8 +177,7 @@ public class PreferencesUtils {
|
|||||||
* @param value the value
|
* @param value the value
|
||||||
*/
|
*/
|
||||||
public static void setFloat(Context context, int keyId, float value) {
|
public static void setFloat(Context context, int keyId, float value) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
Editor editor = sharedPreferences.edit();
|
Editor editor = sharedPreferences.edit();
|
||||||
editor.putFloat(getKey(context, keyId), value);
|
editor.putFloat(getKey(context, keyId), value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
@@ -198,8 +190,7 @@ public class PreferencesUtils {
|
|||||||
* @param keyId the key id
|
* @param keyId the key id
|
||||||
*/
|
*/
|
||||||
public static long getLong(Context context, int keyId) {
|
public static long getLong(Context context, int keyId) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
return sharedPreferences.getLong(getKey(context, keyId), -1L);
|
return sharedPreferences.getLong(getKey(context, keyId), -1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,8 +202,7 @@ public class PreferencesUtils {
|
|||||||
* @param value the value
|
* @param value the value
|
||||||
*/
|
*/
|
||||||
public static void setLong(Context context, int keyId, long value) {
|
public static void setLong(Context context, int keyId, long value) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
Editor editor = sharedPreferences.edit();
|
Editor editor = sharedPreferences.edit();
|
||||||
editor.putLong(getKey(context, keyId), value);
|
editor.putLong(getKey(context, keyId), value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
@@ -226,8 +216,7 @@ public class PreferencesUtils {
|
|||||||
* @param defaultValue default value
|
* @param defaultValue default value
|
||||||
*/
|
*/
|
||||||
public static String getString(Context context, int keyId, String defaultValue) {
|
public static String getString(Context context, int keyId, String defaultValue) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
return sharedPreferences.getString(getKey(context, keyId), defaultValue);
|
return sharedPreferences.getString(getKey(context, keyId), defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,8 +228,7 @@ public class PreferencesUtils {
|
|||||||
* @param value the value
|
* @param value the value
|
||||||
*/
|
*/
|
||||||
public static void setString(Context context, int keyId, String value) {
|
public static void setString(Context context, int keyId, String value) {
|
||||||
SharedPreferences sharedPreferences = context.getSharedPreferences(
|
SharedPreferences sharedPreferences = context.getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
|
||||||
Editor editor = sharedPreferences.edit();
|
Editor editor = sharedPreferences.edit();
|
||||||
editor.putString(getKey(context, keyId), value);
|
editor.putString(getKey(context, keyId), value);
|
||||||
editor.apply();
|
editor.apply();
|
||||||
@@ -252,8 +240,7 @@ public class PreferencesUtils {
|
|||||||
* @param context the context
|
* @param context the context
|
||||||
*/
|
*/
|
||||||
public static boolean isMetricUnits(Context context) {
|
public static boolean isMetricUnits(Context context) {
|
||||||
return STATS_UNITS_DEFAULT.equals(
|
return STATS_UNITS_DEFAULT.equals(getString(context, R.string.stats_units_key, STATS_UNITS_DEFAULT));
|
||||||
getString(context, R.string.stats_units_key, STATS_UNITS_DEFAULT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -263,8 +250,7 @@ public class PreferencesUtils {
|
|||||||
* @param context the context
|
* @param context the context
|
||||||
*/
|
*/
|
||||||
public static boolean isReportSpeed(Context context) {
|
public static boolean isReportSpeed(Context context) {
|
||||||
return STATS_RATE_DEFAULT.equals(
|
return STATS_RATE_DEFAULT.equals(getString(context, R.string.stats_rate_key, STATS_RATE_DEFAULT));
|
||||||
getString(context, R.string.stats_rate_key, STATS_RATE_DEFAULT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -273,30 +259,6 @@ public class PreferencesUtils {
|
|||||||
* @param context the context
|
* @param context the context
|
||||||
*/
|
*/
|
||||||
public static boolean isChartByDistance(Context context) {
|
public static boolean isChartByDistance(Context context) {
|
||||||
return CHART_X_AXIS_DEFAULT.equals(
|
return CHART_X_AXIS_DEFAULT.equals(getString(context, R.string.chart_x_axis_key, CHART_X_AXIS_DEFAULT));
|
||||||
getString(context, R.string.chart_x_axis_key, CHART_X_AXIS_DEFAULT));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a value to a list.
|
|
||||||
*
|
|
||||||
* @param context the context
|
|
||||||
* @param keyId the key id
|
|
||||||
* @param defaultValue the default value
|
|
||||||
* @param value the value
|
|
||||||
*/
|
|
||||||
public static void addToList(Context context, int keyId, String defaultValue, String value) {
|
|
||||||
String list = getString(context, keyId, defaultValue);
|
|
||||||
if (defaultValue.equals(list)) {
|
|
||||||
setString(context, keyId, value);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String[] items = TextUtils.split(list, ";");
|
|
||||||
for (String item : items) {
|
|
||||||
if (value.equals(item)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setString(context, keyId, list + ";" + value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,26 +50,18 @@ public class TrackNameUtils {
|
|||||||
* @param startTime the track start time
|
* @param startTime the track start time
|
||||||
* @param location the track location, can be null
|
* @param location the track location, can be null
|
||||||
*/
|
*/
|
||||||
public static String getTrackName(
|
public static String getTrackName(Context context, long trackId, long startTime, Location location) {
|
||||||
Context context, long trackId, long startTime, Location location) {
|
String trackName = PreferencesUtils.getString(context, R.string.track_name_key, PreferencesUtils.TRACK_NAME_DEFAULT);
|
||||||
String trackName = PreferencesUtils.getString(
|
|
||||||
context, R.string.track_name_key, PreferencesUtils.TRACK_NAME_DEFAULT);
|
|
||||||
|
|
||||||
if (trackName.equals(
|
if (trackName.equals(context.getString(R.string.settings_recording_track_name_location_value))) {
|
||||||
context.getString(R.string.settings_recording_track_name_location_value))) {
|
|
||||||
// Use the startTime if location is null
|
// Use the startTime if location is null
|
||||||
return location != null ? getReverseGeoCoding(context, location)
|
return location != null ? getReverseGeoCoding(context, location) : StringUtils.formatDateTime(context, startTime);
|
||||||
: StringUtils.formatDateTime(context, startTime);
|
} else if (trackName.equals(context.getString(R.string.settings_recording_track_name_date_local_value))) {
|
||||||
} else if (trackName.equals(
|
|
||||||
context.getString(R.string.settings_recording_track_name_date_local_value))) {
|
|
||||||
return StringUtils.formatDateTime(context, startTime);
|
return StringUtils.formatDateTime(context, startTime);
|
||||||
} else if (trackName.equals(
|
} else if (trackName.equals(context.getString(R.string.settings_recording_track_name_date_iso_8601_value))) {
|
||||||
context.getString(R.string.settings_recording_track_name_date_iso_8601_value))) {
|
|
||||||
return new SimpleDateFormat(ISO_8601_FORMAT, Locale.US).format(startTime);
|
return new SimpleDateFormat(ISO_8601_FORMAT, Locale.US).format(startTime);
|
||||||
} else if (trackName.equals(
|
} else if (trackName.equals(context.getString(R.string.settings_recording_track_name_date_iso_8601_location_value))) {
|
||||||
context.getString(R.string.settings_recording_track_name_date_iso_8601_location_value))) {
|
StringBuilder builder = new StringBuilder(new SimpleDateFormat(ISO_8601_FORMAT, Locale.US).format(startTime));
|
||||||
StringBuilder builder = new StringBuilder(
|
|
||||||
new SimpleDateFormat(ISO_8601_FORMAT, Locale.US).format(startTime));
|
|
||||||
|
|
||||||
if (location != null) {
|
if (location != null) {
|
||||||
String address = getReverseGeoCoding(context, location);
|
String address = getReverseGeoCoding(context, location);
|
||||||
|
|||||||
@@ -197,11 +197,6 @@ limitations under the License.
|
|||||||
<item>@string/settings_map_track_color_mode_fixed_summary</item>
|
<item>@string/settings_map_track_color_mode_fixed_summary</item>
|
||||||
<item>@string/settings_map_track_color_mode_dynamic_summary</item>
|
<item>@string/settings_map_track_color_mode_dynamic_summary</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
<string-array name="track_color_mode_values">
|
|
||||||
<item>@string/settings_map_track_color_mode_single_value</item>
|
|
||||||
<item>@string/settings_map_track_color_mode_fixed_value</item>
|
|
||||||
<item>@string/settings_map_track_color_mode_dynamic_value</item>
|
|
||||||
</string-array>
|
|
||||||
<string-array name="track_name_options">
|
<string-array name="track_name_options">
|
||||||
<item>@string/settings_recording_track_name_location_option</item>
|
<item>@string/settings_recording_track_name_location_option</item>
|
||||||
<item>@string/settings_recording_track_name_date_local_option</item>
|
<item>@string/settings_recording_track_name_date_local_option</item>
|
||||||
|
|||||||
@@ -21,14 +21,11 @@ limitations under the License.
|
|||||||
<string name="marker_statistics_icon_url">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
|
<string name="marker_statistics_icon_url">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
|
||||||
<string name="marker_waypoint_icon_url">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
|
<string name="marker_waypoint_icon_url">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
|
||||||
<string name="my_tracks_recording_service_name">My Tracks Recording Service</string>
|
<string name="my_tracks_recording_service_name">My Tracks Recording Service</string>
|
||||||
<string name="my_tracks_web_url">www.google.com/mobile/mytracks</string>
|
<string name="my_tracks_web_url">TODO</string>
|
||||||
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
||||||
<string name="sensor_type_value_none">NONE</string>
|
<string name="sensor_type_value_none">NONE</string>
|
||||||
<string name="sensor_unit_rounds_per_minute">RPM</string>
|
<string name="sensor_unit_rounds_per_minute">RPM</string>
|
||||||
<string name="sensor_unit_beats_per_minute">BPM</string>
|
<string name="sensor_unit_beats_per_minute">BPM</string>
|
||||||
<string name="settings_map_track_color_mode_dynamic_value">DYNAMIC</string>
|
|
||||||
<string name="settings_map_track_color_mode_fixed_value">FIXED</string>
|
|
||||||
<string name="settings_map_track_color_mode_single_value">SINGLE</string>
|
|
||||||
<string name="settings_recording_track_name_date_iso_8601_value">DATE_ISO_8601</string>
|
<string name="settings_recording_track_name_date_iso_8601_value">DATE_ISO_8601</string>
|
||||||
<string name="settings_recording_track_name_date_iso_8601_location_value">DATE_ISO_8601_LOCATION</string>
|
<string name="settings_recording_track_name_date_iso_8601_location_value">DATE_ISO_8601_LOCATION</string>
|
||||||
<string name="settings_recording_track_name_date_local_value">DATE_LOCAL</string>
|
<string name="settings_recording_track_name_date_local_value">DATE_LOCAL</string>
|
||||||
|
|||||||
@@ -20,12 +20,6 @@ limitations under the License.
|
|||||||
android:defaultValue="1024"
|
android:defaultValue="1024"
|
||||||
android:key="@string/photo_size_key"
|
android:key="@string/photo_size_key"
|
||||||
android:title="@string/settings_advanced_photo_size_title" />
|
android:title="@string/settings_advanced_photo_size_title" />
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="@string/allow_access_key"
|
|
||||||
android:summaryOff="@string/settings_sharing_allow_access_summary"
|
|
||||||
android:summaryOn="@string/settings_sharing_allow_access_summary"
|
|
||||||
android:title="@string/settings_sharing_allow_access" />
|
|
||||||
<Preference
|
<Preference
|
||||||
android:key="@string/settings_reset_key"
|
android:key="@string/settings_reset_key"
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ limitations under the License.
|
|||||||
android:key="@string/split_frequency_key"
|
android:key="@string/split_frequency_key"
|
||||||
android:title="@string/menu_split_frequency" />
|
android:title="@string/menu_split_frequency" />
|
||||||
<com.google.android.apps.mytracks.settings.MyTracksListPreference
|
<com.google.android.apps.mytracks.settings.MyTracksListPreference
|
||||||
android:defaultValue="@string/settings_recording_track_name_location_value"
|
android:defaultValue="@string/settings_recording_track_name_date_iso_8601_location_value"
|
||||||
android:key="@string/track_name_key"
|
android:key="@string/track_name_key"
|
||||||
android:title="@string/settings_recording_track_name_title" />
|
android:title="@string/settings_recording_track_name_title" />
|
||||||
<com.google.android.apps.mytracks.settings.ActivityTypePreference
|
<com.google.android.apps.mytracks.settings.ActivityTypePreference
|
||||||
|
|||||||
Reference in New Issue
Block a user