mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
fixup! HeartRateChart: Add weekly and monthly view
This commit is contained in:
parent
9d2fe54d67
commit
b56de42343
@ -144,7 +144,7 @@ public class HeartRatePeriodFragment extends AbstractChartFragment<HeartRatePeri
|
||||
}
|
||||
|
||||
private HeartRateData fetchHeartRateDataForDay(ChartsHost chartsHost, DBHandler db, GBDevice device, int startTs) {
|
||||
int endTs = startTs + 24 * 60 * 60 - 1;
|
||||
int endTs = startTs + SEC_PER_DAY - 1;
|
||||
List<? extends ActivitySample> samples = getActivitySamples(db, device, startTs, endTs);
|
||||
|
||||
int restingHeartRate = DATA_INVALID;
|
||||
@ -204,6 +204,9 @@ public class HeartRatePeriodFragment extends AbstractChartFragment<HeartRatePeri
|
||||
x.setDrawLimitLinesBehindData(true);
|
||||
x.setPosition(XAxis.XAxisPosition.BOTTOM);
|
||||
x.setValueFormatter(getChartMultipleDayValueFormatter());
|
||||
if (TOTAL_DAYS == 7) {
|
||||
x.setLabelCount(TOTAL_DAYS, true);
|
||||
}
|
||||
|
||||
YAxis yAxisLeft = hrLineChart.getAxisLeft();
|
||||
yAxisLeft.setEnabled(true);
|
||||
@ -295,7 +298,7 @@ public class HeartRatePeriodFragment extends AbstractChartFragment<HeartRatePeri
|
||||
return new ValueFormatter() {
|
||||
@Override
|
||||
public String getFormattedValue(float value) {
|
||||
return formatLetterDay.format(new Date((int)value * 1000));
|
||||
return formatLetterDay.format(new Date((int)value * 1000L));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user