diff --git a/app/src/main/java/com/faltenreich/diaguard/feature/timeline/TimelineFragment.java b/app/src/main/java/com/faltenreich/diaguard/feature/timeline/TimelineFragment.java index 0a56a47c6..92a783c55 100644 --- a/app/src/main/java/com/faltenreich/diaguard/feature/timeline/TimelineFragment.java +++ b/app/src/main/java/com/faltenreich/diaguard/feature/timeline/TimelineFragment.java @@ -215,6 +215,6 @@ public void onEvent(CategoryPreferenceChangedEvent event) { @Subscribe(threadMode = ThreadMode.MAIN) public void onEvent(TimelinePreferenceChangedEvent event) { - goToDay(day); + adapter.reset(); } } diff --git a/app/src/main/java/com/faltenreich/diaguard/feature/timeline/chart/DayChartData.java b/app/src/main/java/com/faltenreich/diaguard/feature/timeline/chart/DayChartData.java index 456d461de..f4326b245 100644 --- a/app/src/main/java/com/faltenreich/diaguard/feature/timeline/chart/DayChartData.java +++ b/app/src/main/java/com/faltenreich/diaguard/feature/timeline/chart/DayChartData.java @@ -143,15 +143,6 @@ private IScatterDataSet getScatterDataSet(DataSetType type) { return dataSet; } - private void addEntry(Entry entry, DataSetType type) { - if (showLines) { - getLineDataSet().addEntry(entry); - } - if (showDots) { - getScatterDataSet(type).addEntry(entry); - } - } - private void addEntry(Entry entry) { float yValue = entry.getY(); if (PreferenceStore.getInstance().limitsAreHighlighted()) { @@ -166,4 +157,14 @@ private void addEntry(Entry entry) { addEntry(entry, DataSetType.TARGET); } } + + private void addEntry(Entry entry, DataSetType type) { + if (showLines) { + getLineDataSet().addEntry(entry); + } + // Show dot anyway if there is only one entry since it will not be connected with a line + if (values.size() == 1 || showDots) { + getScatterDataSet(type).addEntry(entry); + } + } } \ No newline at end of file