mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
refresh views if highlightWeekends changes
This commit is contained in:
@@ -76,6 +76,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
private var mStoredIsSundayFirst = false
|
private var mStoredIsSundayFirst = false
|
||||||
private var mStoredUse24HourFormat = false
|
private var mStoredUse24HourFormat = false
|
||||||
private var mStoredDimPastEvents = true
|
private var mStoredDimPastEvents = true
|
||||||
|
private var mStoredHighlightWeekends = false
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
@@ -123,7 +124,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
if (mStoredTextColor != config.textColor || mStoredBackgroundColor != config.backgroundColor || mStoredPrimaryColor != config.primaryColor
|
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()
|
updateViewPager()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,6 +246,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
|||||||
mStoredBackgroundColor = backgroundColor
|
mStoredBackgroundColor = backgroundColor
|
||||||
mStoredUse24HourFormat = use24HourFormat
|
mStoredUse24HourFormat = use24HourFormat
|
||||||
mStoredDimPastEvents = dimPastEvents
|
mStoredDimPastEvents = dimPastEvents
|
||||||
|
mStoredHighlightWeekends = highlightWeekends
|
||||||
}
|
}
|
||||||
mStoredDayCode = Formatter.getTodayCode()
|
mStoredDayCode = Formatter.getTodayCode()
|
||||||
}
|
}
|
||||||
|
@@ -268,7 +268,7 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
|||||||
if (!isPrintVersion) {
|
if (!isPrintVersion) {
|
||||||
if (startDay.isToday) {
|
if (startDay.isToday) {
|
||||||
paintColor = primaryColor.getContrastColor()
|
paintColor = primaryColor.getContrastColor()
|
||||||
} else if (startDay.isWeekend) {
|
} else if (highlightWeekends && startDay.isWeekend) {
|
||||||
paintColor = redTextColor
|
paintColor = redTextColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user