mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2024-12-11 16:27:17 +01:00
adding a crashfix in MonthView
This commit is contained in:
parent
d6190fb81f
commit
913ec2b1c3
@ -158,7 +158,8 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
||||
|
||||
for (i in 0 until ROW_COUNT) {
|
||||
// fourth day of the week matters
|
||||
val id = "${days[i * 7 + 3].weekOfYear}:"
|
||||
val weekOfYear = days.getOrNull(i * 7 + 3)?.weekOfYear ?: 1
|
||||
val id = "$weekOfYear:"
|
||||
|
||||
val yPos = i * dayHeight + weekDaysLetterHeight
|
||||
canvas.drawText(id, horizontalOffset.toFloat(), yPos + paint.textSize, weekNumberPaint)
|
||||
|
Loading…
Reference in New Issue
Block a user