mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
modify review comments
This commit is contained in:
@@ -59,10 +59,9 @@ data class Habit(
|
||||
val today = DateUtils.getTodayWithOffset()
|
||||
val value = computedEntries.get(today).value
|
||||
return if (isNumerical) {
|
||||
val targetValuePerDay = (targetValue / frequency.denominator)
|
||||
when (targetType) {
|
||||
NumericalHabitType.AT_LEAST -> value / 1000.0 >= targetValuePerDay
|
||||
NumericalHabitType.AT_MOST -> value / 1000.0 <= targetValuePerDay
|
||||
NumericalHabitType.AT_LEAST -> value / 1000.0 >= targetValue
|
||||
NumericalHabitType.AT_MOST -> value / 1000.0 <= targetValue
|
||||
}
|
||||
} else {
|
||||
value != Entry.NO && value != Entry.UNKNOWN
|
||||
@@ -73,10 +72,9 @@ data class Habit(
|
||||
val today = DateUtils.getTodayWithOffset()
|
||||
val value = computedEntries.get(today).value
|
||||
return if (isNumerical) {
|
||||
val targetValuePerDay = (targetValue / frequency.denominator)
|
||||
when (targetType) {
|
||||
NumericalHabitType.AT_LEAST -> value / 1000.0 < targetValuePerDay
|
||||
NumericalHabitType.AT_MOST -> value / 1000.0 > targetValuePerDay
|
||||
NumericalHabitType.AT_LEAST -> value / 1000.0 < targetValue
|
||||
NumericalHabitType.AT_MOST -> value / 1000.0 > targetValue
|
||||
}
|
||||
} else {
|
||||
value == Entry.NO
|
||||
|
||||
@@ -117,7 +117,7 @@ class HistoryCardPresenter(
|
||||
} else {
|
||||
entries.map {
|
||||
when {
|
||||
max(0.0, it.value / 1000.0) < 2 * habit.targetValue -> HistoryChart.Square.ON
|
||||
max(0.0, it.value / 1000.0) <= habit.targetValue -> HistoryChart.Square.ON
|
||||
else -> HistoryChart.Square.OFF
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user