You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
calendarView.weekendDays requires (Mutable)Set<Long>
so I declared mutable set and pass it to weekendDays like this
val set = mutableSetOf<Long>()
set.add(Calerndar.SATURDAY) // I also tried WeekDay.SATURDAY
calendarView.weekendDays = set
However it doesn't recognize saturday as weekendDays. So I researched source code little bit and I found this snippet.
MonthAdapter.java
private void setDaysAccordingToSet(Set<Long> days, DayFlag dayFlag) {
if (days != null && !days.isEmpty()) {
for (Month month : months) {
for (Day day : month.getDays()) {
switch (dayFlag) {
case WEEKEND:
day.setWeekend(days.contains(day.getCalendar().get(Calendar.DAY_OF_WEEK)));
break;
days.contains(day.getCalendar().get(Calendar.DAY_OF_WEEK)) returns false everytime, even though Set<Long> days set has "7" and day.getCalendar().get(Calendar.DAY_OF_WEEK)value is 7.
I think it's because "7" in Set<Long> days is Long type and day.getCalendar().get(Calendar.DAY_OF_WEEK) is Int type. It works when i do days.contains((long)day.getCalendar().get(Calendar.DAY_OF_WEEK))
Can anyone help me with this?
The text was updated successfully, but these errors were encountered:
calendarView.weekendDays requires
(Mutable)Set<Long>
so I declared mutable set and pass it to weekendDays like this
However it doesn't recognize saturday as weekendDays. So I researched source code little bit and I found this snippet.
MonthAdapter.java
days.contains(day.getCalendar().get(Calendar.DAY_OF_WEEK)) returns false everytime, even though
Set<Long> days
set has "7" andday.getCalendar().get(Calendar.DAY_OF_WEEK)
value is 7.I think it's because "7" in
Set<Long> days
is Long type andday.getCalendar().get(Calendar.DAY_OF_WEEK)
is Int type. It works when i dodays.contains((long)day.getCalendar().get(Calendar.DAY_OF_WEEK))
Can anyone help me with this?
The text was updated successfully, but these errors were encountered: