Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoobergs committed Mar 10, 2018
2 parents 972fb7a + 275ee3d commit bf42607
Showing 1 changed file with 6 additions and 239 deletions.
245 changes: 6 additions & 239 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[Join our slack](https://join.slack.com/t/androidweekview/shared_invite/enQtMzEyMDE3NzU3NTM3LWQyZGRhNjRlMTUzNzNlNjNlM2M0OTMyMDhjMzE1NDMzOGQzYzhjNzI2YjZhZWM3MzJiY2I1YmY2NGEwOTlkNTY)


Android Week View
=================

Expand Down Expand Up @@ -28,252 +31,16 @@ Who uses it
* [Unicaen Timetable](https://play.google.com/store/apps/details?id=fr.skyost.timetable)
* Using the library? Just make an issue

Usage
---------

1. Import the library into your project.
* Grab via maven

```xml
<dependency>
<groupId>com.github.quivr</groupId>
<artifactId>android-week-view</artifactId>
<version>2.2.2</version>
<type>aar</type>
</dependency>
```
* Grab via gradle

```groovy
compile 'com.github.quivr:android-week-view:2.2.2'
```
2. Add WeekView in your xml layout.

```xml
<com.alamkanak.weekview.WeekView
android:id="@+id/weekView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:eventTextColor="@android:color/white"
app:textSize="12sp"
app:hourHeight="60dp"
app:headerColumnPadding="8dp"
app:headerColumnTextColor="#8f000000"
app:headerRowPadding="12dp"
app:columnGap="8dp"
app:noOfVisibleDays="3"
app:headerRowBackgroundColor="#ffefefef"
app:dayBackgroundColor="#05000000"
app:todayBackgroundColor="#1848adff"
app:headerColumnBackground="#ffffffff"/>
```
3. Write the following code in your java file.

```java
// Get a reference for the week view in the layout.
mWeekView = (WeekView) findViewById(R.id.weekView);

// Set an action when any event is clicked.
mWeekView.setOnEventClickListener(mEventClickListener);

// The week view has infinite scrolling horizontally. We have to provide the events of a
// month every time the month changes on the week view.
mWeekView.setMonthChangeListener(mMonthChangeListener);

// Set long press listener for events.
mWeekView.setEventLongPressListener(mEventLongPressListener);
```
4. Implement `WeekView.MonthChangeListener`, `WeekView.EventClickListener`, `WeekView.EventLongPressListener` according to your need.

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.

```java
MonthLoader.MonthChangeListener mMonthChangeListener = new MonthLoader.MonthChangeListener() {
@Override
public List<WeekViewEvent> onMonthChange(int newYear, int newMonth) {
// Populate the week view with some events.
List<WeekViewEvent> events = getEvents(newYear, newMonth);
return events;
}
};
```

Customization
-------------------

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.

- `allDayEventHeight`
- `autoLimitTime`
- `columnGap`
- `dayBackgroundColor`
- `dayNameLength`
- `dropListenerEnabled`: Whether items can be dropped on the weekview
- `eventCornerRadius`
- `eventMarginVertical`
- `eventPadding`
- `eventTextColor`
- `eventTextSize`
- `firstDayOfWeek`
- `futureBackgroundColor`
- `futureWeekendBackgroundColor`
- `headerColumnBackground`
- `headerColumnPadding`
- `headerColumnTextColor`
- `headerRowBackgroundColor`
- `headerRowPadding`
- `horizontalFlingEnabled`
- `hourHeight`
- `hourSeparatorColor`
- `hourSeparatorHeight`
- `maxHourHeight`
- `maxTime`
- `minHourHeight`
- `minTime`
- `minOverlappingMinutes`: The minimal amount of overlap of 2 events needed to be seen as overlapping events
- `newEventColor`
- `newEventId`
- `newEventIconResource`
- `newEventLengthInMinutes`
- `newEventTimeResolutionInMinutes`
- `noOfVisibleDays`
- `nowLineColor`
- `nowLineThickness`
- `overlappingEventGap`
- `pastBackgroundColor`
- `pastWeekendBackgroundColor`
- `scrollDuration`
- `showDistinctPastFutureColor`
- `showDistinctWeekendColor`
- `showFirstDayOfWeekFirst`
- `showNowLine`
- `textSize`
- `timeColumnResolution`
- `todayBackgroundColor`
- `todayHeaderTextColor`
- `verticalFlingEnabled`
- `xScrollingSpeed`
- `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.
- `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.

Interfaces
----------

Use the following interfaces according to your need.
Getting Started
---------------

- `mWeekView.setWeekViewLoader()` to provide events to the calendar
- `mWeekView.setMonthChangeListener()` to provide events to the calendar by months
- `mWeekView.setOnEventClickListener()` to get a callback when an event is clicked
- `mWeekView.setEventLongPressListener()` to get a callback when an event is long pressed
- `mWeekView.setEmptyViewClickListener()` to get a callback when any empty space is clicked
- `mWeekView.setEmptyViewLongPressListener()` to get a callback when any empty space is long pressed
- `mWeekView.setDateTimeInterpreter()` to set your own labels for the calendar header row and header column
- `mWeekView.setScrollListener()` to get an event every time the first visible day has changed
- `mWeekView.setAddEventClickListener()` to get the start and end time of an event to add
- `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.
- `mWeekView.setDropListener()` to get a callback when a view is dropped at a certain date.
See the [wiki](https://github.com/Quivr/Android-Week-View/wiki)

Sample
----------

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

To do
-------

* Add event touch feedback selector

Changelog
---------
**Version 2.2.2**
* Added `DropListener` and `dropListenerEnabled`
* Added `TextColorPicker`
* Fixed some problems with placement of add event rectangle
* Added `minOverlappingMinutes`

**Version 2.2.1**
* Small fix on string equality

**Version 2.2.0**
* IMPORTANT: Prefetching isn't done by the library anymore (see [#42](/../../pull/42))
* Strings can now be used as Id's of WeekViewEvents

**Version 2.0.0**
* This fork is first released
* Possibility to set minDate and maxDate
* Allday events are supported
* Events can be add by clicking on empty space

**Version 1.2.6**

* Add empty view click listener
* Fix padding bug
* Fix bug when setting colors of different components
* Add ability to turn off fling gesture
* Add example of how to load events asynchronously in the sample app

**Version 1.2.5**

* Add support for using subclasses of `WeekViewEvent`
* Fix scroll animation
* Add support for semi-transparent header colors

**Version 1.2.4**

* **NOTE:** If you are using `WeekView.MonthChangeListener`, make sure to change it into `MonthLoader.MonthChangeListener`
* Add support to have loaders other than MonthViewLoader
* Add pinch to zoom support
* Add support for location
* Add ability to have different colors for past, future, weekend days
* Add support for "now" line

**Version 1.2.3**

* Get callbacks when scrolling horizontally
* `goToHour` and `goToDate` methods has been fixed
* Use `getFirstVisibleHour` method to get the first visible hour in the week view

**Version 1.2.1**

* Better scrolling added
* Get callbacks when empty view is tapped/long pressed
* Control the speed of scrolling
* Support for multiple language added
* Ability to set your own interpreter for header row and column added

**Version 1.1.7**

* You can now dynamically scroll to an hour of your preference.

**Version 1.1.6**

* Added support for events that expands to multiple days

**Version 1.1.5**

* A bug related to overlapping events fixed
* You can now programmatically get first and last visible day in the week view

**Version 1.1.4**

* Small bug fixed

**Version 1.1.3**

* Margins support added for overlapping events

**Version 1.1.2**

* Small bugs fixed
* Hour separator inconsistency fixed

**Version 1.1.1**

* Overlapping event bug fixed

**Version 1.1.0**

* Added support for overlapping events

License
----------
Expand Down

0 comments on commit bf42607

Please sign in to comment.