Skip to content

Commit

Permalink
Fixing title on changing timeline preference
Browse files Browse the repository at this point in the history
Fixing empty timeline on single entry with disabled dots
  • Loading branch information
Faltenreich committed Apr 2, 2022
1 parent f68c669 commit 96c24c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,6 @@ public void onEvent(CategoryPreferenceChangedEvent event) {

@Subscribe(threadMode = ThreadMode.MAIN)
public void onEvent(TimelinePreferenceChangedEvent event) {
goToDay(day);
adapter.reset();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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);
}
}
}

0 comments on commit 96c24c9

Please sign in to comment.