mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
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);
|
||||
setSpeedLabel(R.id.max_speed_label,
|
||||
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) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
||||
ApiAdapterFactory.getApiAdapter().configureActionBarHomeAsUp(this);
|
||||
ApiAdapterFactory.getApiAdapter().configureActionBarHomeAsUp(this);
|
||||
setContentView(R.layout.track_detail);
|
||||
|
||||
|
||||
sharedPreferences = getSharedPreferences(Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
|
||||
sharedPreferences.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
|
||||
trackDataHub = ((MyTracksApplication) getApplication()).getTrackDataHub();
|
||||
trackRecordingServiceConnection = new TrackRecordingServiceConnection(this, null);
|
||||
|
||||
mapViewContainer = getLayoutInflater().inflate(R.layout.mytracks_layout, null);
|
||||
|
||||
|
||||
tabHost = (TabHost) findViewById(android.R.id.tabhost);
|
||||
tabHost.setup();
|
||||
tabManager = new TabManager(this, tabHost, R.id.realtabcontent);
|
||||
@@ -166,34 +166,15 @@ public class TrackDetailActivity extends FragmentActivity {
|
||||
if (savedInstanceState != null) {
|
||||
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
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putString(CURRENT_TAG_KEY, tabHost.getCurrentTabTag());
|
||||
handleIntent(getIntent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNewIntent(Intent intent) {
|
||||
super.onNewIntent(intent);
|
||||
handleIntent(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
@@ -207,6 +188,12 @@ public class TrackDetailActivity extends FragmentActivity {
|
||||
trackRecordingServiceConnection.bindIfRunning();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSaveInstanceState(Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
outState.putString(CURRENT_TAG_KEY, tabHost.getCurrentTabTag());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
@@ -507,6 +494,31 @@ public class TrackDetailActivity extends FragmentActivity {
|
||||
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.
|
||||
*/
|
||||
|
||||
@@ -116,8 +116,8 @@ public class DescriptionGeneratorImpl implements DescriptionGenerator {
|
||||
// Average moving pace
|
||||
writePace(averageMovingSpeed, builder, R.string.description_average_moving_pace, lineBreak);
|
||||
|
||||
// Min pace
|
||||
writePace(maxSpeed, builder, R.string.description_min_pace, lineBreak);
|
||||
// Fastest pace
|
||||
writePace(maxSpeed, builder, R.string.description_fastest_pace, lineBreak);
|
||||
|
||||
// Max elevation
|
||||
writeElevation(stats.getMaxElevation(), builder, R.string.description_max_elevation, lineBreak);
|
||||
|
||||
Reference in New Issue
Block a user