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
When I try to modify the style of some day cell through CalendarViewCell, the style is also added to the previous or next month if there is space enough. So sometimes appears wrong days inside a month.
I attach a screenshot to improve my poor explanations.
This is my code:
CalendarCellDecorator calendarCellDecorator = new CalendarCellDecorator() {
@Override
public void decorate(CalendarCellView cellView, Date date) {
for(Evento evento: eventos){
if(evento.getDate().getTime()==date.getTime()){
int color = getResources().getColor(R.color.white);
Drawable bg = getResources().getDrawable(R.drawable.bg_festivo);
switch (evento.getTipo()){
case Evento.TIPO_NO_LABORAL: color = getResources().getColor(R.color.calendar_bg_no_laboral); break;
case Evento.TIPO_BLOQUEADO: color = getResources().getColor(R.color.calendar_bg_bloqueado); break;
case Evento.TIPO_VACACION: color = getResources().getColor(R.color.calendar_bg_vacacion); break;
}
bg.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
cellView.getDayOfMonthTextView().setBackground(bg);
TextView tv = cellView.getSubTitleTextView();
tv.setText(evento.getDetalle());
tv.setTextAlignment(View.TEXT_ALIGNMENT_TEXT_END);
tv.setTextSize(11); // Aumentamos el tamaño
}
}
}
};
The text was updated successfully, but these errors were encountered:
When I try to modify the style of some day cell through CalendarViewCell, the style is also added to the previous or next month if there is space enough. So sometimes appears wrong days inside a month.
I attach a screenshot to improve my poor explanations.
This is my code:
The text was updated successfully, but these errors were encountered: