Skip to content
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

Closed
MishalC opened this issue Jul 14, 2015 · 7 comments
Closed

Display Events #7

MishalC opened this issue Jul 14, 2015 · 7 comments

Comments

@MishalC
Copy link

MishalC commented Jul 14, 2015

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?

@SundeepK
Copy link
Owner

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.

@MishalC
Copy link
Author

MishalC commented Jul 14, 2015

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 👍

@SundeepK
Copy link
Owner

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.

@MishalC
Copy link
Author

MishalC commented Jul 15, 2015

Ahh mate... My programming skills aren't that great.. I'm still quite unfamiliar with hashmaps.. Thanks for the help though I appreciate it :)

On Jul 15, 2015, at 5:15 AM, Sundeep Kahlon notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHub.

@SundeepK
Copy link
Owner

Please see the sample in this branch.

@SundeepK
Copy link
Owner

Did you have a chance too look at the sample code? I'm gonna go ahead an close this one.

@MishalC
Copy link
Author

MishalC commented Jul 21, 2015

Thanks a lot Sundeep! This is what I was looking for! You are awesome!

Sent from Windows Mail

From: Sundeep Kahlon
Sent: ‎Tuesday‎, ‎July‎ ‎21‎, ‎2015 ‎1‎:‎46‎ ‎AM
To: SundeepK/CompactCalendarView
Cc: MishalC

Did you have a chance too look at the sample code? I'm gonna go ahead an close this one.


Reply to this email directly or view it on GitHub.

SundeepK added a commit that referenced this issue Jul 30, 2015
SundeepK added a commit that referenced this issue Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants