Bugfix: category change didn't update speed/pace correctly.

Espresso test added to check that unit is properly.
This commit is contained in:
Román Martínez
2021-05-21 20:23:48 +02:00
parent e71ab28701
commit aa34f5d55b
2 changed files with 186 additions and 1 deletions
@@ -307,12 +307,12 @@ public class StatisticsRecordingFragment extends Fragment {
private void onRecordingDataChanged(TrackRecordingService.RecordingData recordingData) {
String oldCategory = this.recordingData.getTrackCategory();
String newCategory = recordingData.getTrackCategory();
this.recordingData = recordingData;
if (!oldCategory.equals(newCategory)) {
sharedPreferenceChangeListener.onSharedPreferenceChanged(sharedPreferences, getString(R.string.stats_rate_key));
}
this.recordingData = recordingData;
this.latestTrackPoint = recordingData.getLatestTrackPoint();
if (latestTrackPoint != null && latestTrackPoint.hasLocation() && !latestTrackPoint.isRecent()) {
latestTrackPoint = null;