Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Tibolte committed Nov 27, 2015
1 parent 5617b65 commit acdb9c9
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,40 @@ Then configure it in your code with a start and end date associated with a list
mAgendaCalendarView.init(eventList, minDate, maxDate, Locale.getDefault(), this);
````

The event list contains CalendarEvent instances, see the description of the parameters:
The event list contains BaseCalendarEvent instances, see the description of the parameters:
```java
/**
* Initializes the event
* @param title The title of the event.
*
* @param id The id of the event.
* @param color The color of the event.
* @param title The title of the event.
* @param description The description of the event.
* @param location The location of the event.
* @param color The color of the event (for display in the app).
* @param startTime The start time of the event.
* @param endTime The end time of the event.
* @param allDay Indicates if the event lasts the whole day.
* @param location The location of the event.
* @param dateStart The start date of the event.
* @param dateEnd The end date of the event.
* @param allDay Int that can be equal to 0 or 1.
* @param duration The duration of the event in RFC2445 format.
*/
public CalendarEvent(String title, String description, String location, int color, Calendar startTime, Calendar endTime, boolean allDay) {
public BaseCalendarEvent(long id, int color, String title, String description, String location, long dateStart, long dateEnd, int allDay, String duration) {
this.mId = id;
this.mColor = color;
this.mAllDay = (allDay == 1) ? true : false;
this.mDuration = duration;
this.mTitle = title;
this.mDescription = description;
this.mLocation = location;
this.mColor = color;
this.mStartTime = startTime;
this.mEndTime = endTime;
this.mAllDay = allDay;

this.mStartTime = Calendar.getInstance();
this.mStartTime.setTimeInMillis(dateStart);
this.mEndTime = Calendar.getInstance();
this.mEndTime.setTimeInMillis(dateEnd);
}
````
Here is a quick (and very simple) example providing a list of events, you can provide serveral layouts too:
Here is a quick (and very simple) example providing a list of events, you can provide several layouts too:

```java
private void mockList(List<CalendarEvent> eventList) {
Calendar startTime1 = Calendar.getInstance();
Calendar endTime1 = Calendar.getInstance();
endTime1.add(Calendar.MONTH, 1);
Expand All @@ -88,7 +97,7 @@ Here is a quick (and very simple) example providing a list of events, you can pr
ContextCompat.getColor(this, R.color.yellow), startTime2, endTime2, true);
eventList.add(event2);

// Example on how you can provide your own layout
// Example on how to provide your own layout
Calendar startTime3 = Calendar.getInstance();
Calendar endTime3 = Calendar.getInstance();
startTime3.set(Calendar.HOUR_OF_DAY, 14);
Expand All @@ -109,6 +118,9 @@ Here is a quick (and very simple) example providing a list of events, you can pr
# Participating?
Make your pull requests on feature or bugfix branches.

# Special thanks to these contributors
[FHellmann](https://github.com/FHellmann)

License
-----------

Expand Down

0 comments on commit acdb9c9

Please sign in to comment.