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