nieuwe SessionScreen.kt UI werkt met studystate en alle timer types

This commit is contained in:
Rune Dyselinck 2023-04-18 21:22:18 +02:00
parent 9d2c53d4e6
commit 3a68712cd9
6 changed files with 17 additions and 6 deletions

View file

@ -11,6 +11,11 @@ class FunctionalCustomTimer(studyTime: Int) : FunctionalTimer(studyTime) {
}
override fun hasEnded(): Boolean {
return view == StudyState.DONE
}
override fun hasCurrentCountdownEnded(): Boolean {
return time.time == 0
}
}

View file

@ -6,6 +6,10 @@ class FunctionalEndlessTimer() : FunctionalTimer(0) {
return false
}
override fun hasCurrentCountdownEnded(): Boolean {
return false
}
override fun tick() {
time.plusOne()
}

View file

@ -31,4 +31,8 @@ class FunctionalPomodoroTimer(
override fun hasEnded(): Boolean {
return breaksRemaining == 0 && time.time == 0
}
override fun hasCurrentCountdownEnded(): Boolean {
return time.time == 0
}
}

View file

@ -12,9 +12,7 @@ abstract class FunctionalTimer(initialValue: Int) {
abstract fun hasEnded(): Boolean
fun hasCurrentCountdownEnded(): Boolean {
return time.getTime() == 0
}
abstract fun hasCurrentCountdownEnded(): Boolean
enum class StudyState {
FOCUS, DONE, BREAK, FOCUS_REMAINING