Change HeartRate graph representation
This commit is contained in:
parent
def6c51fa2
commit
fd696a0c4b
|
@ -151,6 +151,6 @@ interface OverviewData {
|
|||
var dsMaxSeries: LineGraphSeries<ScaledDataPoint>
|
||||
var dsMinSeries: LineGraphSeries<ScaledDataPoint>
|
||||
var heartRateScale: Scale
|
||||
var heartRateGraphSeries: LineGraphSeries<DataPointWithLabelInterface>
|
||||
var heartRateGraphSeries: PointsWithLabelGraphSeries<DataPointWithLabelInterface>
|
||||
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class HeartRateDataPoint(
|
|||
override val label: String = ""
|
||||
override val duration = data.duration
|
||||
override val shape = PointsWithLabelGraphSeries.Shape.HEARTRATE
|
||||
override val size = 1f
|
||||
override val size = 10f
|
||||
override val paintStyle: Paint.Style = Paint.Style.FILL
|
||||
|
||||
override fun color(context: Context?): Int = rh.gac(context, info.nightscout.core.ui.R.attr.heartRateColor)
|
||||
|
|
|
@ -245,6 +245,11 @@ public class PointsWithLabelGraphSeries<E extends DataPointWithLabelInterface> e
|
|||
mPaint.setFakeBoldText(true);
|
||||
canvas.drawText(value.getLabel(), endX, endY, mPaint);
|
||||
}
|
||||
} else if (value.getShape() == Shape.HEARTRATE) {
|
||||
mPaint.setStrokeWidth(0);
|
||||
Rect bounds = new Rect((int) endX, (int) endY - 8, (int) (xPlusLength), (int) endY + 8);
|
||||
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
|
||||
canvas.drawRect(bounds, mPaint);
|
||||
} else if (value.getShape() == Shape.PROFILE) {
|
||||
Drawable drawable = ContextCompat.getDrawable(graphView.getContext(), R.drawable.ic_ribbon_profile);
|
||||
assert drawable != null;
|
||||
|
|
|
@ -102,7 +102,7 @@ class OverviewDataImpl @Inject constructor(
|
|||
epsSeries = PointsWithLabelGraphSeries()
|
||||
maxTherapyEventValue = 0.0
|
||||
therapyEventSeries = PointsWithLabelGraphSeries()
|
||||
heartRateGraphSeries = LineGraphSeries()
|
||||
heartRateGraphSeries = PointsWithLabelGraphSeries()
|
||||
}
|
||||
|
||||
override fun initRange() {
|
||||
|
@ -339,5 +339,5 @@ class OverviewDataImpl @Inject constructor(
|
|||
override var dsMaxSeries: LineGraphSeries<ScaledDataPoint> = LineGraphSeries()
|
||||
override var dsMinSeries: LineGraphSeries<ScaledDataPoint> = LineGraphSeries()
|
||||
override var heartRateScale = Scale()
|
||||
override var heartRateGraphSeries: LineGraphSeries<DataPointWithLabelInterface> = LineGraphSeries()
|
||||
override var heartRateGraphSeries: PointsWithLabelGraphSeries<DataPointWithLabelInterface> = PointsWithLabelGraphSeries()
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ class PrepareTreatmentsDataWorker(
|
|||
data.overviewData.therapyEventSeries = PointsWithLabelGraphSeries(filteredTherapyEvents.toTypedArray())
|
||||
data.overviewData.epsSeries = PointsWithLabelGraphSeries(filteredEps.toTypedArray())
|
||||
|
||||
data.overviewData.heartRateGraphSeries = LineGraphSeries<DataPointWithLabelInterface>(
|
||||
data.overviewData.heartRateGraphSeries = PointsWithLabelGraphSeries<DataPointWithLabelInterface>(
|
||||
repository.getHeartRatesFromTimeToTime(fromTime, endTime)
|
||||
.map { hr -> HeartRateDataPoint(hr, rh) }
|
||||
.toTypedArray()).apply { color = rh.gac(null, info.nightscout.core.ui.R.attr.heartRateColor) }
|
||||
|
|
Loading…
Reference in a new issue