I am trying to decorate a specif cell, I have only achieve this to aply this decorator when the cell is tabbed/clicked, but How I apply a decorator to specif cells only.
I am using this decorator:
Also can I fill the circle with the color?
I can see that there is a function called:
But I need to pass a CalendarCell which is an Abstract class.
4 Answers, 1 is accepted
I may have found a way but nothing is being rendered, here is my code:
Thank you for contacting the Android team.
You are going in the right direction. The cell decorators only trigger when the cell is selected. The other option for customization without extensions is the custom rules, but they still cannot provide the effect you are looking for.
In your case you would like to extend the CalendarDayCell and add logic to its render method. I have prepared a simple implementation by following your request:
This will produce the result you are looking for.
1. Check if the cell is a date cell (not a day name cell).
2. Render the circle.
3. Render the text above the circle using the text coordinates and the text paint.
Please let me know if this suits you purposes.
Thank you for your time and all best!
Hello Thanks so much for the response. Is there a way to change the color and the size of the text?
I have tried this:
You can use a customization rule for changing the existing properties of the cell. You will find it very difficult to try and use another way. Here is the sample code:
And setting this to the calendar would look like this:
I hope this is what you are looking for.