Skip to content

Commit 5315def

Browse files
authored
Update README.md
1 parent c2fbca1 commit 5315def

File tree

1 file changed

+3
-239
lines changed

1 file changed

+3
-239
lines changed

README.md

Lines changed: 3 additions & 239 deletions
Original file line numberDiff line numberDiff line change
@@ -31,252 +31,16 @@ Who uses it
3131
* [Unicaen Timetable](https://play.google.com/store/apps/details?id=fr.skyost.timetable)
3232
* Using the library? Just make an issue
3333

34-
Usage
35-
---------
36-
37-
1. Import the library into your project.
38-
* Grab via maven
39-
40-
```xml
41-
<dependency>
42-
<groupId>com.github.quivr</groupId>
43-
<artifactId>android-week-view</artifactId>
44-
<version>2.2.2</version>
45-
<type>aar</type>
46-
</dependency>
47-
```
48-
* Grab via gradle
49-
50-
```groovy
51-
compile 'com.github.quivr:android-week-view:2.2.2'
52-
```
53-
2. Add WeekView in your xml layout.
54-
55-
```xml
56-
<com.alamkanak.weekview.WeekView
57-
android:id="@+id/weekView"
58-
android:layout_width="match_parent"
59-
android:layout_height="match_parent"
60-
app:eventTextColor="@android:color/white"
61-
app:textSize="12sp"
62-
app:hourHeight="60dp"
63-
app:headerColumnPadding="8dp"
64-
app:headerColumnTextColor="#8f000000"
65-
app:headerRowPadding="12dp"
66-
app:columnGap="8dp"
67-
app:noOfVisibleDays="3"
68-
app:headerRowBackgroundColor="#ffefefef"
69-
app:dayBackgroundColor="#05000000"
70-
app:todayBackgroundColor="#1848adff"
71-
app:headerColumnBackground="#ffffffff"/>
72-
```
73-
3. Write the following code in your java file.
74-
75-
```java
76-
// Get a reference for the week view in the layout.
77-
mWeekView = (WeekView) findViewById(R.id.weekView);
78-
79-
// Set an action when any event is clicked.
80-
mWeekView.setOnEventClickListener(mEventClickListener);
81-
82-
// The week view has infinite scrolling horizontally. We have to provide the events of a
83-
// month every time the month changes on the week view.
84-
mWeekView.setMonthChangeListener(mMonthChangeListener);
85-
86-
// Set long press listener for events.
87-
mWeekView.setEventLongPressListener(mEventLongPressListener);
88-
```
89-
4. Implement `WeekView.MonthChangeListener`, `WeekView.EventClickListener`, `WeekView.EventLongPressListener` according to your need.
90-
91-
5. Provide the events for the `WeekView` in `WeekView.MonthChangeListener.onMonthChange()` callback. Please remember that the calendar pre-loads events of three consecutive months to enable lag-free scrolling.
92-
93-
```java
94-
MonthLoader.MonthChangeListener mMonthChangeListener = new MonthLoader.MonthChangeListener() {
95-
@Override
96-
public List<WeekViewEvent> onMonthChange(int newYear, int newMonth) {
97-
// Populate the week view with some events.
98-
List<WeekViewEvent> events = getEvents(newYear, newMonth);
99-
return events;
100-
}
101-
};
102-
```
103-
104-
Customization
105-
-------------------
106-
107-
You can customize the look of the `WeekView` in xml. Use the following attributes in xml. All these attributes also have getters and setters to enable you to change the style dynamically.
108-
109-
- `allDayEventHeight`
110-
- `autoLimitTime`
111-
- `columnGap`
112-
- `dayBackgroundColor`
113-
- `dayNameLength`
114-
- `dropListenerEnabled`: Whether items can be dropped on the weekview
115-
- `eventCornerRadius`
116-
- `eventMarginVertical`
117-
- `eventPadding`
118-
- `eventTextColor`
119-
- `eventTextSize`
120-
- `firstDayOfWeek`
121-
- `futureBackgroundColor`
122-
- `futureWeekendBackgroundColor`
123-
- `headerColumnBackground`
124-
- `headerColumnPadding`
125-
- `headerColumnTextColor`
126-
- `headerRowBackgroundColor`
127-
- `headerRowPadding`
128-
- `horizontalFlingEnabled`
129-
- `hourHeight`
130-
- `hourSeparatorColor`
131-
- `hourSeparatorHeight`
132-
- `maxHourHeight`
133-
- `maxTime`
134-
- `minHourHeight`
135-
- `minTime`
136-
- `minOverlappingMinutes`: The minimal amount of overlap of 2 events needed to be seen as overlapping events
137-
- `newEventColor`
138-
- `newEventId`
139-
- `newEventIconResource`
140-
- `newEventLengthInMinutes`
141-
- `newEventTimeResolutionInMinutes`
142-
- `noOfVisibleDays`
143-
- `nowLineColor`
144-
- `nowLineThickness`
145-
- `overlappingEventGap`
146-
- `pastBackgroundColor`
147-
- `pastWeekendBackgroundColor`
148-
- `scrollDuration`
149-
- `showDistinctPastFutureColor`
150-
- `showDistinctWeekendColor`
151-
- `showFirstDayOfWeekFirst`
152-
- `showNowLine`
153-
- `textSize`
154-
- `timeColumnResolution`
155-
- `todayBackgroundColor`
156-
- `todayHeaderTextColor`
157-
- `verticalFlingEnabled`
158-
- `xScrollingSpeed`
159-
- `zoomFocusPoint` The focused point (percentage of the view height) where the week view is zoomed around. This point will not move while zooming. You can declare it as a fraction `app:focusPoint="30%"` and if is not declared the top of the view is used.
160-
- `zoomFocusPointEnabled` If you set this to ``false`` the zoomFocusPoint won't take effect any more while zooming. The zoom will always be focused at the center of your gesture.
161-
162-
Interfaces
163-
----------
164-
165-
Use the following interfaces according to your need.
34+
Getting Started
35+
---------------
16636

167-
- `mWeekView.setWeekViewLoader()` to provide events to the calendar
168-
- `mWeekView.setMonthChangeListener()` to provide events to the calendar by months
169-
- `mWeekView.setOnEventClickListener()` to get a callback when an event is clicked
170-
- `mWeekView.setEventLongPressListener()` to get a callback when an event is long pressed
171-
- `mWeekView.setEmptyViewClickListener()` to get a callback when any empty space is clicked
172-
- `mWeekView.setEmptyViewLongPressListener()` to get a callback when any empty space is long pressed
173-
- `mWeekView.setDateTimeInterpreter()` to set your own labels for the calendar header row and header column
174-
- `mWeekView.setScrollListener()` to get an event every time the first visible day has changed
175-
- `mWeekView.setAddEventClickListener()` to get the start and end time of an event to add
176-
- `mWeekView.setTextColorPicker()` to change the textcolor of an event, based on the event. You can, for example, set a different text color depending on the color of the event.
177-
- `mWeekView.setDropListener()` to get a callback when a view is dropped at a certain date.
37+
View the [wiki](https://github.com/Quivr/Android-Week-View/wiki)
17838

17939
Sample
18040
----------
18141

18242
There is also a [sample app](https://github.com/quivr/Android-Week-View/tree/master/sample) to get you started.
18343

184-
To do
185-
-------
186-
187-
* Add event touch feedback selector
188-
189-
Changelog
190-
---------
191-
**Version 2.2.2**
192-
* Added `DropListener` and `dropListenerEnabled`
193-
* Added `TextColorPicker`
194-
* Fixed some problems with placement of add event rectangle
195-
* Added `minOverlappingMinutes`
196-
197-
**Version 2.2.1**
198-
* Small fix on string equality
199-
200-
**Version 2.2.0**
201-
* IMPORTANT: Prefetching isn't done by the library anymore (see [#42](/../../pull/42))
202-
* Strings can now be used as Id's of WeekViewEvents
203-
204-
**Version 2.0.0**
205-
* This fork is first released
206-
* Possibility to set minDate and maxDate
207-
* Allday events are supported
208-
* Events can be add by clicking on empty space
209-
210-
**Version 1.2.6**
211-
212-
* Add empty view click listener
213-
* Fix padding bug
214-
* Fix bug when setting colors of different components
215-
* Add ability to turn off fling gesture
216-
* Add example of how to load events asynchronously in the sample app
217-
218-
**Version 1.2.5**
219-
220-
* Add support for using subclasses of `WeekViewEvent`
221-
* Fix scroll animation
222-
* Add support for semi-transparent header colors
223-
224-
**Version 1.2.4**
225-
226-
* **NOTE:** If you are using `WeekView.MonthChangeListener`, make sure to change it into `MonthLoader.MonthChangeListener`
227-
* Add support to have loaders other than MonthViewLoader
228-
* Add pinch to zoom support
229-
* Add support for location
230-
* Add ability to have different colors for past, future, weekend days
231-
* Add support for "now" line
232-
233-
**Version 1.2.3**
234-
235-
* Get callbacks when scrolling horizontally
236-
* `goToHour` and `goToDate` methods has been fixed
237-
* Use `getFirstVisibleHour` method to get the first visible hour in the week view
238-
239-
**Version 1.2.1**
240-
241-
* Better scrolling added
242-
* Get callbacks when empty view is tapped/long pressed
243-
* Control the speed of scrolling
244-
* Support for multiple language added
245-
* Ability to set your own interpreter for header row and column added
246-
247-
**Version 1.1.7**
248-
249-
* You can now dynamically scroll to an hour of your preference.
250-
251-
**Version 1.1.6**
252-
253-
* Added support for events that expands to multiple days
254-
255-
**Version 1.1.5**
256-
257-
* A bug related to overlapping events fixed
258-
* You can now programmatically get first and last visible day in the week view
259-
260-
**Version 1.1.4**
261-
262-
* Small bug fixed
263-
264-
**Version 1.1.3**
265-
266-
* Margins support added for overlapping events
267-
268-
**Version 1.1.2**
269-
270-
* Small bugs fixed
271-
* Hour separator inconsistency fixed
272-
273-
**Version 1.1.1**
274-
275-
* Overlapping event bug fixed
276-
277-
**Version 1.1.0**
278-
279-
* Added support for overlapping events
28044

28145
License
28246
----------

0 commit comments

Comments
 (0)