Skip to content

Commit 9f9b25b

Browse files
committed
Some clean ups added
1 parent d02ed17 commit 9f9b25b

File tree

4 files changed

+29
-8
lines changed

4 files changed

+29
-8
lines changed

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ Usage
3131
<dependency>
3232
<groupId>com.github.alamkanak</groupId>
3333
<artifactId>android-week-view</artifactId>
34-
<version>1.1.7</version>
34+
<version>1.2.1</version>
3535
<type>aar</type>
3636
</dependency>
3737
```
3838
* Grab via gradle
3939

4040
```groovy
41-
compile 'com.github.alamkanak:android-week-view:1.1.7'
41+
compile 'com.github.alamkanak:android-week-view:1.2.1'
4242
```
4343
2. Add WeekView in your xml layout.
4444

@@ -78,7 +78,7 @@ Usage
7878
```
7979
4. Implement `WeekView.MonthChangeListener`, `WeekView.EventClickListener`, `WeekView.EventLongPressListener` according to your need.
8080

81-
5. Provide the events for the `WeekView` in `WeekView.MonthChangeListener.onMonthChange()` callback. Please remember that the calendar preloads events of three consecutive months to enable lag-free scrolling.
81+
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.
8282

8383
```java
8484
WeekView.MonthChangeListener mMonthChangeListener = new WeekView.MonthChangeListener() {
@@ -118,6 +118,18 @@ You can customize the look of the `WeekView` in xml. Use the following attribute
118118
- `todayBackgroundColor`
119119
- `todayHeaderTextColor`
120120

121+
Interfaces
122+
----------
123+
124+
Use the following interfaces according to your need.
125+
126+
- `mWeekView.setMonthChangeListener()` to provide events to the calendar
127+
- `mWeekView.setOnEventClickListener()` to get a callback when an event is clicked
128+
- `mWeekView.setEventLongPressListener()` to get a callback when an event is long pressed
129+
- `mWeekView.setEmptyViewClickListener()` to get a callback when any empty space is clicked
130+
- `mWeekView.setEmptyViewLongPressListener()` to get a callback when any empty space is long pressed
131+
- `mWeekView.setDateTimeInterpreter()` to set your own labels for the calendar header row and header column
132+
121133
Sample
122134
----------
123135

@@ -132,6 +144,14 @@ To do
132144
Changelog
133145
---------
134146

147+
**Version 1.2.1**
148+
149+
* Better scrolling added
150+
* Get callbacks when empty view is tapped/long pressed
151+
* Control the speed of scrolling
152+
* Support for multiple language added
153+
* Ability to set your own interpreter for header row and column added
154+
135155
**Version 1.1.7**
136156

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

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
VERSION_NAME=1.1.7
1+
VERSION_NAME=1.2.1
22
GROUP=com.github.alamkanak
33

4-
POM_DESCRIPTION=Dissect layout traversals on Android.
4+
POM_DESCRIPTION=An android library to show day view, week view, 3 day view etc. in your app.
55
POM_URL=https://github.com/alamkanak/Android-Week-View
66
POM_SCM_URL=https://github.com/alamkanak/Android-Week-View
77
POM_SCM_CONNECTION=scm:[email protected]/alamkanak/Android-Week-View.git

library/src/main/java/com/alamkanak/weekview/WeekView.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import android.graphics.Rect;
1010
import android.graphics.RectF;
1111
import android.graphics.Typeface;
12-
import android.support.annotation.NonNull;
1312
import android.support.v4.view.GestureDetectorCompat;
1413
import android.support.v4.view.ViewCompat;
1514
import android.text.Layout;
@@ -956,7 +955,7 @@ public EmptyViewLongPressListener getEmptyViewLongPressListener(){
956955
* Get the interpreter which provides the text to show in the header column and the header row.
957956
* @return The date, time interpreter.
958957
*/
959-
public @NonNull DateTimeInterpreter getDateTimeInterpreter() {
958+
public DateTimeInterpreter getDateTimeInterpreter() {
960959
if (mDateTimeInterpreter == null) {
961960
mDateTimeInterpreter = new DateTimeInterpreter() {
962961
@Override
@@ -1195,7 +1194,7 @@ public void setDefaultEventColor(int defaultEventColor) {
11951194
/**
11961195
* <b>Note:</b> Use {@link #setDateTimeInterpreter(DateTimeInterpreter)} and
11971196
* {@link #getDateTimeInterpreter()} instead.
1198-
* @return
1197+
* @return Either long or short day name is being used.
11991198
*/
12001199
@Deprecated
12011200
public int getDayNameLength() {

library/src/main/java/com/alamkanak/weekview/WeekViewEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public WeekViewEvent(){
1919

2020
/**
2121
* Initializes the event for week view.
22+
* @param id The id of the event.
2223
* @param name Name of the event.
2324
* @param startYear Year when the event starts.
2425
* @param startMonth Month when the event starts.
@@ -53,6 +54,7 @@ public WeekViewEvent(long id, String name, int startYear, int startMonth, int st
5354

5455
/**
5556
* Initializes the event for week view.
57+
* @param id The id of the event.
5658
* @param name Name of the event.
5759
* @param startTime The time when the event starts.
5860
* @param endTime The time when the event ends.

0 commit comments

Comments
 (0)