material-calendarview
material-calendarview copied to clipboard
How to add more than one decorator to same date?
Hi,
I'm trying to add two spans using decorator, but just the last one shows up. How can I add span decorator without subscribe previous?
public class EventDecorator implements DayViewDecorator {
private int color;
private final HashSet<CalendarDay> dates;
public EventDecorator(int color, Collection<CalendarDay> dates) {
this.dates = new HashSet<>(dates);
this.color = color;
}
@Override
public boolean shouldDecorate(CalendarDay day) {
return dates.contains(day);
}
@Override
public void decorate(DayViewFacade view) {
view.addSpan(new DotSpan(5, color));
view.addSpan(new DotSpan(5, Color.BLUE)); // Just this appears.
}
}
I imagine the problem, is having two spans, rather than more than one decorator.
It should be possible, by mixing the two colours together and setting that as the colour on a single span.
http://stackoverflow.com/questions/6070163/color-mixing-in-android
You are trying to add more than one span not decorator. I'll reopen if you are still having trouble.