Cell Customization

2 posts, 0 answers
  1. Jeff
    Jeff avatar
    1 posts
    Member since:
    Jun 2012

    Posted 05 Mar 2015 Link to this post

    Is there a way to add a custom image to the background of an individual cell?  I was able to do this in iOS fairly easily by setting a custom delegate and overriding ViewForCellOfKind.
  2. Antony Jekov
    Antony Jekov avatar
    88 posts

    Posted 10 Mar 2015 Link to this post

    Hello Jeff,

    Thank you for contacting the Android team!

    We don't support custom picture backgrounds by design, but we have a bitmap element in the cells, which can be modified to fill the cell thus become the background. This would be an example code:
    protected void onCreate(Bundle savedInstanceState) {
        final RadCalendarView calendarView = new RadCalendarView(this);
        calendarView.setAdapter(new Adapter(calendarView));
        final Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.my_pic);
        calendarView.setCustomizationRule(new Procedure<CalendarCell>() {
            Calendar calendar = Calendar.getInstance();
            public void apply(CalendarCell argument) {
                if (argument.getCellType() == CalendarCellType.Date) {
                    if (calendar.get(Calendar.DATE) == 5) {
                    } else {
    class Adapter extends CalendarAdapter {
        public Adapter(RadCalendarView owner) {
        protected CalendarDayCell generateCalendarDayCell() {
            return new Cell(this.owner);
        class Cell extends CalendarDayCell {
            public Cell(RadCalendarView owner) {
                setBitmapPosition(CalendarElement.TOP | CalendarElement.LEFT);
            protected void onArrange() {
                if (getBitmap() != null) {
                    this.setBitmap(Bitmap.createBitmap(getBitmap(), 0, 0, getWidth(), getHeight()));
    Please let me know if this is what you meant and if it suits your needs.

    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