refresh views if highlightWeekends changes

This commit is contained in:
tibbi 2021-01-22 23:17:04 +01:00
parent d49bfeace0
commit c0027820f7
2 changed files with 4 additions and 2 deletions

View File

@ -76,6 +76,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
private var mStoredIsSundayFirst = false
private var mStoredUse24HourFormat = false
private var mStoredDimPastEvents = true
private var mStoredHighlightWeekends = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -123,7 +124,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onResume() {
super.onResume()
if (mStoredTextColor != config.textColor || mStoredBackgroundColor != config.backgroundColor || mStoredPrimaryColor != config.primaryColor
|| mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents) {
|| mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents || mStoredHighlightWeekends != config.highlightWeekends) {
updateViewPager()
}
@ -245,6 +246,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
mStoredBackgroundColor = backgroundColor
mStoredUse24HourFormat = use24HourFormat
mStoredDimPastEvents = dimPastEvents
mStoredHighlightWeekends = highlightWeekends
}
mStoredDayCode = Formatter.getTodayCode()
}

View File

@ -268,7 +268,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
if (!isPrintVersion) {
if (startDay.isToday) {
paintColor = primaryColor.getContrastColor()
} else if (startDay.isWeekend) {
} else if (highlightWeekends && startDay.isWeekend) {
paintColor = redTextColor
}
}