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:
Dennis Guse
2021-12-29 23:12:49 +01:00
parent 8c20d5583a
commit 07074ad260
11 changed files with 172 additions and 73 deletions
@@ -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);
}
}