From f59933564e397aa49cf2d13c9d53b0fdbc9b7a1b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 24 Mar 2018 18:56:21 +0100 Subject: [PATCH] recheck week day letters in MonthView at updating items --- .../simplemobiletools/calendar/views/MonthView.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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 f26431979..b627722bd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthView.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/views/MonthView.kt @@ -41,14 +41,12 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con } weekDaysLetterHeight = 2 * normalTextSize.toInt() - dayLetters = context.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList - if (context.config.isSundayFirst) { - dayLetters.moveLastItemToFront() - } + initWeekDayLetters() } fun updateDays(newDays: ArrayList) { days = newDays + initWeekDayLetters() invalidate() } @@ -112,4 +110,11 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con curPaint.color = paintColor return curPaint } + + private fun initWeekDayLetters() { + dayLetters = context.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList + if (context.config.isSundayFirst) { + dayLetters.moveLastItemToFront() + } + } }