Merge pull request #121 from ikazuhiro/highlight-weekend-in-print

Highlight weekends in printed matter too
This commit is contained in:
Naveen Singh
2024-03-11 23:29:28 +05:30
committed by GitHub
2 changed files with 9 additions and 15 deletions

View File

@@ -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

View File

@@ -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) {