diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/models/DayMonthly.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/models/DayMonthly.kt index 8633d330f..303b1e923 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/models/DayMonthly.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/models/DayMonthly.kt @@ -1,5 +1,4 @@ package com.simplemobiletools.calendar.models data class DayMonthly(val value: Int, val isThisMonth: Boolean, val isToday: Boolean, val code: String, val weekOfYear: Int, var dayEvents: ArrayList, - var indexOnMonthView: Int) { -} + var indexOnMonthView: Int) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthView.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthView.kt index 1de5995ac..6cf0494ce 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthView.kt @@ -185,10 +185,12 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con weekNumberPaint.textAlign = Paint.Align.RIGHT for (i in 0 until ROW_COUNT) { + val weekDays = days.subList(i * 7, i * 7 + 7) + weekNumberPaint.color = if (weekDays.any { it.isToday }) primaryColor else textColor + // fourth day of the week matters val weekOfYear = days.getOrNull(i * 7 + 3)?.weekOfYear ?: 1 val id = "$weekOfYear:" - val yPos = i * dayHeight + weekDaysLetterHeight canvas.drawText(id, horizontalOffset.toFloat() * 0.9f, yPos + paint.textSize, weekNumberPaint) }