mirror of
https://github.com/FossifyOrg/Calendar.git
synced 2026-05-02 11:55:18 -04:00
Merge pull request #121 from ikazuhiro/highlight-weekend-in-print
Highlight weekends in printed matter too
This commit is contained in:
@@ -219,14 +219,11 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
||||
val dayLetters = res.getStringArray(labelIDs).toMutableList() as ArrayList<String>
|
||||
val dayLetter = dayLetters[curDay.dayOfWeek - 1]
|
||||
|
||||
val textColor = if (isPrintVersion) {
|
||||
resources.getColor(org.fossify.commons.R.color.theme_light_text_color)
|
||||
} else if (todayCode == dayCode) {
|
||||
primaryColor
|
||||
} else if (highlightWeekends && isWeekend(curDay.dayOfWeek)) {
|
||||
config.highlightWeekendsColor
|
||||
} else {
|
||||
requireContext().getProperTextColor()
|
||||
val textColor = when {
|
||||
!isPrintVersion && todayCode == dayCode -> primaryColor
|
||||
highlightWeekends && isWeekend(curDay.dayOfWeek) -> config.highlightWeekendsColor
|
||||
isPrintVersion -> resources.getColor(org.fossify.commons.R.color.theme_light_text_color)
|
||||
else -> requireContext().getProperTextColor()
|
||||
}
|
||||
|
||||
val label = WeeklyViewDayLetterBinding.inflate(layoutInflater, binding.weekLettersHolder, false).root
|
||||
|
||||
@@ -373,13 +373,10 @@ class MonthView(context: Context, attrs: AttributeSet, defStyle: Int) : View(con
|
||||
}
|
||||
|
||||
private fun getTextPaint(startDay: DayMonthly): Paint {
|
||||
var paintColor = textColor
|
||||
if (!isPrintVersion) {
|
||||
if (startDay.isToday) {
|
||||
paintColor = primaryColor.getContrastColor()
|
||||
} else if (highlightWeekends && startDay.isWeekend) {
|
||||
paintColor = weekendsTextColor
|
||||
}
|
||||
var paintColor = when {
|
||||
!isPrintVersion && startDay.isToday -> primaryColor.getContrastColor()
|
||||
highlightWeekends && startDay.isWeekend -> weekendsTextColor
|
||||
else -> textColor
|
||||
}
|
||||
|
||||
if (!startDay.isThisMonth) {
|
||||
|
||||
Reference in New Issue
Block a user