File tree Expand file tree Collapse file tree 3 files changed +24
-3
lines changed
library/src/main/java/com/alamkanak/weekview Expand file tree Collapse file tree 3 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -31,14 +31,14 @@ Usage
31
31
<dependency >
32
32
<groupId >com.github.alamkanak</groupId >
33
33
<artifactId >android-week-view</artifactId >
34
- <version >1.1.6 </version >
34
+ <version >1.1.7 </version >
35
35
<type >aar</type >
36
36
</dependency >
37
37
```
38
38
* Grab via gradle
39
39
40
40
```groovy
41
- compile 'com.github.alamkanak:android-week-view:1.1.6 '
41
+ compile 'com.github.alamkanak:android-week-view:1.1.7 '
42
42
```
43
43
2. Add WeekView in your xml layout.
44
44
@@ -132,6 +132,10 @@ To do
132
132
Changelog
133
133
---------
134
134
135
+ **Version 1.1.7**
136
+
137
+ * You can now dynamically scroll to an hour of your preference.
138
+
135
139
**Version 1.1.6**
136
140
137
141
* Added support for events that expands to multiple days
Original file line number Diff line number Diff line change 1
- VERSION_NAME =1.1.6
1
+ VERSION_NAME =1.1.7
2
2
GROUP =com.github.alamkanak
3
3
4
4
POM_DESCRIPTION =Dissect layout traversals on Android.
Original file line number Diff line number Diff line change @@ -1215,6 +1215,23 @@ public void notifyDatasetChanged(){
1215
1215
invalidate ();
1216
1216
}
1217
1217
1218
+ /**
1219
+ * Vertically scroll to a specific hour in the week view.
1220
+ * @param hour The hour to scroll to in 24-hour format. Supported values are 0-24.
1221
+ */
1222
+ public void goToHour (double hour ){
1223
+ if (hour < 0 )
1224
+ throw new IllegalArgumentException ("Cannot scroll to an hour of negative value." );
1225
+ else if (hour > 24 )
1226
+ throw new IllegalArgumentException ("Cannot scroll to an hour of value greater than 24." );
1227
+ else if (hour * mHourHeight > mHourHeight * 24 - getHeight () + mHeaderTextHeight + mHeaderRowPadding * 2 + mHeaderMarginBottom )
1228
+ throw new IllegalArgumentException ("Cannot scroll to an hour which will result the calendar to go off the screen." );
1229
+
1230
+ int verticalOffset = (int ) (mHourHeight * hour );
1231
+ mCurrentOrigin .y = -verticalOffset ;
1232
+ invalidate ();
1233
+ }
1234
+
1218
1235
1219
1236
1220
1237
/////////////////////////////////////////////////////////////////
You can’t perform that action at this time.
0 commit comments