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

adding events and showing events #3

Closed
kprathap23 opened this issue Feb 19, 2015 · 22 comments
Closed

adding events and showing events #3

kprathap23 opened this issue Feb 19, 2015 · 22 comments
Milestone

Comments

@kprathap23
Copy link

adding events and showing events in the calender like calendar app in android.

@kprathap23 kprathap23 changed the title adding events and showing events to the calender adding events and showing events in the calender Feb 19, 2015
@kprathap23 kprathap23 changed the title adding events and showing events in the calender adding events and showing events Feb 19, 2015
@dandc87
Copy link
Contributor

dandc87 commented Feb 19, 2015

I'm not sure where this fits into the goal of the project, which is to make a date picker widget of material design. I'm not against it, but this will likely take low priority, unless this is a popular request.

While this percolates:

What kind of API are you thinking of? Something like this:

calendarView.addEvent(new Event(date, "Extra Data"));

And how should events be shown indicated on the view?

@ppatriotis
Copy link

Maybe just some different highlighting for a few "event" dates in the background using would be the easiest without a whole different UI. Might be nice option to highlight today's date too?

@kprathap23
Copy link
Author

@dandc87

Thanks for the comments.

Exactly like this.
calendarView.addEvent(new Event(date, "Extra Data"));

@NeoDigi
Copy link

NeoDigi commented Mar 5, 2015

I support this idea, i'll try to see if I can help

@dandc87 dandc87 added this to the 1.0.0 milestone Mar 7, 2015
@syt0r
Copy link

syt0r commented Mar 10, 2015

So, when will be update? I can't wait. I haven't seen usage like this in other libraries, so i hope update will be soon

@jlindenbaum
Copy link
Contributor

I would be happy with a simpler implementation, something that just let's me return true in a delegate that checks if a date has an event, like: public boolean dateHasEvent(Date date). Then I can still have my own, styled list view below the calendar to show those events properly when the OnDateChangedListener fires.

Dates that have events - where the delegate function returned true - could simply be highlighted with a dot below the date. Much like https://github.com/jonathantribouharet/JTCalendar

@dandc87
Copy link
Contributor

dandc87 commented Mar 11, 2015

@jlindenbaum I was trying to find an appropriate way to indicate a day had an event; thanks for the suggestion!

Does anyone else have input they would like to give for the API? If we are going to use the dot indicator, I'm supportive of the delegate pattern, but I see what I initially proposed as more extensible. Maybe a mix between the two and call it an EventAdapter? Though I'm not quite sure how that would work.

@jlindenbaum
Copy link
Contributor

I'd prefer a lighter weight calendar utility, and handling my own event
listing / adapter. I'd be very happy with just a way to highlight that
there's something going on that day.

Since I personally want to handle the click and styling of the event
listing, and won't want to have to jam custom adapters into the calendar
view to do so.

On Wed, Mar 11, 2015 at 12:02 PM, Adam Koski notifications@github.com
wrote:

@jlindenbaum https://github.com/jlindenbaum I was trying to find an
appropriate way to indicate a day had an event; thanks for the suggestion!

Does anyone else have input they would like to give for the API? If we are
going to use the dot indicator, I'm supportive of the delegate pattern, but
I see what I initially proposed as more extensible. Maybe a mix between the
two and call it and EventAdapter? Though I'm not quite sure how that
would work.


Reply to this email directly or view it on GitHub
#3 (comment)
.

@NeoDigi
Copy link

NeoDigi commented Mar 11, 2015

I think the dot indicator would be a good idea and it would be easy to put different kind of event simply by changing the color of the dot.
But as @jlindenbaum said we should be able to override the "dot adapter" by using an adapter of our own.

@jlindenbaum
Copy link
Contributor

This is a very naive, and untested, implementation of how I imagine the flow. There is no caching, but that could be added. For every CalendarDay we call the EventDelegate that is implemented, most likely, in a Fragment. This naive implementation does not highlight the current day in any way. It's merely seeing if people would agree with this type of implementation.

jlindenbaum@15d0fb9

@dandc87 dandc87 mentioned this issue Mar 13, 2015
@jlindenbaum
Copy link
Contributor

Based off #21, I'd suggest changing EventsDelegate to something more appropriately named, perhaps CalendarDayConfigurationDelegate. I've been rolling with delegate, as it's not really a listener, but also not entirely a delegate. Help appreciated.

Functions in the delegate could now be public boolean calendarDayHasEvent(CalendarDay day) and public boolean calendarDayIsSelectable(CalendarDay day), or calendarDayIsEnabled(CalendarDay day). Any number of functions that allow us to configure the CalendarDay while it's being rendered.

@ghost
Copy link

ghost commented Mar 19, 2015

selection_722
Hi @dandc87, can you update calendar view like this:

  • The dot or indicator below is a date which has event
  • The selected day is the day has red background
  • The current day is the day has red text color

@krazykira
Copy link

I think it would be awesome to have events adding and deleting feature in this calendar. This is something that is implemented in Caldroid.
https://github.com/roomorama/Caldroid
We can even customize the appearance of events shown on Calender in Caldroid. And i would like the same sort of functionality here.

@angelpinheiro
Copy link

A more general solution would be to provide custom decorators to day views. I was working on a very simple implementation that allows you to do so angelpinheiro@7d7f1ce. I have also updated the sample project with a new example that looks like this:

First you define your decorator, to decorate day views as you want:

public class HighlightDecorator implements DayViewDecorator{
    @Override
    public void decorate(DayView view,Context context) {
        view.setBackground(generateCircleDrawable(color));
    }
}

Then you tell calendar widget wich dates you want to decorate:

widget.addDayViewDecorator(new HighlightDecorator(), dates)
widget.addDayViewDecorator(new AnotherDecorator(), ...)

You can probably improve it in many ways, since I do not know very well the architecture of the library, but it's a starting point. I will do a pull request if you are interested!

@dandc87
Copy link
Contributor

dandc87 commented Apr 15, 2015

I like the decorator idea @angelpinheiro, but it needs some work. Will you create a pull request so we can discuss some changes?

@dandc87
Copy link
Contributor

dandc87 commented Apr 23, 2015

You can now use DayViewDecorator to show events!

@dandc87 dandc87 closed this as completed Apr 23, 2015
@kprathap23
Copy link
Author

Thanks for all , Awesome Work.

@vardimir
Copy link

how i can add a new event like intent?

@shubham-agr
Copy link

how can i add a text below a date?? (Can be event or reminder)

@recker115
Copy link

Yes, like can we popup a title or a text somehow for the decorated dates ??

@rajputneeru
Copy link

rajputneeru commented Feb 1, 2018

Please Let me any idea How i can show all events on material calendar after getting from Google calendar API??

@CoderAlok
Copy link

Please somebody give me the proper detailed code to add and view the event in this calander view

svenji referenced this issue in WhistleLabs/material-calendarview Dec 13, 2018
Update group to WhistleLabs
GomajiEvanHsu pushed a commit to GomajiGeorgeHsu/material-calendarview that referenced this issue Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests