mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 18:03:06 +02:00
TrackStatistics and ChartView: handle altitude and speed as optional with null as default value.
Then only the relevant part of the y-axis is shown. Fixes #795.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package de.dennisguse.opentracks.stats;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import de.dennisguse.opentracks.content.data.Speed;
|
||||
|
||||
public class SpeedRingBuffer extends RingBuffer<Speed> {
|
||||
|
||||
SpeedRingBuffer(int size) {
|
||||
super(size);
|
||||
}
|
||||
|
||||
SpeedRingBuffer(RingBuffer<Speed> toCopy) {
|
||||
super(toCopy);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected Number from(Speed object) {
|
||||
return object.toMPS();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Speed to(double object) {
|
||||
return Speed.of(object);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user