Android CalendarView for Showing Events

The built in CalendarView widget doesn’t expose the ability to change the color of the calendar cells in month view. See the source.

You might try the following approaches:

  1. Extend from CalendarView and implement onDraw yourself. You’ll have to reimplement all the existing drawing behavior, including these 4 methods:

    protected void onDraw(Canvas canvas) {
        drawBackground(canvas);
        drawWeekNumbersAndDates(canvas);
        drawWeekSeparators(canvas);
        drawSelectedDateVerticalBars(canvas);
    }
    
  2. Implement you own CalendarView that allows customizing cells. I suggest this project as a good place to get started, since it already supports custom cells.

Leave a Comment