Android monthview calendar- event custamization

Thread is closed for posting
2 posts, 0 answers
  1. rincy
    rincy avatar
    14 posts
    Member since:
    Nov 2014

    Posted 27 Jan 2015 Link to this post


    I want to customize event indication in month view,

    1.If any event is scheduled on a day it has to show as a triangle on the corner(no need to indicate if it having multiple days).
    2.when user select a day, event color has to change from blue to white.

    Please help me out on this items.
  2. Antony Jekov
    Antony Jekov avatar
    88 posts

    Posted 27 Jan 2015 Link to this post

    Hello Rincy,

    Thank you for contacting the Android team.

    I made a simple implementation of the screenshot you provided. Here is the code to get you started:

    private RadCalendarView calendarView;
    protected void onCreate(Bundle savedInstanceState) {
        this.calendarView = new RadCalendarView(this);
        this.calendarView.setAdapter(new CustomCalendarAdapter(this.calendarView));
        this.calendarView.getEventAdapter().setRenderer(new CustomEventRenderer(this));
        List<Event> events = new ArrayList<>();
        events.add(new Event("Event", Calendar.getInstance().getTimeInMillis(), Calendar.getInstance().getTimeInMillis() + 1));
    private static class CustomCalendarAdapter extends CalendarAdapter {
        public CustomCalendarAdapter(RadCalendarView owner) {
        protected CalendarDayCell generateCalendarDayCell() {
            return new CustomCalendarDayCell(this.owner);
    private static class CustomCalendarDayCell extends CalendarDayCell {
        public CustomCalendarDayCell(RadCalendarView owner) {
        protected void drawEvents(Canvas canvas) {
            if (this.getEvents() != null && this.getEvents().size() > 0)
                this.owner.getEventAdapter().getRenderer().renderEvents(canvas, this);
    private static class CustomEventRenderer extends EventRenderer {
        private static final int COLOR_IDLE = Color.parseColor("#38b4db");
        private static final int COLOR_SELECTED = Color.parseColor("#ffffff");
        private float size;
        private Paint paint;
        public CustomEventRenderer(Context context) {
            this.size = Util.getDimen(TypedValue.COMPLEX_UNIT_DIP, 20);
            this.paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        public void renderEvents(Canvas canvas, CalendarDayCell cell) {
            Path path = new Path();
            path.moveTo(cell.getRight() - this.size, cell.getBottom());
            path.lineTo(cell.getRight(), cell.getBottom());
            path.lineTo(cell.getRight(), cell.getBottom() - this.size);
            if (cell.isSelected())
            canvas.drawPath(path, this.paint);

    This should be close to the desired result. Please let me know if you need some further assistance.

    Thank you for your time and all best!

    Antony Jekov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top