|
| 1 | +[Join our slack](https://join.slack.com/t/androidweekview/shared_invite/enQtMzEyMDE3NzU3NTM3LWQyZGRhNjRlMTUzNzNlNjNlM2M0OTMyMDhjMzE1NDMzOGQzYzhjNzI2YjZhZWM3MzJiY2I1YmY2NGEwOTlkNTY) |
| 2 | + |
| 3 | + |
1 | 4 | Android Week View |
2 | 5 | ================= |
3 | 6 |
|
@@ -28,252 +31,16 @@ Who uses it |
28 | 31 | * [Unicaen Timetable](https://play.google.com/store/apps/details?id=fr.skyost.timetable) |
29 | 32 | * Using the library? Just make an issue |
30 | 33 |
|
31 | | -Usage |
32 | | ---------- |
33 | | - |
34 | | -1. Import the library into your project. |
35 | | - * Grab via maven |
36 | | - |
37 | | - ```xml |
38 | | - <dependency> |
39 | | - <groupId>com.github.quivr</groupId> |
40 | | - <artifactId>android-week-view</artifactId> |
41 | | - <version>2.2.2</version> |
42 | | - <type>aar</type> |
43 | | - </dependency> |
44 | | - ``` |
45 | | - * Grab via gradle |
46 | | - |
47 | | - ```groovy |
48 | | - compile 'com.github.quivr:android-week-view:2.2.2' |
49 | | - ``` |
50 | | -2. Add WeekView in your xml layout. |
51 | | - |
52 | | - ```xml |
53 | | - <com.alamkanak.weekview.WeekView |
54 | | - android:id="@+id/weekView" |
55 | | - android:layout_width="match_parent" |
56 | | - android:layout_height="match_parent" |
57 | | - app:eventTextColor="@android:color/white" |
58 | | - app:textSize="12sp" |
59 | | - app:hourHeight="60dp" |
60 | | - app:headerColumnPadding="8dp" |
61 | | - app:headerColumnTextColor="#8f000000" |
62 | | - app:headerRowPadding="12dp" |
63 | | - app:columnGap="8dp" |
64 | | - app:noOfVisibleDays="3" |
65 | | - app:headerRowBackgroundColor="#ffefefef" |
66 | | - app:dayBackgroundColor="#05000000" |
67 | | - app:todayBackgroundColor="#1848adff" |
68 | | - app:headerColumnBackground="#ffffffff"/> |
69 | | - ``` |
70 | | -3. Write the following code in your java file. |
71 | | - |
72 | | - ```java |
73 | | - // Get a reference for the week view in the layout. |
74 | | - mWeekView = (WeekView) findViewById(R.id.weekView); |
75 | | - |
76 | | - // Set an action when any event is clicked. |
77 | | - mWeekView.setOnEventClickListener(mEventClickListener); |
78 | | - |
79 | | - // The week view has infinite scrolling horizontally. We have to provide the events of a |
80 | | - // month every time the month changes on the week view. |
81 | | - mWeekView.setMonthChangeListener(mMonthChangeListener); |
82 | | - |
83 | | - // Set long press listener for events. |
84 | | - mWeekView.setEventLongPressListener(mEventLongPressListener); |
85 | | - ``` |
86 | | -4. Implement `WeekView.MonthChangeListener`, `WeekView.EventClickListener`, `WeekView.EventLongPressListener` according to your need. |
87 | | - |
88 | | -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. |
89 | | - |
90 | | - ```java |
91 | | - MonthLoader.MonthChangeListener mMonthChangeListener = new MonthLoader.MonthChangeListener() { |
92 | | - @Override |
93 | | - public List<WeekViewEvent> onMonthChange(int newYear, int newMonth) { |
94 | | - // Populate the week view with some events. |
95 | | - List<WeekViewEvent> events = getEvents(newYear, newMonth); |
96 | | - return events; |
97 | | - } |
98 | | - }; |
99 | | - ``` |
100 | | - |
101 | | -Customization |
102 | | -------------------- |
103 | | - |
104 | | -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. |
105 | | - |
106 | | -- `allDayEventHeight` |
107 | | -- `autoLimitTime` |
108 | | -- `columnGap` |
109 | | -- `dayBackgroundColor` |
110 | | -- `dayNameLength` |
111 | | -- `dropListenerEnabled`: Whether items can be dropped on the weekview |
112 | | -- `eventCornerRadius` |
113 | | -- `eventMarginVertical` |
114 | | -- `eventPadding` |
115 | | -- `eventTextColor` |
116 | | -- `eventTextSize` |
117 | | -- `firstDayOfWeek` |
118 | | -- `futureBackgroundColor` |
119 | | -- `futureWeekendBackgroundColor` |
120 | | -- `headerColumnBackground` |
121 | | -- `headerColumnPadding` |
122 | | -- `headerColumnTextColor` |
123 | | -- `headerRowBackgroundColor` |
124 | | -- `headerRowPadding` |
125 | | -- `horizontalFlingEnabled` |
126 | | -- `hourHeight` |
127 | | -- `hourSeparatorColor` |
128 | | -- `hourSeparatorHeight` |
129 | | -- `maxHourHeight` |
130 | | -- `maxTime` |
131 | | -- `minHourHeight` |
132 | | -- `minTime` |
133 | | -- `minOverlappingMinutes`: The minimal amount of overlap of 2 events needed to be seen as overlapping events |
134 | | -- `newEventColor` |
135 | | -- `newEventId` |
136 | | -- `newEventIconResource` |
137 | | -- `newEventLengthInMinutes` |
138 | | -- `newEventTimeResolutionInMinutes` |
139 | | -- `noOfVisibleDays` |
140 | | -- `nowLineColor` |
141 | | -- `nowLineThickness` |
142 | | -- `overlappingEventGap` |
143 | | -- `pastBackgroundColor` |
144 | | -- `pastWeekendBackgroundColor` |
145 | | -- `scrollDuration` |
146 | | -- `showDistinctPastFutureColor` |
147 | | -- `showDistinctWeekendColor` |
148 | | -- `showFirstDayOfWeekFirst` |
149 | | -- `showNowLine` |
150 | | -- `textSize` |
151 | | -- `timeColumnResolution` |
152 | | -- `todayBackgroundColor` |
153 | | -- `todayHeaderTextColor` |
154 | | -- `verticalFlingEnabled` |
155 | | -- `xScrollingSpeed` |
156 | | -- `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. |
157 | | -- `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. |
158 | | - |
159 | | -Interfaces |
160 | | ----------- |
161 | | - |
162 | | -Use the following interfaces according to your need. |
| 34 | +Getting Started |
| 35 | +--------------- |
163 | 36 |
|
164 | | -- `mWeekView.setWeekViewLoader()` to provide events to the calendar |
165 | | -- `mWeekView.setMonthChangeListener()` to provide events to the calendar by months |
166 | | -- `mWeekView.setOnEventClickListener()` to get a callback when an event is clicked |
167 | | -- `mWeekView.setEventLongPressListener()` to get a callback when an event is long pressed |
168 | | -- `mWeekView.setEmptyViewClickListener()` to get a callback when any empty space is clicked |
169 | | -- `mWeekView.setEmptyViewLongPressListener()` to get a callback when any empty space is long pressed |
170 | | -- `mWeekView.setDateTimeInterpreter()` to set your own labels for the calendar header row and header column |
171 | | -- `mWeekView.setScrollListener()` to get an event every time the first visible day has changed |
172 | | -- `mWeekView.setAddEventClickListener()` to get the start and end time of an event to add |
173 | | -- `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. |
174 | | -- `mWeekView.setDropListener()` to get a callback when a view is dropped at a certain date. |
| 37 | +See the [wiki](https://github.com/Quivr/Android-Week-View/wiki) |
175 | 38 |
|
176 | 39 | Sample |
177 | 40 | ---------- |
178 | 41 |
|
179 | 42 | There is also a [sample app](https://github.com/quivr/Android-Week-View/tree/master/sample) to get you started. |
180 | 43 |
|
181 | | -To do |
182 | | -------- |
183 | | - |
184 | | -* Add event touch feedback selector |
185 | | - |
186 | | -Changelog |
187 | | ---------- |
188 | | -**Version 2.2.2** |
189 | | -* Added `DropListener` and `dropListenerEnabled` |
190 | | -* Added `TextColorPicker` |
191 | | -* Fixed some problems with placement of add event rectangle |
192 | | -* Added `minOverlappingMinutes` |
193 | | - |
194 | | -**Version 2.2.1** |
195 | | -* Small fix on string equality |
196 | | - |
197 | | -**Version 2.2.0** |
198 | | -* IMPORTANT: Prefetching isn't done by the library anymore (see [#42](/../../pull/42)) |
199 | | -* Strings can now be used as Id's of WeekViewEvents |
200 | | - |
201 | | -**Version 2.0.0** |
202 | | -* This fork is first released |
203 | | -* Possibility to set minDate and maxDate |
204 | | -* Allday events are supported |
205 | | -* Events can be add by clicking on empty space |
206 | | - |
207 | | -**Version 1.2.6** |
208 | | - |
209 | | -* Add empty view click listener |
210 | | -* Fix padding bug |
211 | | -* Fix bug when setting colors of different components |
212 | | -* Add ability to turn off fling gesture |
213 | | -* Add example of how to load events asynchronously in the sample app |
214 | | - |
215 | | -**Version 1.2.5** |
216 | | - |
217 | | -* Add support for using subclasses of `WeekViewEvent` |
218 | | -* Fix scroll animation |
219 | | -* Add support for semi-transparent header colors |
220 | | - |
221 | | -**Version 1.2.4** |
222 | | - |
223 | | -* **NOTE:** If you are using `WeekView.MonthChangeListener`, make sure to change it into `MonthLoader.MonthChangeListener` |
224 | | -* Add support to have loaders other than MonthViewLoader |
225 | | -* Add pinch to zoom support |
226 | | -* Add support for location |
227 | | -* Add ability to have different colors for past, future, weekend days |
228 | | -* Add support for "now" line |
229 | | - |
230 | | -**Version 1.2.3** |
231 | | - |
232 | | -* Get callbacks when scrolling horizontally |
233 | | -* `goToHour` and `goToDate` methods has been fixed |
234 | | -* Use `getFirstVisibleHour` method to get the first visible hour in the week view |
235 | | - |
236 | | -**Version 1.2.1** |
237 | | - |
238 | | -* Better scrolling added |
239 | | -* Get callbacks when empty view is tapped/long pressed |
240 | | -* Control the speed of scrolling |
241 | | -* Support for multiple language added |
242 | | -* Ability to set your own interpreter for header row and column added |
243 | | - |
244 | | -**Version 1.1.7** |
245 | | - |
246 | | -* You can now dynamically scroll to an hour of your preference. |
247 | | - |
248 | | -**Version 1.1.6** |
249 | | - |
250 | | -* Added support for events that expands to multiple days |
251 | | - |
252 | | -**Version 1.1.5** |
253 | | - |
254 | | -* A bug related to overlapping events fixed |
255 | | -* You can now programmatically get first and last visible day in the week view |
256 | | - |
257 | | -**Version 1.1.4** |
258 | | - |
259 | | -* Small bug fixed |
260 | | - |
261 | | -**Version 1.1.3** |
262 | | - |
263 | | -* Margins support added for overlapping events |
264 | | - |
265 | | -**Version 1.1.2** |
266 | | - |
267 | | -* Small bugs fixed |
268 | | -* Hour separator inconsistency fixed |
269 | | - |
270 | | -**Version 1.1.1** |
271 | | - |
272 | | -* Overlapping event bug fixed |
273 | | - |
274 | | -**Version 1.1.0** |
275 | | - |
276 | | -* Added support for overlapping events |
277 | 44 |
|
278 | 45 | License |
279 | 46 | ---------- |
|
0 commit comments