Custom cell on Android

5 posts, 0 answers
  1. Ian
    Ian avatar
    68 posts
    Member since:
    Jul 2017

    Posted 27 Apr 2018 Link to this post

    On iOS I can create a calendar delegate that returns a custom cell.

    How do I do this on Android? I can't find the equivalent types.

  2. Ian
    Ian avatar
    68 posts
    Member since:
    Jul 2017

    Posted 27 Apr 2018 Link to this post

    In particular, I would like to draw in a cell.
  3. Ian
    Ian avatar
    68 posts
    Member since:
    Jul 2017

    Posted 27 Apr 2018 Link to this post

    I appear to have found it...

    public class MyCalendarRenderer : CalendarRenderer
    {
       protected override void OnElementChanged(ElementChangedEventArgs<RadCalendar> e)
       {
          base.OnElementChanged(e);
     
          Control.Adapter = new MyAdapter(Control);
       }
    }
     
    public class MyAdapter : CalendarAdapter
    {
       public MyAdapter(RadCalendarView view) : base(view)
       {
       }
     
       protected override CalendarDayCell GenerateCalendarDayCell() => new MyCell(Owner);
    }
  4. Ian
    Ian avatar
    68 posts
    Member since:
    Jul 2017

    Posted 27 Apr 2018 Link to this post

    I spoke too soon. My custom adapter isn't initialized properly. Now, for example, the month names are missing.

    How do I initialize an adapter?

  5. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    665 posts

    Posted 01 May 2018 Link to this post

    Hi, Ian,

    Please check the following article regarding the native Android Calendar - RadCalendarView Customizations. More specifically, you can have a look at the Defining set of customization rules part.

    Regards,
    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top