recheck week day letters in MonthView at updating items
This commit is contained in:
parent
503d941d65
commit
f59933564e
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue