Skip to content

Commit

Permalink
Merge request for Group 4 [Winter 2024] (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avilad0 authored Feb 17, 2024
2 parents bdec9f1 + 8cb55c9 commit c64eb44
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 211 deletions.
13 changes: 5 additions & 8 deletions src/main/java/de/dennisguse/opentracks/chart/ChartFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
}
if (PreferencesUtils.isKey(R.string.stats_rate_key, key)) {
boolean reportSpeed = PreferencesUtils.isReportSpeed(activityTypeLocalized);
if (reportSpeed != viewBinding.chartView.getReportSpeed()) {
if (reportSpeed != viewBinding.chartView.isReportSpeed()) {
viewBinding.chartView.setReportSpeed(reportSpeed);
viewBinding.chartView.applyReportSpeed();

Expand All @@ -105,17 +105,14 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
/**
* A runnable that will setFrequency the orange pointer as appropriate and redraw.
*/
private final Runnable updateChart = new Runnable() {
@Override
public void run() {
private final Runnable updateChart = ()->{
if (!isResumed()) {
return;
}

viewBinding.chartView.setShowPointer(isSelectedTrackRecording());
viewBinding.chartView.invalidate();
}
};
};


@Override
Expand Down Expand Up @@ -166,7 +163,7 @@ public void onTrackUpdated(Track track) {

activityTypeLocalized = track.getActivityTypeLocalized();
boolean reportSpeed = PreferencesUtils.isReportSpeed(activityTypeLocalized);
if (reportSpeed != viewBinding.chartView.getReportSpeed()) {
if (reportSpeed != viewBinding.chartView.isReportSpeed()) {
viewBinding.chartView.setReportSpeed(reportSpeed);
viewBinding.chartView.applyReportSpeed();
}
Expand Down Expand Up @@ -257,7 +254,7 @@ private synchronized void pauseTrackDataHub() {
* Returns true if the selected track is recording.
* Needs to be synchronized because trackDataHub can be accessed by multiple threads.
*/
@Deprecated
@Deprecated(since = "verision x.x",forRemoval = true)
//TODO Should not be dynamic but instead set while instantiating, i.e., newFragment().
private synchronized boolean isSelectedTrackRecording() {
return trackDataHub != null && trackDataHub.isSelectedTrackRecording();
Expand Down
Loading

0 comments on commit c64eb44

Please sign in to comment.