Bugfix: pace or speed header text is not showing in intervals.
Bugfix: viewModel checking onPause.
@@ -154,8 +154,10 @@ public class IntervalsFragment extends Fragment {
public void onPause() {
super.onPause();
sharedPreferences.unregisterOnSharedPreferenceChangeListener(sharedPreferenceChangeListener);
+ if (viewModel != null) {
viewModel.onPause();
}
+ }
@Override
public void onDestroyView() {
@@ -180,6 +182,7 @@ public class IntervalsFragment extends Fragment {
if (viewModel == null) {
return;
}
+ viewBinding.intervalRate.setText(isReportSpeed ? getString(R.string.stats_speed) : getString(R.string.stats_pace));
LiveData<List<IntervalStatistics.Interval>> liveData = viewModel.getIntervalStats(trackId, metricUnits, selectedInterval);
liveData.observe(getActivity(), intervalList -> adapter.swapData(intervalList, metricUnits, isReportSpeed));
}
