Skip to content

Commit 9a6bbc0

Browse files
committed
Split "Highlight weekends" functionality into "Highlight Saturdays" and "Highlight Sundays"
1 parent f3fe3f0 commit 9a6bbc0

File tree

14 files changed

+235
-87
lines changed

14 files changed

+235
-87
lines changed

app/src/main/kotlin/org/fossify/calendar/activities/MainActivity.kt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,11 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
159159
private var mStoredUse24HourFormat = false
160160
private var mStoredDimPastEvents = true
161161
private var mStoredDimCompletedTasks = true
162-
private var mStoredHighlightWeekends = false
162+
private var mStoredHighlightSaturdays = false
163+
private var mStoredHighlightSundays = false
163164
private var mStoredStartWeekWithCurrentDay = false
164-
private var mStoredHighlightWeekendsColor = 0
165+
private var mStoredHighlightSaturdaysColor = 0
166+
private var mStoredHighlightSundaysColor = 0
165167

166168
// search results have endless scrolling, so reaching the top/bottom fetches further results
167169
private var minFetchedSearchTS = 0L
@@ -252,7 +254,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
252254
super.onResume()
253255
if (mStoredTextColor != getProperTextColor() || mStoredBackgroundColor != getProperBackgroundColor() || mStoredPrimaryColor != getProperPrimaryColor()
254256
|| mStoredDayCode != Formatter.getTodayCode() || mStoredDimPastEvents != config.dimPastEvents || mStoredDimCompletedTasks != config.dimCompletedTasks
255-
|| mStoredHighlightWeekends != config.highlightWeekends || mStoredHighlightWeekendsColor != config.highlightWeekendsColor
257+
|| mStoredHighlightSaturdays != config.highlightSaturdays || mStoredHighlightSundays != config.highlightSundays || mStoredHighlightSaturdaysColor != config.highlightSaturdaysColor || mStoredHighlightSundaysColor != config.highlightSundaysColor
256258
) {
257259
updateViewPager()
258260
}
@@ -407,8 +409,10 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
407409
mStoredUse24HourFormat = use24HourFormat
408410
mStoredDimPastEvents = dimPastEvents
409411
mStoredDimCompletedTasks = dimCompletedTasks
410-
mStoredHighlightWeekends = highlightWeekends
411-
mStoredHighlightWeekendsColor = highlightWeekendsColor
412+
mStoredHighlightSaturdays = highlightSaturdays
413+
mStoredHighlightSaturdaysColor = highlightSaturdaysColor
414+
mStoredHighlightSundays = highlightSundays
415+
mStoredHighlightSundaysColor = highlightSundaysColor
412416
mStoredMidnightSpan = showMidnightSpanningEventsAtTop
413417
mStoredStartWeekWithCurrentDay = startWeekWithCurrentDay
414418
}

app/src/main/kotlin/org/fossify/calendar/activities/SettingsActivity.kt

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ import org.fossify.calendar.helpers.DISPLAY_DESCRIPTION
4343
import org.fossify.calendar.helpers.DISPLAY_PAST_EVENTS
4444
import org.fossify.calendar.helpers.EVENTS_LIST_VIEW
4545
import org.fossify.calendar.helpers.Formatter
46-
import org.fossify.calendar.helpers.HIGHLIGHT_WEEKENDS
47-
import org.fossify.calendar.helpers.HIGHLIGHT_WEEKENDS_COLOR
46+
import org.fossify.calendar.helpers.HIGHLIGHT_SATURDAYS
47+
import org.fossify.calendar.helpers.HIGHLIGHT_SATURDAYS_COLOR
48+
import org.fossify.calendar.helpers.HIGHLIGHT_SUNDAYS
49+
import org.fossify.calendar.helpers.HIGHLIGHT_SUNDAYS_COLOR
4850
import org.fossify.calendar.helpers.IcsExporter
4951
import org.fossify.calendar.helpers.LAST_EVENT_REMINDER_MINUTES
5052
import org.fossify.calendar.helpers.LAST_EVENT_REMINDER_MINUTES_2
@@ -187,8 +189,10 @@ class SettingsActivity : SimpleActivity() {
187189
setupHourFormat()
188190
setupAllowCreatingTasks()
189191
setupStartWeekOn()
190-
setupHighlightWeekends()
191-
setupHighlightWeekendsColor()
192+
setupHighlightSaturdays()
193+
setupHighlightSaturdaysColor()
194+
setupHighlightSundays()
195+
setupHighlightSundaysColor()
192196
setupDeleteAllEvents()
193197
setupDisplayDescription()
194198
setupReplaceDescription()
@@ -508,29 +512,60 @@ class SettingsActivity : SimpleActivity() {
508512
}
509513
}
510514

511-
private fun setupHighlightWeekends() = binding.apply {
512-
settingsHighlightWeekends.isChecked = config.highlightWeekends
513-
settingsHighlightWeekendsColorHolder.beVisibleIf(config.highlightWeekends)
514-
settingsHighlightWeekendsHolder.setOnClickListener {
515-
settingsHighlightWeekends.toggle()
516-
config.highlightWeekends = settingsHighlightWeekends.isChecked
517-
settingsHighlightWeekendsColorHolder.beVisibleIf(config.highlightWeekends)
515+
private fun setupHighlightSaturdays() = binding.apply {
516+
settingsHighlightSaturdays.isChecked = config.highlightSaturdays
517+
settingsHighlightSaturdaysColorHolder.beVisibleIf(config.highlightSaturdays)
518+
settingsHighlightSaturdaysHolder.setOnClickListener {
519+
settingsHighlightSaturdays.toggle()
520+
config.highlightSaturdays = settingsHighlightSaturdays.isChecked
521+
settingsHighlightSaturdaysColorHolder.beVisibleIf(config.highlightSaturdays)
518522
}
519523
}
520524

521-
private fun setupHighlightWeekendsColor() = binding.apply {
522-
settingsHighlightWeekendsColor.setFillWithStroke(
523-
config.highlightWeekendsColor,
525+
private fun setupHighlightSaturdaysColor() = binding.apply {
526+
settingsHighlightSaturdaysColor.setFillWithStroke(
527+
config.highlightSaturdaysColor,
524528
getProperBackgroundColor()
525529
)
526-
settingsHighlightWeekendsColorHolder.setOnClickListener {
530+
settingsHighlightSaturdaysColorHolder.setOnClickListener {
527531
ColorPickerDialog(
528532
activity = this@SettingsActivity,
529-
color = config.highlightWeekendsColor
533+
color = config.highlightSaturdaysColor
530534
) { wasPositivePressed, color ->
531535
if (wasPositivePressed) {
532-
config.highlightWeekendsColor = color
533-
settingsHighlightWeekendsColor.setFillWithStroke(
536+
config.highlightSaturdaysColor = color
537+
settingsHighlightSaturdaysColor.setFillWithStroke(
538+
color,
539+
getProperBackgroundColor()
540+
)
541+
}
542+
}
543+
}
544+
}
545+
546+
private fun setupHighlightSundays() = binding.apply {
547+
settingsHighlightSundays.isChecked = config.highlightSundays
548+
settingsHighlightSundaysColorHolder.beVisibleIf(config.highlightSundays)
549+
settingsHighlightSundaysHolder.setOnClickListener {
550+
settingsHighlightSundays.toggle()
551+
config.highlightSundays = settingsHighlightSundays.isChecked
552+
settingsHighlightSundaysColorHolder.beVisibleIf(config.highlightSundays)
553+
}
554+
}
555+
556+
private fun setupHighlightSundaysColor() = binding.apply {
557+
settingsHighlightSundaysColor.setFillWithStroke(
558+
config.highlightSundaysColor,
559+
getProperBackgroundColor()
560+
)
561+
settingsHighlightSundaysColorHolder.setOnClickListener {
562+
ColorPickerDialog(
563+
activity = this@SettingsActivity,
564+
color = config.highlightSundaysColor
565+
) { wasPositivePressed, color ->
566+
if (wasPositivePressed) {
567+
config.highlightSundaysColor = color
568+
settingsHighlightSundaysColor.setFillWithStroke(
534569
color,
535570
getProperBackgroundColor()
536571
)
@@ -1154,8 +1189,10 @@ class SettingsActivity : SimpleActivity() {
11541189
put(SNOOZE_TIME, config.snoozeTime)
11551190
put(USE_24_HOUR_FORMAT, config.use24HourFormat)
11561191
put(FIRST_DAY_OF_WEEK, config.firstDayOfWeek)
1157-
put(HIGHLIGHT_WEEKENDS, config.highlightWeekends)
1158-
put(HIGHLIGHT_WEEKENDS_COLOR, config.highlightWeekendsColor)
1192+
put(HIGHLIGHT_SATURDAYS, config.highlightSaturdays)
1193+
put(HIGHLIGHT_SATURDAYS_COLOR, config.highlightSaturdaysColor)
1194+
put(HIGHLIGHT_SUNDAYS, config.highlightSundays)
1195+
put(HIGHLIGHT_SUNDAYS_COLOR, config.highlightSundaysColor)
11591196
put(ALLOW_CREATING_TASKS, config.allowCreatingTasks)
11601197
}
11611198

@@ -1270,8 +1307,10 @@ class SettingsActivity : SimpleActivity() {
12701307
USE_24_HOUR_FORMAT -> config.use24HourFormat = value.toBoolean()
12711308
SUNDAY_FIRST -> config.firstDayOfWeek = DateTimeConstants.SUNDAY
12721309
FIRST_DAY_OF_WEEK -> config.firstDayOfWeek = value.toInt()
1273-
HIGHLIGHT_WEEKENDS -> config.highlightWeekends = value.toBoolean()
1274-
HIGHLIGHT_WEEKENDS_COLOR -> config.highlightWeekendsColor = value.toInt()
1310+
HIGHLIGHT_SATURDAYS -> config.highlightSaturdays = value.toBoolean()
1311+
HIGHLIGHT_SATURDAYS_COLOR -> config.highlightSaturdaysColor = value.toInt()
1312+
HIGHLIGHT_SUNDAYS -> config.highlightSundays = value.toBoolean()
1313+
HIGHLIGHT_SUNDAYS_COLOR -> config.highlightSundaysColor = value.toInt()
12751314
ALLOW_CREATING_TASKS -> config.allowCreatingTasks = value.toBoolean()
12761315
}
12771316
}

app/src/main/kotlin/org/fossify/calendar/activities/WidgetMonthlyConfigureActivity.kt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import org.fossify.calendar.databinding.TopNavigationBinding
1616
import org.fossify.calendar.databinding.WidgetConfigMonthlyBinding
1717
import org.fossify.calendar.extensions.addDayEvents
1818
import org.fossify.calendar.extensions.config
19-
import org.fossify.calendar.extensions.isWeekendIndex
19+
import org.fossify.calendar.extensions.isSaturdayIndex
20+
import org.fossify.calendar.extensions.isSundayIndex
2021
import org.fossify.calendar.helpers.MonthlyCalendarImpl
2122
import org.fossify.calendar.helpers.MyWidgetMonthlyProvider
2223
import org.fossify.calendar.interfaces.MonthlyCalendar
@@ -174,8 +175,10 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
174175

175176
for (i in 0 until daysLength) {
176177
val day = mDays!![i]
177-
val dayTextColor = if (config.highlightWeekends && day.isWeekend) {
178-
config.highlightWeekendsColor
178+
val dayTextColor = if (config.highlightSaturdays && day.isSaturday) {
179+
config.highlightSaturdaysColor
180+
} else if (config.highlightSundays && day.isSunday) {
181+
config.highlightSundaysColor
179182
} else {
180183
mTextColor
181184
}
@@ -222,11 +225,14 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
222225
}
223226

224227
private fun updateLabels() {
225-
val weekendsTextColor = config.highlightWeekendsColor
228+
val saturdaysTextColor = config.highlightSaturdaysColor
229+
val sundaysTextColor = config.highlightSundaysColor
226230
binding.configCalendar.firstRow.apply {
227231
arrayOf(label0, label1, label2, label3, label4, label5, label6).forEachIndexed { index, textView ->
228-
val textColor = if (config.highlightWeekends && isWeekendIndex(index)) {
229-
weekendsTextColor
232+
val textColor = if (config.highlightSaturdays && isSaturdayIndex(index)) {
233+
saturdaysTextColor
234+
} else if (config.highlightSundays && isSundayIndex(index)) {
235+
sundaysTextColor
230236
} else {
231237
mTextColor
232238
}

app/src/main/kotlin/org/fossify/calendar/extensions/Context.kt

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ import org.fossify.calendar.helpers.getActivityToOpen
6868
import org.fossify.calendar.helpers.getNextAutoBackupTime
6969
import org.fossify.calendar.helpers.getNowSeconds
7070
import org.fossify.calendar.helpers.getPreviousAutoBackupTime
71-
import org.fossify.calendar.helpers.isWeekend
71+
import org.fossify.calendar.helpers.isSaturday
72+
import org.fossify.calendar.helpers.isSunday
7273
import org.fossify.calendar.interfaces.CalendarsDao
7374
import org.fossify.calendar.interfaces.EventsDao
7475
import org.fossify.calendar.interfaces.TasksDao
@@ -1057,7 +1058,7 @@ fun Context.getProperDayIndexInWeek(date: DateTime): Int {
10571058
return dayIndex
10581059
}
10591060

1060-
fun Context.isWeekendIndex(dayIndex: Int): Boolean {
1061+
fun Context.isSaturdayIndex(dayIndex: Int): Boolean {
10611062
val firstDayOfWeek = config.firstDayOfWeek
10621063
val shiftedIndex = (dayIndex + firstDayOfWeek) % 7
10631064
val dayOfWeek = if (shiftedIndex == 0) {
@@ -1066,7 +1067,19 @@ fun Context.isWeekendIndex(dayIndex: Int): Boolean {
10661067
shiftedIndex
10671068
}
10681069

1069-
return isWeekend(dayOfWeek)
1070+
return isSaturday(dayOfWeek)
1071+
}
1072+
1073+
fun Context.isSundayIndex(dayIndex: Int): Boolean {
1074+
val firstDayOfWeek = config.firstDayOfWeek
1075+
val shiftedIndex = (dayIndex + firstDayOfWeek) % 7
1076+
val dayOfWeek = if (shiftedIndex == 0) {
1077+
DateTimeConstants.SUNDAY
1078+
} else {
1079+
shiftedIndex
1080+
}
1081+
1082+
return isSunday(dayOfWeek)
10701083
}
10711084

10721085
fun Context.isTaskCompleted(event: Event): Boolean {

app/src/main/kotlin/org/fossify/calendar/fragments/WeekFragment.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ import org.fossify.calendar.helpers.TYPE_TASK
5656
import org.fossify.calendar.helpers.WEEK_START_TIMESTAMP
5757
import org.fossify.calendar.helpers.WeeklyCalendarImpl
5858
import org.fossify.calendar.helpers.getActivityToOpen
59-
import org.fossify.calendar.helpers.isWeekend
59+
import org.fossify.calendar.helpers.isSaturday
60+
import org.fossify.calendar.helpers.isSunday
6061
import org.fossify.calendar.interfaces.WeekFragmentListener
6162
import org.fossify.calendar.interfaces.WeeklyCalendar
6263
import org.fossify.calendar.models.Event
@@ -118,7 +119,8 @@ class WeekFragment : Fragment(), WeeklyCalendar {
118119
private var wasExtraHeightAdded = false
119120
private var dimPastEvents = true
120121
private var dimCompletedTasks = true
121-
private var highlightWeekends = false
122+
private var highlightSaturdays = false
123+
private var highlightSundays = false
122124
private var wasScaled = false
123125
private var isPrintVersion = false
124126
private var selectedGrid: View? = null
@@ -148,7 +150,8 @@ class WeekFragment : Fragment(), WeeklyCalendar {
148150
weekDateTime = Formatter.getDateTimeFromTS(weekTimestamp)
149151
dimPastEvents = config.dimPastEvents
150152
dimCompletedTasks = config.dimCompletedTasks
151-
highlightWeekends = config.highlightWeekends
153+
highlightSaturdays = config.highlightSaturdays
154+
highlightSundays = config.highlightSundays
152155
primaryColor = requireContext().getProperPrimaryColor()
153156
allDayRows.add(HashSet())
154157
}
@@ -291,7 +294,8 @@ class WeekFragment : Fragment(), WeeklyCalendar {
291294

292295
val textColor = when {
293296
!isPrintVersion && todayCode == dayCode -> primaryColor
294-
highlightWeekends && isWeekend(curDay.dayOfWeek) -> config.highlightWeekendsColor
297+
highlightSaturdays && isSaturday(curDay.dayOfWeek) -> config.highlightSaturdaysColor
298+
highlightSundays && isSunday(curDay.dayOfWeek) -> config.highlightSundaysColor
295299
isPrintVersion -> resources.getColor(org.fossify.commons.R.color.theme_light_text_color)
296300
else -> requireContext().getProperTextColor()
297301
}

app/src/main/kotlin/org/fossify/calendar/helpers/Config.kt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,15 +284,25 @@ class Config(context: Context) : BaseConfig(context) {
284284
get() = prefs.getInt(WEEKLY_VIEW_DAYS, 7)
285285
set(weeklyViewDays) = prefs.edit().putInt(WEEKLY_VIEW_DAYS, weeklyViewDays).apply()
286286

287-
var highlightWeekends: Boolean
288-
get() = prefs.getBoolean(HIGHLIGHT_WEEKENDS, false)
289-
set(highlightWeekends) = prefs.edit().putBoolean(HIGHLIGHT_WEEKENDS, highlightWeekends)
287+
var highlightSaturdays: Boolean
288+
get() = prefs.getBoolean(HIGHLIGHT_SATURDAYS, false)
289+
set(highlightSaturdays) = prefs.edit().putBoolean(HIGHLIGHT_SATURDAYS, highlightSaturdays)
290290
.apply()
291291

292-
var highlightWeekendsColor: Int
293-
get() = prefs.getInt(HIGHLIGHT_WEEKENDS_COLOR, context.resources.getColor(R.color.red_text))
294-
set(highlightWeekendsColor) = prefs.edit()
295-
.putInt(HIGHLIGHT_WEEKENDS_COLOR, highlightWeekendsColor).apply()
292+
var highlightSaturdaysColor: Int
293+
get() = prefs.getInt(HIGHLIGHT_SATURDAYS_COLOR, context.resources.getColor(R.color.red_text))
294+
set(highlightSaturdaysColor) = prefs.edit()
295+
.putInt(HIGHLIGHT_SATURDAYS_COLOR, highlightSaturdaysColor).apply()
296+
297+
var highlightSundays: Boolean
298+
get() = prefs.getBoolean(HIGHLIGHT_SUNDAYS, false)
299+
set(highlightSundays) = prefs.edit().putBoolean(HIGHLIGHT_SUNDAYS, highlightSundays)
300+
.apply()
301+
302+
var highlightSundaysColor: Int
303+
get() = prefs.getInt(HIGHLIGHT_SUNDAYS_COLOR, context.resources.getColor(R.color.red_text))
304+
set(highlightSundaysColor) = prefs.edit()
305+
.putInt(HIGHLIGHT_SUNDAYS_COLOR, highlightSundaysColor).apply()
296306

297307
var lastUsedEventSpan: Int
298308
get() = prefs.getInt(LAST_USED_EVENT_SPAN, YEAR_SECONDS)

app/src/main/kotlin/org/fossify/calendar/helpers/Constants.kt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,10 @@ const val EXPORT_TASKS = "export_tasks"
135135
const val EXPORT_PAST_EVENTS = "export_past_events"
136136
const val WEEKLY_VIEW_ITEM_HEIGHT_MULTIPLIER = "weekly_view_item_height_multiplier"
137137
const val WEEKLY_VIEW_DAYS = "weekly_view_days"
138-
const val HIGHLIGHT_WEEKENDS = "highlight_weekends"
139-
const val HIGHLIGHT_WEEKENDS_COLOR = "highlight_weekends_color"
138+
const val HIGHLIGHT_SATURDAYS = "highlight_saturdays"
139+
const val HIGHLIGHT_SUNDAYS = "highlight_sundays"
140+
const val HIGHLIGHT_SATURDAYS_COLOR = "highlight_saturdays_color"
141+
const val HIGHLIGHT_SUNDAYS_COLOR = "highlight_sundays_color"
140142
const val LAST_USED_EVENT_SPAN = "last_used_event_span"
141143
const val ALLOW_CREATING_TASKS = "allow_creating_tasks"
142144
const val WAS_FILTERED_OUT_WARNING_SHOWN = "was_filtered_out_warning_shown"
@@ -295,9 +297,14 @@ const val ACTION_MARK_COMPLETED = "ACTION_MARK_COMPLETED"
295297

296298
fun getNowSeconds() = System.currentTimeMillis() / 1000L
297299

298-
fun isWeekend(dayOfWeek: Int): Boolean {
299-
val weekendDays = listOf(DateTimeConstants.SATURDAY, DateTimeConstants.SUNDAY)
300-
return dayOfWeek in weekendDays
300+
fun isSaturday(dayOfWeek: Int): Boolean {
301+
val saturDays = listOf(DateTimeConstants.SATURDAY)
302+
return dayOfWeek in saturDays
303+
}
304+
305+
fun isSunday(dayOfWeek: Int): Boolean {
306+
val sunDays = listOf(DateTimeConstants.SUNDAY)
307+
return dayOfWeek in sunDays
301308
}
302309

303310
fun getActivityToOpen(isTask: Boolean) = if (isTask) {

app/src/main/kotlin/org/fossify/calendar/helpers/MonthlyCalendarImpl.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ package org.fossify.calendar.helpers
33
import android.content.Context
44
import org.fossify.calendar.extensions.eventsHelper
55
import org.fossify.calendar.extensions.getProperDayIndexInWeek
6-
import org.fossify.calendar.extensions.isWeekendIndex
6+
import org.fossify.calendar.extensions.isSaturdayIndex
7+
import org.fossify.calendar.extensions.isSundayIndex
78
import org.fossify.calendar.extensions.seconds
89
import org.fossify.calendar.interfaces.MonthlyCalendar
910
import org.fossify.calendar.models.DayMonthly
@@ -70,7 +71,7 @@ class MonthlyCalendarImpl(val callback: MonthlyCalendar, val context: Context) {
7071

7172
val newDay = curDay.withDayOfMonth(value)
7273
val dayCode = Formatter.getDayCodeFromDateTime(newDay)
73-
val day = DayMonthly(value, isThisMonth, isToday, dayCode, newDay.weekOfWeekyear, ArrayList(), i, context.isWeekendIndex(i))
74+
val day = DayMonthly(value, isThisMonth, isToday, dayCode, newDay.weekOfWeekyear, ArrayList(), i, context.isSaturdayIndex(i), context.isSundayIndex(i))
7475
days.add(day)
7576
value++
7677
}

app/src/main/kotlin/org/fossify/calendar/helpers/MyWidgetMonthlyProvider.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
120120
for (i in 0 until len) {
121121
val day = days[i]
122122

123-
val dayTextColor = if (context.config.highlightWeekends && day.isWeekend) {
124-
context.config.highlightWeekendsColor
123+
val dayTextColor = if (context.config.highlightSaturdays && day.isSaturday) {
124+
context.config.highlightSaturdaysColor
125+
} else if (context.config.highlightSundays && day.isSunday) {
126+
context.config.highlightSundaysColor
125127
} else {
126128
textColor
127129
}
@@ -240,8 +242,10 @@ class MyWidgetMonthlyProvider : AppWidgetProvider() {
240242

241243
for (i in 0..6) {
242244
val id = resources.getIdentifier("label_$i", "id", packageName)
243-
val dayTextColor = if (context.config.highlightWeekends && context.isWeekendIndex(i)) {
244-
context.config.highlightWeekendsColor
245+
val dayTextColor = if (context.config.highlightSaturdays && context.isSaturdayIndex(i)) {
246+
context.config.highlightSaturdaysColor
247+
} else if (context.config.highlightSundays && context.isSundayIndex(i)) {
248+
context.config.highlightSundaysColor
245249
} else {
246250
textColor
247251
}

0 commit comments

Comments
 (0)