Resolving hiqua's comments

pull/1319/head
Jakub Kalinowski 4 years ago
parent 3b650d63b4
commit c2731c03c3

@ -27,7 +27,7 @@ data class Entry(
/** /**
* Value indicating that the habit is not applicable for this timestamp. * Value indicating that the habit is not applicable for this timestamp.
*/ */
const val SKIP = -2 const val SKIP = 3
/** /**
* Value indicating that the user has performed the habit at this timestamp. * Value indicating that the user has performed the habit at this timestamp.

@ -153,15 +153,11 @@ class HistoryCardPresenter(
val series = if (habit.isNumerical) { val series = if (habit.isNumerical) {
entries.map { entries.map {
when { when {
it.value == SKIP -> { it.value == Entry.UNKNOWN -> OFF
HistoryChart.Square.HATCHED it.value == SKIP -> HATCHED
} (habit.targetType == AT_MOST) && (it.value / 1000.0 <= habit.targetValue) -> ON
it.value > 0 -> { (habit.targetType == AT_LEAST) && (it.value / 1000.0 >= habit.targetValue) -> ON
HistoryChart.Square.ON else -> GREY
}
else -> {
HistoryChart.Square.OFF
}
} }
} }
} else { } else {

Loading…
Cancel
Save