forked from upstream-mirrors/OpenTracks
fix comments for e16572c749ba
This commit is contained in:
@@ -2311,8 +2311,8 @@ limitations under the License.
|
|||||||
<string name="track_detail_install_earth_message"
|
<string name="track_detail_install_earth_message"
|
||||||
translation_description="When playing a track, the message informing the user that he needs
|
translation_description="When playing a track, the message informing the user that he needs
|
||||||
Google Earth to play the track and asking him if he wants to install Google Earth from the
|
Google Earth to play the track and asking him if he wants to install Google Earth from the
|
||||||
Android Market.">
|
Play Store.">
|
||||||
You need Google Earth to play the track. Do you want to install from the Market?
|
You need Google Earth to play the track. Do you want to install from the Play Store?
|
||||||
</string>
|
</string>
|
||||||
<string name="track_icon_description"
|
<string name="track_icon_description"
|
||||||
translation_description="The accessibility description for the track icon.">
|
translation_description="The accessibility description for the track icon.">
|
||||||
|
|||||||
@@ -102,10 +102,8 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener
|
|||||||
new OnSharedPreferenceChangeListener() {
|
new OnSharedPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
|
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
|
||||||
if (key == null) {
|
// Note that key can be null
|
||||||
return;
|
if (getString(R.string.recording_track_key).equals(key)) {
|
||||||
}
|
|
||||||
if (key.equals(getString(R.string.recording_track_key))) {
|
|
||||||
if (isRecording()) {
|
if (isRecording()) {
|
||||||
trackRecordingServiceConnection.startAndBind();
|
trackRecordingServiceConnection.startAndBind();
|
||||||
}
|
}
|
||||||
@@ -219,8 +217,7 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener
|
|||||||
R.string.track_detail_delete_confirm_message, new DialogInterface.OnClickListener() {
|
R.string.track_detail_delete_confirm_message, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
long trackId = trackDataHub.getSelectedTrackId();
|
deleteCurrentTrack();
|
||||||
MyTracksProviderUtils.Factory.get(TrackDetailActivity.this).deleteTrack(trackId);
|
|
||||||
startTrackListActivity();
|
startTrackListActivity();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -282,7 +279,7 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener
|
|||||||
stopRecording();
|
stopRecording();
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_insert_marker:
|
case R.id.menu_insert_marker:
|
||||||
// TODO:
|
// TODO: Add insert marker when updating WaypointList to ICS
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_play:
|
case R.id.menu_play:
|
||||||
if (PlayTrackUtils.isEarthInstalled(this)) {
|
if (PlayTrackUtils.isEarthInstalled(this)) {
|
||||||
@@ -438,7 +435,7 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* s Updates the menu items.
|
* Updates the menu items.
|
||||||
*
|
*
|
||||||
* @param isRecording true if recording
|
* @param isRecording true if recording
|
||||||
*/
|
*/
|
||||||
@@ -469,6 +466,14 @@ public class TrackDetailActivity extends TabActivity implements OnTouchListener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes the current track.
|
||||||
|
*/
|
||||||
|
private void deleteCurrentTrack() {
|
||||||
|
long trackId = trackDataHub.getSelectedTrackId();
|
||||||
|
MyTracksProviderUtils.Factory.get(TrackDetailActivity.this).deleteTrack(trackId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the {@link TrackListActivity} and ends this activity.
|
* Starts the {@link TrackListActivity} and ends this activity.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -86,24 +86,25 @@ public class TrackListActivity extends FragmentActivity {
|
|||||||
private final Runnable bindChangedCallback = new Runnable() {
|
private final Runnable bindChangedCallback = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (startNewRecording) {
|
if (!startNewRecording) {
|
||||||
ITrackRecordingService service = trackRecordingServiceConnection.getServiceIfBound();
|
return;
|
||||||
if (service != null) {
|
}
|
||||||
try {
|
|
||||||
recordingTrackId = service.startNewTrack();
|
ITrackRecordingService service = trackRecordingServiceConnection.getServiceIfBound();
|
||||||
startNewRecording = false;
|
if (service == null) {
|
||||||
Toast.makeText(
|
Log.d(TAG, "service not available to start a new recording");
|
||||||
TrackListActivity.this, R.string.track_list_record_success, Toast.LENGTH_SHORT)
|
return;
|
||||||
.show();
|
}
|
||||||
Log.d(TAG, "Started a new recording");
|
try {
|
||||||
} catch (Exception e) {
|
recordingTrackId = service.startNewTrack();
|
||||||
Toast.makeText(
|
startNewRecording = false;
|
||||||
TrackListActivity.this, R.string.track_list_record_error, Toast.LENGTH_LONG).show();
|
Toast.makeText(
|
||||||
Log.d(TAG, "Unable to start a new recording.", e);
|
TrackListActivity.this, R.string.track_list_record_success, Toast.LENGTH_SHORT).show();
|
||||||
}
|
Log.d(TAG, "Started a new recording");
|
||||||
} else {
|
} catch (Exception e) {
|
||||||
Log.d(TAG, "service not available to start a new recording");
|
Toast.makeText(TrackListActivity.this, R.string.track_list_record_error, Toast.LENGTH_LONG)
|
||||||
}
|
.show();
|
||||||
|
Log.e(TAG, "Unable to start a new recording.", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -116,13 +117,11 @@ public class TrackListActivity extends FragmentActivity {
|
|||||||
new OnSharedPreferenceChangeListener() {
|
new OnSharedPreferenceChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
|
public void onSharedPreferenceChanged(SharedPreferences preferences, String key) {
|
||||||
if (key == null) {
|
// Note that key can be null
|
||||||
return;
|
if (getString(R.string.metric_units_key).equals(key)) {
|
||||||
}
|
|
||||||
if (key.equals(getString(R.string.metric_units_key))) {
|
|
||||||
metricUnits = preferences.getBoolean(getString(R.string.metric_units_key), true);
|
metricUnits = preferences.getBoolean(getString(R.string.metric_units_key), true);
|
||||||
}
|
}
|
||||||
if (key.equals(getString(R.string.recording_track_key))) {
|
if (getString(R.string.recording_track_key).equals(key)) {
|
||||||
recordingTrackId = sharedPreferences.getLong(getString(R.string.recording_track_key), -1L);
|
recordingTrackId = sharedPreferences.getLong(getString(R.string.recording_track_key), -1L);
|
||||||
if (isRecording()) {
|
if (isRecording()) {
|
||||||
trackRecordingServiceConnection.startAndBind();
|
trackRecordingServiceConnection.startAndBind();
|
||||||
|
|||||||
Reference in New Issue
Block a user