#21 further styling subject

This commit is contained in:
brreynie 2023-05-02 21:11:27 +02:00
parent c33aad5496
commit 7ad1047091
7 changed files with 94 additions and 40 deletions

View file

@ -8,6 +8,4 @@ data class Subject(
val tasks: List<Task> = mutableListOf(),
val time: Int = 0,
val argb_color: Long = 0,
) {
// fun getColor(): Color = Color(ARGB_color)
}
)

View file

@ -1,4 +1,17 @@
package be.ugent.sel.studeez.data.local.models.timer_functional
data class HoursMinutesSeconds(val hours: String, val minutes: String, val seconds: String
)
class HoursMinutesSeconds(val hours: Int, val minutes: Int, val seconds: Int) {
constructor(seconds: Int) : this(
hours = seconds / (60 * 60),
minutes = (seconds / 60) % 60,
seconds = seconds % 60,
)
override fun toString(): String {
return hours.toString().padStart(2, '0') +
":" +
minutes.toString().padStart(2, '0') +
":" +
seconds.toString().padStart(2, '0')
}
}

View file

@ -13,15 +13,6 @@ class Time(initialTime: Int) {
}
fun getAsHMS(): HoursMinutesSeconds {
val hours: Int = time / (60 * 60)
val minutes: Int = (time / (60)) % 60
val seconds: Int = time % 60
return HoursMinutesSeconds(
hours.toString().padStart(2, '0'),
minutes.toString().padStart(2, '0'),
seconds.toString().padStart(2, '0')
)
return HoursMinutesSeconds(time)
}
}