mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
recheck week day letters in MonthView at updating items
This commit is contained in:
@ -41,14 +41,12 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
|||||||
}
|
}
|
||||||
|
|
||||||
weekDaysLetterHeight = 2 * normalTextSize.toInt()
|
weekDaysLetterHeight = 2 * normalTextSize.toInt()
|
||||||
dayLetters = context.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList<String>
|
initWeekDayLetters()
|
||||||
if (context.config.isSundayFirst) {
|
|
||||||
dayLetters.moveLastItemToFront()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateDays(newDays: ArrayList<DayMonthly>) {
|
fun updateDays(newDays: ArrayList<DayMonthly>) {
|
||||||
days = newDays
|
days = newDays
|
||||||
|
initWeekDayLetters()
|
||||||
invalidate()
|
invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,4 +110,11 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
|||||||
curPaint.color = paintColor
|
curPaint.color = paintColor
|
||||||
return curPaint
|
return curPaint
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun initWeekDayLetters() {
|
||||||
|
dayLetters = context.resources.getStringArray(R.array.week_day_letters).toList() as ArrayList<String>
|
||||||
|
if (context.config.isSundayFirst) {
|
||||||
|
dayLetters.moveLastItemToFront()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user