Moved the fetching task to a separate activity; changed the time attributes in StudIPEvent.kt to strings

This commit is contained in:
denizk0461
2023-04-12 18:58:10 +02:00
parent 4f78eb8373
commit d55a304cec
11 changed files with 131 additions and 29 deletions
@@ -11,14 +11,14 @@ data class StudIPEvent(
val lecturer: String, // the lecturer(s)
val room: String, // the room the event takes place in
val day: Int, // 0 = Monday, 1 = Tuesday, 2 = Wednesday, 3 = Thursday, 4 = Friday
val timeslotStart: Int, // 1 = 08:15, 2 = 10:15, 3 = 12:15, 4 = 14:15, 5 = 16:15, 6 = 18:15
val timeslotEnd: Int, // 1 = 09:45 etc.
val timeslotStart: String, // the time the course starts
val timeslotEnd: String, // the time the course ends
) {
@Ignore private val timeSlotStartTimes: List<String> = listOf("06:15", "08:15", "10:15", "12:15", "14:15", "16:15", "18:15", "20:15")
@Ignore private val timeSlotEndTimes: List<String> = listOf("07:45", "09:45", "11:45", "13:45", "15:45", "17:45", "19:45", "21:45")
// @Ignore private val timeSlotStartTimes: List<String> = listOf("06:15", "08:15", "10:15", "12:15", "14:15", "16:15", "18:15", "20:15")
// @Ignore private val timeSlotEndTimes: List<String> = listOf("07:45", "09:45", "11:45", "13:45", "15:45", "17:45", "19:45", "21:45")
fun timeslot(): String = "${timeSlotStartTimes[timeslotStart]} ${timeSlotEndTimes[timeslotEnd]}"
fun timeslot(): String = "$timeslotStart $timeslotEnd"
override fun equals(other: Any?): Boolean {
if (this === other) return true
@@ -37,10 +37,8 @@ data class StudIPEvent(
result = 31 * result + lecturer.hashCode()
result = 31 * result + room.hashCode()
result = 31 * result + day
result = 31 * result + timeslotStart
result = 31 * result + timeslotEnd
result = 31 * result + timeSlotStartTimes.hashCode()
result = 31 * result + timeSlotEndTimes.hashCode()
result = 31 * result + timeslotStart.hashCode()
result = 31 * result + timeslotEnd.hashCode()
return result
}
}