@@ -2,11 +2,8 @@ package com.alamkanak.weekview
2
2
3
3
import android.graphics.Shader
4
4
import android.support.annotation.ColorInt
5
-
6
- import java.util.ArrayList
7
- import java.util.Calendar
8
-
9
5
import com.alamkanak.weekview.WeekViewUtil.isSameDay
6
+ import java.util.*
10
7
11
8
/* *
12
9
* Created by Raquib-ul-Alam Kanak on 7/21/2014.
@@ -26,15 +23,13 @@ class WeekViewEvent {
26
23
27
24
var id: Long
28
25
@Deprecated(" " )
29
- get() = java.lang.Long .parseLong(identifier!! )
26
+ get() = java.lang.Long .parseLong(identifier)
30
27
@Deprecated(" " )
31
28
set(id) {
32
29
this .identifier = id.toString()
33
30
}
34
31
35
- constructor () {
36
-
37
- }
32
+ constructor ()
38
33
39
34
/* *
40
35
* Initializes the event for week view.
@@ -103,7 +98,7 @@ class WeekViewEvent {
103
98
* @param allDay Is the event an all day event.
104
99
* @param shader the Shader of the event rectangle
105
100
*/
106
- @JvmOverloads constructor (id: String , name: String , location: String? , startTime: Calendar , endTime: Calendar , allDay: Boolean = false , shader: Shader ? = null ) {
101
+ @JvmOverloads constructor (id: String , name: String? , location: String? , startTime: Calendar , endTime: Calendar , allDay: Boolean = false , shader: Shader ? = null ) {
107
102
this .identifier = id
108
103
this .name = name
109
104
this .location = location
@@ -150,11 +145,11 @@ class WeekViewEvent {
150
145
constructor (id: Long , name: String , startTime: Calendar , endTime: Calendar ) : this (id, name, null , startTime, endTime) {
151
146
}
152
147
153
- override fun equals (o : Any? ): Boolean {
154
- if (this == = o ) return true
155
- if (o == null || javaClass != o .javaClass) return false
148
+ override fun equals (other : Any? ): Boolean {
149
+ if (this == = other ) return true
150
+ if (other == null || javaClass != other .javaClass) return false
156
151
157
- val that = o as WeekViewEvent ?
152
+ val that = other as WeekViewEvent ?
158
153
159
154
return identifier == that!! .identifier
160
155
}
@@ -173,7 +168,7 @@ class WeekViewEvent {
173
168
endTime = this .startTime!! .clone() as Calendar
174
169
endTime.set(Calendar .HOUR_OF_DAY , 23 )
175
170
endTime.set(Calendar .MINUTE , 59 )
176
- val event1 = WeekViewEvent (this .identifier, this .name, this .location, this .startTime, endTime, this .isAllDay)
171
+ val event1 = WeekViewEvent (this .identifier!! , this .name, this .location, this .startTime!! , endTime, this .isAllDay)
177
172
event1.color = this .color
178
173
events.add(event1)
179
174
@@ -187,7 +182,7 @@ class WeekViewEvent {
187
182
val endOfOverDay = overDay.clone() as Calendar
188
183
endOfOverDay.set(Calendar .HOUR_OF_DAY , 23 )
189
184
endOfOverDay.set(Calendar .MINUTE , 59 )
190
- val eventMore = WeekViewEvent (this .identifier, this .name, null , overDay, endOfOverDay, this .isAllDay)
185
+ val eventMore = WeekViewEvent (this .identifier!! , this .name, null , overDay, endOfOverDay, this .isAllDay)
191
186
eventMore.color = this .color
192
187
events.add(eventMore)
193
188
@@ -199,7 +194,7 @@ class WeekViewEvent {
199
194
val startTime = this .endTime!! .clone() as Calendar
200
195
startTime.set(Calendar .HOUR_OF_DAY , 0 )
201
196
startTime.set(Calendar .MINUTE , 0 )
202
- val event2 = WeekViewEvent (this .identifier, this .name, this .location, startTime, this .endTime, this .isAllDay)
197
+ val event2 = WeekViewEvent (this .identifier!! , this .name, this .location, startTime, this .endTime!! , this .isAllDay)
203
198
event2.color = this .color
204
199
events.add(event2)
205
200
} else {
@@ -209,41 +204,3 @@ class WeekViewEvent {
209
204
return events
210
205
}
211
206
}
212
- /* *
213
- * Initializes the event for week view.
214
- *
215
- * @param id The id of the event as String.
216
- * @param name Name of the event.
217
- * @param location The location of the event.
218
- * @param startTime The time when the event starts.
219
- * @param endTime The time when the event ends.
220
- * @param allDay Is the event an all day event
221
- */
222
- /* *
223
- * Initializes the event for week view.
224
- *
225
- * @param id The id of the event.
226
- * @param name Name of the event.
227
- * @param location The location of the event.
228
- * @param startTime The time when the event starts.
229
- * @param endTime The time when the event ends.
230
- * @param allDay Is the event an all day event
231
- */
232
- /* *
233
- * Initializes the event for week view.
234
- *
235
- * @param id The id of the event as String.
236
- * @param name Name of the event.
237
- * @param location The location of the event.
238
- * @param startTime The time when the event starts.
239
- * @param endTime The time when the event ends.
240
- */
241
- /* *
242
- * Initializes the event for week view.
243
- *
244
- * @param id The id of the event.
245
- * @param name Name of the event.
246
- * @param location The location of the event.
247
- * @param startTime The time when the event starts.
248
- * @param endTime The time when the event ends.
249
- */
0 commit comments