forked from upstream-mirrors/OpenTracks
merge heads
This commit is contained in:
+246
-623
File diff suppressed because it is too large
Load Diff
@@ -262,6 +262,6 @@ public class StatsUtilities {
|
|||||||
R.string.stat_average_moving_pace);
|
R.string.stat_average_moving_pace);
|
||||||
setSpeedLabel(R.id.max_speed_label,
|
setSpeedLabel(R.id.max_speed_label,
|
||||||
R.string.stat_max_speed,
|
R.string.stat_max_speed,
|
||||||
R.string.stat_min_pace);
|
R.string.stat_fastest_pace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,16 +137,16 @@ public class TrackDetailActivity extends FragmentActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
||||||
ApiAdapterFactory.getApiAdapter().configureActionBarHomeAsUp(this);
|
ApiAdapterFactory.getApiAdapter().configureActionBarHomeAsUp(this);
|
||||||
setContentView(R.layout.track_detail);
|
setContentView(R.layout.track_detail);
|
||||||
|
|
||||||
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||||
sharedPreferences.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
|
sharedPreferences.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
|
||||||
trackDataHub = ((MyTracksApplication) getApplication()).getTrackDataHub();
|
trackDataHub = ((MyTracksApplication) getApplication()).getTrackDataHub();
|
||||||
trackRecordingServiceConnection = new TrackRecordingServiceConnection(this, null);
|
trackRecordingServiceConnection = new TrackRecordingServiceConnection(this, null);
|
||||||
|
|
||||||
mapViewContainer = getLayoutInflater().inflate(R.layout.mytracks_layout, null);
|
mapViewContainer = getLayoutInflater().inflate(R.layout.mytracks_layout, null);
|
||||||
|
|
||||||
tabHost = (TabHost) findViewById(android.R.id.tabhost);
|
tabHost = (TabHost) findViewById(android.R.id.tabhost);
|
||||||
tabHost.setup();
|
tabHost.setup();
|
||||||
tabManager = new TabManager(this, tabHost, R.id.realtabcontent);
|
tabManager = new TabManager(this, tabHost, R.id.realtabcontent);
|
||||||
@@ -166,34 +166,15 @@ public class TrackDetailActivity extends FragmentActivity {
|
|||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
tabHost.setCurrentTabByTag(savedInstanceState.getString(CURRENT_TAG_KEY));
|
tabHost.setCurrentTabByTag(savedInstanceState.getString(CURRENT_TAG_KEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the trackid
|
|
||||||
Intent intent = getIntent();
|
|
||||||
trackId = intent.getLongExtra(EXTRA_TRACK_ID, -1L);
|
|
||||||
if (trackId == -1L) {
|
|
||||||
startTrackListActivity();
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
trackDataHub.loadTrack(trackId);
|
|
||||||
|
|
||||||
// Get the waypointId
|
|
||||||
long waypointId = intent.getLongExtra(EXTRA_WAYPOINT_ID, -1L);
|
|
||||||
if (waypointId != -1L) {
|
|
||||||
MapFragment mapFragmet = (MapFragment) getSupportFragmentManager().findFragmentByTag(MAP_TAB_TAG);
|
|
||||||
if (mapFragmet != null) {
|
|
||||||
tabHost.setCurrentTab(0);
|
|
||||||
mapFragmet.showWaypoint(trackId, waypointId);
|
|
||||||
} else {
|
|
||||||
Log.e(TAG, "MapFragment is null");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
handleIntent(getIntent());
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
|
||||||
super.onSaveInstanceState(outState);
|
|
||||||
outState.putString(CURRENT_TAG_KEY, tabHost.getCurrentTabTag());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
handleIntent(intent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
@@ -207,6 +188,12 @@ public class TrackDetailActivity extends FragmentActivity {
|
|||||||
trackRecordingServiceConnection.bindIfRunning();
|
trackRecordingServiceConnection.bindIfRunning();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
|
super.onSaveInstanceState(outState);
|
||||||
|
outState.putString(CURRENT_TAG_KEY, tabHost.getCurrentTabTag());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
@@ -507,6 +494,31 @@ public class TrackDetailActivity extends FragmentActivity {
|
|||||||
return mapViewContainer;
|
return mapViewContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles the data in the intent.
|
||||||
|
*/
|
||||||
|
private void handleIntent(Intent intent) {
|
||||||
|
// Get the trackid
|
||||||
|
trackId = intent.getLongExtra(EXTRA_TRACK_ID, -1L);
|
||||||
|
if (trackId == -1L) {
|
||||||
|
startTrackListActivity();
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
trackDataHub.loadTrack(trackId);
|
||||||
|
|
||||||
|
// Get the waypointId
|
||||||
|
long waypointId = intent.getLongExtra(EXTRA_WAYPOINT_ID, -1L);
|
||||||
|
if (waypointId != -1L) {
|
||||||
|
MapFragment mapFragmet = (MapFragment) getSupportFragmentManager().findFragmentByTag(MAP_TAB_TAG);
|
||||||
|
if (mapFragmet != null) {
|
||||||
|
tabHost.setCurrentTab(0);
|
||||||
|
mapFragmet.showWaypoint(trackId, waypointId);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "MapFragment is null");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the menu.
|
* Updates the menu.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -116,8 +116,8 @@ public class DescriptionGeneratorImpl implements DescriptionGenerator {
|
|||||||
// Average moving pace
|
// Average moving pace
|
||||||
writePace(averageMovingSpeed, builder, R.string.description_average_moving_pace, lineBreak);
|
writePace(averageMovingSpeed, builder, R.string.description_average_moving_pace, lineBreak);
|
||||||
|
|
||||||
// Min pace
|
// Fastest pace
|
||||||
writePace(maxSpeed, builder, R.string.description_min_pace, lineBreak);
|
writePace(maxSpeed, builder, R.string.description_fastest_pace, lineBreak);
|
||||||
|
|
||||||
// Max elevation
|
// Max elevation
|
||||||
writeElevation(stats.getMaxElevation(), builder, R.string.description_max_elevation, lineBreak);
|
writeElevation(stats.getMaxElevation(), builder, R.string.description_max_elevation, lineBreak);
|
||||||
|
|||||||
Reference in New Issue
Block a user