Skip to content

Commit

Permalink
Bug fixing - make sure deactivated date are not clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
leocarona committed Dec 13, 2019
1 parent 558e156 commit 6d130d2
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,24 @@ public void init(MonthDescriptor month, List<List<MonthCellDescriptor>> cells,
int dayOfWeek = c + 1;
Calendar calendar = Calendar.getInstance(timeZone, locale);
calendar.setTime(cell.getDate());
cellView.setClickable(false);
cellView.setSelected(false);
boolean isAnActivatedDate = activatedDates.contains(calendar);
boolean isDeactivatedDate = deactivatedDates.contains(dayOfWeek);
if (!isAnActivatedDate && !cell.isSelected())
cellView.setDeactivated(true);
else
cellView.setDeactivated(isDeactivatedDate);

} else {
cellView.setClickable(!displayOnly);
if (isDeactivatedDate)
cellView.setSelected(false);
else
cellView.setSelected(cell.isSelected());
cellView.setDeactivated(false);
}


if (isDeactivatedDate)
cellView.setClickable(false);
else
cellView.setClickable(!displayOnly);

cellView.setTag(cell);

if (null != decorators) {
Expand Down

0 comments on commit 6d130d2

Please sign in to comment.