My application displays information on a month calendar view. The information itself is a string. The month view is both the UI (i.e. user picks a date from the month view by touching the desired date) and the means for displaying the information (e.g. the historical average temperature for the days surround the date selected by the user). When the phone is oriented in portrait I want M-F (5 columns) and when in landscape Su-Sa (7 columns). I want to make the calendar flickable so that the user can change the month with a flick gesture. I would like to have a good deal of control over how the text is displayed in the calendar view for example I might want the day_of_the_month number displayed in middle of each day with large text until the user picks the date and then move the that number into the upper left corner to make room for more information.
My research indicates that I need to write my own UI for this. I’ve implemented this as an array of buttons (created in xml using table layout). My implementation works and pulling it together was a useful learning exercise. But now that I’ve got the bones assembled I am wondering whether a button array is the best implementation given my goals? I used an array of buttons because I am a newbie and wanted the button class to handle the draw and touch events. However, it occurs to me that I could also have used a single view on which I draw a grid of lines and then handled the draw and touch events myself.
As a newbie I am worried about whether a button array is too expensive in terms of processing resources, whether I will have enough control over how text is displayed on the botton, and also whether I will run into problems using it later for some reason that I just can’t imagine now because of my inexperience.
Does anyone have any thoughts on the best way to implement a month calendar view? I would very much appreciate your thoughts.
Well, why not just use http://code.google.com/p/android-calendar-view/? It uses an ImageView and properly handles the touch events.