mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-06 19:43:06 +02:00
TrackRecordingService: compute temporary TrackStatistics for UI.
Fixes #810.
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user