开发者

Help with Android MonthDisplayHelper

How exactly do we use Android's MonthDisplayHelper? Ive been searching for possible widgets/v开发者_开发百科iews that would help me simplify my work as I would need to create a calendar. but it is just so hard. at least for me. So i saw this MonthDisplayHelper. from its members, i think i know what it can do..but what i don't get is how are we going to use it as i dont see it extending the view class nor is it an adapter. i know the question might be confusing. im heck confused right now. i hope somebody could help.


enlighten the confused :D


im sorry this came late..i have figured it out myself that MonthDisplayHelper will not make a Calendar for me. Well i hope it did. Creating a calendar functionality is not an easy task. we are faced with relatively complex algorithm.

so MonthDispalyHelper, again, will not make a calendar for you. Rather, it provides utility functionalities that would help you build your own calendar. a very good example of that is

MonthDisplayHelper mdh = new MonthDisplayHelper(viewedYear, viewedMonth);
int temp[] = mdh.getDigitsForRow(countRows);

which basically gives us as an integer array representation of which dates(digits) should go to each cell of the calendar. say for example, the first rows of the calendar of the supplied month and year(July 2011), would be {26,27,28,29,30,1,2}. from there, the job to position those digits to your layouts would be yours.

it also provides methods such as getting the number of days that the month specified have, the day of the week that the month starts, among other things.

i hope this helps.


This project uses MonthDisplayHelper, which might help understand how it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜