What version of Android are you using? This is important because there is a calendar in Android 3.0, there are errors, but they are not so critical.
About your question, if I understood it well. Look at your XML, it contains 11 layouts, and this is just for one element. If you have a lot of them, imagine the amount of work that Android needs to do to inflate all of your elements. And after that, when you sit down, you reuse the elements, and Android needs to update those that are invalid. This is a lot of work. (11 layouts * 30 = 330 layouts that need to be updated or inflated). As the documentation for Android developers says, you should always use as few layouts as possible to wrap your elements as much as possible!
In any case, your approach is incorrect. I can suggest you look at the source code of CalendarView in Android 3+, but give you a hint:
Create a layout for a week, not for every day (for example, in CalendarView). By doing this, Android will only need to update n elements (you will choose how many weeks you want to display at a time), and not 30. This layout should contain 7 views for each day.
I hope you get some idea from this.
source share