2
2
[ ![ Build Status] ( https://www.bitrise.io/app/6ba47c24369dd52a/status.svg?token=XyF0AXasZwgKuoub_tJUYA&branch=master )] ( https://www.bitrise.io/app/6ba47c24369dd52a )
3
3
4
4
# Android Week View
5
- Android library for displaying an overview of events for a week like in a schedule(us) or timetable(uk).
6
5
7
- It's the week view initially used in Schedule Deluxe (https://play.google.com/store/apps/details?id=com.tobiasschuerg.stundenplan ),
6
+ Android library for displaying an overview of events for a week
7
+ like in a schedule(us) or timetable(uk).
8
+
9
+ It's the week view initially used in Schedule
10
+ Deluxe (https://play.google.com/store/apps/details?id=com.tobiasschuerg.stundenplan ),
8
11
which is now outsourced in favor of a better modularization.
9
12
10
13
<img src =" https://github.com/tobiasschuerg/android-week-view/blob/master/meta/device-2018-02-24-121341.png " height =" 400 " >
11
14
12
15
## Usage:
16
+
13
17
See ` SampleActivity.kt ` for how to use the week view.
14
18
15
19
### In short:
20
+
16
21
1 . Attach the view to your layout:
22
+
17
23
``` xml
18
- <de .tobiasschuerg.weekview.view.WeekView
19
- android : id =" @+id/week_view"
20
- android : layout_width =" match_parent"
21
- android : layout_height =" wrap_content"
22
- app : accent_color =" @color/colorAccent"
23
- app : start_hour =" 8"
24
- app : end_hour =" 15" />
24
+
25
+ <de .tobiasschuerg.weekview.view.WeekView android : id =" @+id/week_view"
26
+ android : layout_width =" match_parent" android : layout_height =" wrap_content"
27
+ app : accent_color =" @color/colorAccent" app : start_hour =" 8" app : end_hour =" 15" />
25
28
```
29
+
26
30
2 . Configure how events are displayed (optional):
31
+
27
32
``` kotlin
28
33
val config = EventConfig (showSubtitle = false , showTimeEnd = false )
29
34
weekView.eventConfig = config
30
35
weekView.setShowNowIndicator(true )
31
36
```
32
37
33
38
3Add events:
39
+
34
40
``` kotlin
35
41
val nowEvent = Event .Single (
36
42
id = 1337 ,
@@ -44,10 +50,15 @@ val nowEvent = Event.Single(
44
50
weekView.addEvent(nowEvent)
45
51
```
46
52
53
+ ## Desugaring:
54
+
55
+ Starting from version 1.8.0, Android Week View has switched from JakeWharton's ThreeTen Backport
56
+ to desugaring for ` java.time ` -API.
47
57
48
58
## Get it
49
59
50
60
1 . Add it in your root build.gradle at the end of repositories:
61
+
51
62
``` gradle
52
63
allprojects {
53
64
repositories {
@@ -56,7 +67,9 @@ allprojects {
56
67
}
57
68
}
58
69
```
70
+
59
71
2 . Step 2. Add the dependency
72
+
60
73
``` gradle
61
74
dependencies {
62
75
compile 'com.github.tobiasschuerg:android-week-view:-SNAPSHOT'
0 commit comments