Re-calculate the calorie while user change the activity type of track. Show standard "value_unknown" (-) when the activity type is not supported.

This commit is contained in:
youtaol
2013-09-06 14:54:02 +08:00
parent 7233137e93
commit 282c48f530
7 changed files with 72 additions and 23 deletions
@@ -192,8 +192,7 @@ public class MarkerDetailFragment extends Fragment {
TextView name = (TextView) getView().findViewById(R.id.marker_detail_statistics_name);
name.setText(getString(R.string.generic_name_line, waypoint.getName()));
StatsUtils.setTripStatisticsValues(getActivity(), waypoint.getTripStatistics(),
waypoint.getTrackId());
StatsUtils.setTripStatisticsValues(getActivity(), waypoint.getTripStatistics());
StatsUtils.setLocationValues(getActivity(), waypoint.getLocation(), false);
}
}
@@ -259,11 +259,7 @@ public class StatsFragment extends Fragment implements TrackDataListener {
* Updates the UI.
*/
private void updateUi(FragmentActivity activity) {
StatsUtils.setTripStatisticsValues(
activity,
lastTripStatistics,
trackDataHub == null ? PreferencesUtils.RECORDING_TRACK_ID_DEFAULT : trackDataHub
.getSelectedTrackId());
StatsUtils.setTripStatisticsValues(activity, lastTripStatistics);
StatsUtils.setLocationValues(activity, lastLocation, isSelectedTrackRecording());
}
}