TrackRecordingService: compute temporary TrackStatistics for UI.

Fixes #810.
This commit is contained in:
Dennis Guse
2021-06-06 14:03:05 +02:00
parent 21376cd3da
commit 2f0449c420
5 changed files with 61 additions and 30 deletions
@@ -18,6 +18,8 @@ package de.dennisguse.opentracks.stats;
import androidx.annotation.NonNull;
import java.util.Arrays;
/**
* This class maintains a ring buffer of doubles.
* This buffer is a convenient class for storing a series of doubles and calculating information about them.
@@ -49,6 +51,12 @@ class DoubleRingBuffer {
reset();
}
DoubleRingBuffer(DoubleRingBuffer toCopy) {
this.buffer = Arrays.copyOf(toCopy.buffer, toCopy.buffer.length);
this.index = toCopy.index;
this.isFull = toCopy.isFull;
}
/**
* Resets the buffer.
*/