NLMartian / SilkCal

Android calendar view inspired by Sunrise calendar and iOS7 stock calendar
384 stars 66 forks source link

event coloring #2

Closed kyochae closed 9 years ago

kyochae commented 9 years ago

Thank you for awesome calendar view!

were you able to add an event coloring such as a dot or a line under a day per month?

leonardoxh commented 9 years ago

Or create an decorator for select any circle with an diferent color...

kyochae commented 9 years ago

I actually created a dot decorator but found better one after it. You can take a look existing get/setCountMap functions to display this purpose exactly. I'll close it myself.

jak3chase commented 9 years ago

Hey @kyochae , do you mind sharing how you managed to accomplish this? Thanks!

kyochae commented 9 years ago

Hi @jak3chase,

where you defined your calendarView like DayPickerView calendarView = (DayPickerView) view.findViewById(R.id.calendar_view);

simply set like this HashMap<SimpleMonthAdapter.CalendarDay, Integer> countMap = new HashMap<SimpleMonthAdapter.CalendarDay, Integer>(); SimpleMonthAdapter.CalendarDay selDay = new SimpleMonthAdapter.CalendarDay(2015,6,21); countMap.put(selDay,1); selDay = new SimpleMonthAdapter.CalendarDay(2015,6,22); countMap.put(selDay,2); selDay = new SimpleMonthAdapter.CalendarDay(2015,6,23); countMap.put(selDay,3);

calendarView.setCountMap(countMap);

It's up to you where you put it, I just placed it in AsyncTask.