mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 18:03:06 +02:00
merge heads
This commit is contained in:
@@ -183,7 +183,7 @@ public class ExportAllTracks {
|
||||
TrackWriter writer =
|
||||
TrackWriterFactory.newWriter(activity, providerUtils, id, format);
|
||||
if (writer == null) {
|
||||
showToast(R.string.error_track_does_not_exist, Toast.LENGTH_LONG);
|
||||
showToast(R.string.error_export_generic, Toast.LENGTH_LONG);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -504,12 +504,12 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
||||
final boolean isGpsDisabled;
|
||||
switch (state) {
|
||||
case DISABLED:
|
||||
messageId = R.string.status_enable_gps;
|
||||
messageId = R.string.status_need_to_enable_gps;
|
||||
isGpsDisabled = true;
|
||||
break;
|
||||
case NO_FIX:
|
||||
case BAD_FIX:
|
||||
messageId = R.string.wait_for_fix;
|
||||
messageId = R.string.status_wait_for_gps_fix;
|
||||
isGpsDisabled = false;
|
||||
break;
|
||||
case GOOD_FIX:
|
||||
@@ -531,7 +531,7 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
||||
if (isGpsDisabled) {
|
||||
// Give a warning about this state.
|
||||
Toast.makeText(MapActivity.this,
|
||||
R.string.error_no_gps_location_provider,
|
||||
R.string.error_no_gps,
|
||||
Toast.LENGTH_LONG).show();
|
||||
|
||||
// Make clicking take the user to the location settings.
|
||||
|
||||
@@ -369,7 +369,7 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
||||
try {
|
||||
long waypointId = trackRecordingService.insertWaypoint(request);
|
||||
if (waypointId >= 0) {
|
||||
Toast.makeText(this, R.string.status_statistics_inserted,
|
||||
Toast.makeText(this, R.string.status_marker_inserted,
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
return waypointId;
|
||||
|
||||
@@ -323,8 +323,8 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
|
||||
private void updateSensorSettings(String sensorType) {
|
||||
boolean usesBluetooth =
|
||||
getString(R.string.zephyr_sensor_type).equals(sensorType)
|
||||
|| getString(R.string.polar_sensor_type).equals(sensorType);
|
||||
getString(R.string.sensor_type_value_zephyr).equals(sensorType)
|
||||
|| getString(R.string.sensor_type_value_polar).equals(sensorType);
|
||||
findPreference(
|
||||
getString(R.string.bluetooth_sensor_key)).setEnabled(usesBluetooth);
|
||||
findPreference(
|
||||
@@ -336,15 +336,15 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
Preference antSrm = findPreference(getString(R.string.ant_srm_bridge_sensor_id_key));
|
||||
if (antHrm != null && antSrm != null) {
|
||||
antHrm
|
||||
.setEnabled(getString(R.string.ant_sensor_type).equals(sensorType));
|
||||
.setEnabled(getString(R.string.sensor_type_value_ant).equals(sensorType));
|
||||
antSrm
|
||||
.setEnabled(getString(R.string.srm_ant_bridge_sensor_type).equals(sensorType));
|
||||
.setEnabled(getString(R.string.sensor_type_value_srm_ant_bridge).equals(sensorType));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateTrackColorModeSettings(String trackColorMode) {
|
||||
boolean usesFixedSpeed = trackColorMode.equals(getString(R.string.track_color_mode_fixed));
|
||||
boolean usesDynamicSpeed = trackColorMode.equals(getString(R.string.track_color_mode_dynamic));
|
||||
boolean usesFixedSpeed = trackColorMode.equals(getString(R.string.track_color_mode_value_fixed));
|
||||
boolean usesDynamicSpeed = trackColorMode.equals(getString(R.string.track_color_mode_value_dynamic));
|
||||
|
||||
findPreference(
|
||||
getString(R.string.track_color_mode_fixed_speed_slow_display_key)).setEnabled(usesFixedSpeed);
|
||||
|
||||
@@ -227,7 +227,7 @@ public class WaypointsList extends ListActivity
|
||||
if (trackRecordingService != null) {
|
||||
long waypointId = trackRecordingService.insertWaypoint(request);
|
||||
if (waypointId >= 0) {
|
||||
Toast.makeText(this, R.string.status_statistics_inserted,
|
||||
Toast.makeText(this, R.string.status_marker_inserted,
|
||||
Toast.LENGTH_LONG).show();
|
||||
return waypointId;
|
||||
}
|
||||
|
||||
@@ -147,10 +147,10 @@ class DataSourcesWrapperImpl implements DataSourcesWrapper {
|
||||
// We don't have a recent GPS fix, just use cell towers if available
|
||||
loc = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
|
||||
|
||||
int toastResId = R.string.status_approximate_location;
|
||||
int toastResId = R.string.status_approximate_current_location;
|
||||
if (loc == null || loc.getTime() < now - MAX_NETWORK_AGE_MS) {
|
||||
// We don't have a recent cell tower location, let the user know:
|
||||
toastResId = R.string.status_no_location;
|
||||
toastResId = R.string.status_no_current_location;
|
||||
}
|
||||
|
||||
// Let the user know we have only an approximate location:
|
||||
|
||||
@@ -92,7 +92,7 @@ public class SendToDocs {
|
||||
|
||||
private void doUpload(long trackId) {
|
||||
// TODO
|
||||
statusMessage = activity.getString(R.string.error_sending_to_fusiontables);
|
||||
statusMessage = activity.getString(R.string.error_sending_to_fusion_tables);
|
||||
success = false;
|
||||
|
||||
try {
|
||||
@@ -117,10 +117,10 @@ public class SendToDocs {
|
||||
if (success) {
|
||||
if (createdNewSpreadSheet) {
|
||||
statusMessage = activity.getString(
|
||||
R.string.status_tracks_have_been_uploaded_to_new_doc);
|
||||
R.string.sending_to_docs_success_new_doc);
|
||||
} else {
|
||||
statusMessage = activity.getString(
|
||||
R.string.status_tracks_have_been_uploaded_to_docs);
|
||||
R.string.sending_to_docs_success_existing_doc);
|
||||
}
|
||||
} else {
|
||||
statusMessage = activity.getString(R.string.error_sending_to_docs);
|
||||
|
||||
@@ -168,7 +168,7 @@ public class SendToFusionTables implements Runnable {
|
||||
}
|
||||
|
||||
private void doUpload() {
|
||||
int statusMessageId = R.string.error_sending_to_fusiontables;
|
||||
int statusMessageId = R.string.error_sending_to_fusion_tables;
|
||||
boolean success = true;
|
||||
try {
|
||||
progressIndicator.setProgressValue(PROGRESS_INITIALIZATION);
|
||||
@@ -205,7 +205,7 @@ public class SendToFusionTables implements Runnable {
|
||||
return;
|
||||
}
|
||||
|
||||
statusMessageId = R.string.status_new_fusiontable_has_been_created;
|
||||
statusMessageId = R.string.sending_to_fusion_tables_success;
|
||||
Log.d(Constants.TAG, "SendToFusionTables: Done: " + success);
|
||||
progressIndicator.setProgressValue(PROGRESS_COMPLETE);
|
||||
} finally {
|
||||
|
||||
@@ -98,7 +98,7 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
private void doUpload() {
|
||||
int statusMessageId = R.string.error_sending_to_mymap;
|
||||
int statusMessageId = R.string.error_sending_to_my_maps;
|
||||
boolean success = true;
|
||||
try {
|
||||
progressIndicator.setProgressMessage(
|
||||
@@ -174,8 +174,8 @@ public class SendToMyMaps implements Runnable {
|
||||
|
||||
if (success) {
|
||||
statusMessageId = isNewMap
|
||||
? R.string.status_new_mymap_has_been_created
|
||||
: R.string.status_tracks_have_been_uploaded;
|
||||
? R.string.sending_to_my_maps_success_new_map
|
||||
: R.string.sending_to_my_maps_success_existing_map;
|
||||
}
|
||||
Log.d(TAG, "SendToMyMaps: Done: " + success);
|
||||
progressIndicator.setProgressValue(100);
|
||||
|
||||
@@ -178,13 +178,13 @@ public class ImportActivity extends Activity {
|
||||
resultMessage = R.string.error_generic;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_unable_to_read_file;
|
||||
resultMessage = R.string.error_import_unable_to_read_file;
|
||||
} catch (NullPointerException e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_invalid_gpx_format;
|
||||
resultMessage = R.string.error_import_invalid_gpx_format;
|
||||
} catch (OutOfMemoryError e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_out_of_memory;
|
||||
resultMessage = R.string.error_import_out_of_memory;
|
||||
}
|
||||
|
||||
boolean success = (importedTrackIds != null && importedTrackIds.length > 0);
|
||||
|
||||
@@ -114,7 +114,7 @@ class TrackWriterImpl implements TrackWriter {
|
||||
private void doWriteTrack() {
|
||||
// Open the input and output
|
||||
success = false;
|
||||
errorMessage = R.string.error_track_does_not_exist;
|
||||
errorMessage = R.string.error_export_generic;
|
||||
if (track != null) {
|
||||
if (openFile()) {
|
||||
try {
|
||||
@@ -127,7 +127,7 @@ class TrackWriterImpl implements TrackWriter {
|
||||
}
|
||||
}
|
||||
success = false;
|
||||
errorMessage = R.string.error_operation_cancelled;
|
||||
errorMessage = R.string.error_export_operation_canceled;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ public class TrackPathPainterFactory {
|
||||
String colorMode = prefs.getString(context.getString(R.string.track_color_mode_key), null);
|
||||
Log.i(TAG, "Creating track path painter of type: " + colorMode);
|
||||
|
||||
if (colorMode == null || colorMode.equals(context.getString(R.string.track_color_mode_none))) {
|
||||
if (colorMode == null || colorMode.equals(context.getString(R.string.track_color_mode_value_none))) {
|
||||
return new SingleColorTrackPathPainter(context);
|
||||
} else if (colorMode.equals(context.getString(R.string.track_color_mode_fixed))) {
|
||||
} else if (colorMode.equals(context.getString(R.string.track_color_mode_value_fixed))) {
|
||||
return new DynamicSpeedTrackPathPainter(context,
|
||||
new FixedSpeedTrackPathDescriptor(context));
|
||||
} else if (colorMode.equals(context.getString(R.string.track_color_mode_dynamic))) {
|
||||
} else if (colorMode.equals(context.getString(R.string.track_color_mode_value_dynamic))) {
|
||||
return new DynamicSpeedTrackPathPainter(context,
|
||||
new DynamicSpeedTrackPathDescriptor(context));
|
||||
} else {
|
||||
|
||||
+4
-4
@@ -53,13 +53,13 @@ public class SensorManagerFactory {
|
||||
|
||||
if (sensor == null) {
|
||||
return null;
|
||||
} else if (sensor.equals(context.getString(R.string.ant_sensor_type))) {
|
||||
} else if (sensor.equals(context.getString(R.string.sensor_type_value_ant))) {
|
||||
return new AntDirectSensorManager(context);
|
||||
} else if (sensor.equals(context.getString(R.string.srm_ant_bridge_sensor_type))) {
|
||||
} else if (sensor.equals(context.getString(R.string.sensor_type_value_srm_ant_bridge))) {
|
||||
return new AntSRMSensorManager(context);
|
||||
} else if (sensor.equals(context.getString(R.string.zephyr_sensor_type))) {
|
||||
} else if (sensor.equals(context.getString(R.string.sensor_type_value_zephyr))) {
|
||||
return new ZephyrSensorManager(context);
|
||||
} else if (sensor.equals(context.getString(R.string.polar_sensor_type))) {
|
||||
} else if (sensor.equals(context.getString(R.string.sensor_type_value_polar))) {
|
||||
return new PolarSensorManager(context);
|
||||
} else {
|
||||
Log.w(Constants.TAG, "Unable to find sensor type: " + sensor);
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
package com.google.android.apps.mytracks.services.sensors;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.android.apps.mytracks.content.Sensor;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
/**
|
||||
* A collection of methods for message parsers.
|
||||
*
|
||||
@@ -99,7 +99,7 @@ public class SensorUtils {
|
||||
public static String getStateAsString(Sensor.SensorState state, Context c) {
|
||||
switch (state) {
|
||||
case NONE:
|
||||
return c.getString(R.string.none);
|
||||
return c.getString(R.string.sensor_type_value_none);
|
||||
case CONNECTING:
|
||||
return c.getString(R.string.connecting);
|
||||
case CONNECTED:
|
||||
|
||||
Reference in New Issue
Block a user