Change variable name

This commit is contained in:
Bindu
2021-09-30 00:51:05 -07:00
parent af7f60fc4d
commit 79e302f922
6 changed files with 12 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ data class HistoryCardState(
val firstWeekday: DayOfWeek,
val series: List<HistoryChart.Square>,
val defaultSquare: HistoryChart.Square,
val hasNotes: List<Boolean>,
val notesIndicators: List<Boolean>,
val theme: Theme,
val today: LocalDate,
)
@@ -169,7 +169,7 @@ class HistoryCardPresenter(
else
HistoryChart.Square.OFF
val hasNotes = entries.map {
val notesIndicators = entries.map {
when (it.notes) {
"" -> false
else -> true
@@ -183,7 +183,7 @@ class HistoryCardPresenter(
theme = theme,
series = series,
defaultSquare = defaultSquare,
hasNotes = hasNotes,
notesIndicators = notesIndicators,
)
}
}

View File

@@ -43,7 +43,7 @@ class HistoryChart(
var paletteColor: PaletteColor,
var series: List<Square>,
var defaultSquare: Square,
var hasNotes: List<Boolean>,
var notesIndicators: List<Boolean>,
var theme: Theme,
var today: LocalDate,
var onDateClickedListener: OnDateClickedListener = object : OnDateClickedListener {},
@@ -205,7 +205,7 @@ class HistoryChart(
) {
val value = if (offset >= series.size) defaultSquare else series[offset]
val notes = if (offset >= hasNotes.size) false else hasNotes[offset]
val hasNotes = if (offset >= notesIndicators.size) false else notesIndicators[offset]
val squareColor: Color
val circleColor: Color
val color = theme.color(paletteColor.paletteIndex)
@@ -252,7 +252,7 @@ class HistoryChart(
canvas.setTextAlign(TextAlign.CENTER)
canvas.drawText(date.day.toString(), x + width / 2, y + width / 2)
if (notes) {
if (hasNotes) {
circleColor = when (value) {
Square.ON -> theme.lowContrastTextColor
else -> color