-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display Events #7
Comments
I'm not sure I follow what you need. Is it possible for you to describe things further? Maybe a brief picture/diagram? CompactCalendarView is just a view, used to display things. Events are are only really used to answer a simple question, "Hey, there's something special on this day so can you highlight it?" or "This day is no longer special, can you not highlight it anymore?". Besides, the CalendarDayEvent object contains no useful data, other than the unix time and a color for the day. It doesn't encapsulate any important data. So it is up to the client to keep track of extra data and display something interesting for a particular day. Remember, that CompactCalendarView exposes a listener/callback hook. So, if a user selected a day, you will be notified when this happens with the date. You can then answer the question, "Is there something special on this day?". For example, you might have a booking object which has its own unix time/date and a title to say what the event is stored in a list. When a day is selected, you can iterate through the list, compare dates and display the event in the UI. Is this what your after? If so I can write some sample code if you would like in the example app. |
Yes, thats what i want, basically i'm trying to add expenses to the calendar, when lets say when the user selects a past date, he can see all his expenses recorded 👍 |
Ok I can add an example when I get time. But here's one way of doing it. Keep a HashMap of Date objects to a Set for each particular day. Update the calendar with the calendar events. Set up a listener for a day click. Get the Set of Expenses using the date object. Iterate through them and add them to a Listview to display them in the UI. |
Ahh mate... My programming skills aren't that great.. I'm still quite unfamiliar with hashmaps.. Thanks for the help though I appreciate it :)
|
Please see the sample in this branch. |
Did you have a chance too look at the sample code? I'm gonna go ahead an close this one. |
Thanks a lot Sundeep! This is what I was looking for! You are awesome! Sent from Windows Mail From: Sundeep Kahlon Did you have a chance too look at the sample code? I'm gonna go ahead an close this one. — |
I see you have added 6 events in your calendar, Is it possible to display those events on the below fragment when the day is selected?
The text was updated successfully, but these errors were encountered: