Merge pull request #81 from SELab1/sessionscreen_ui

Sessionscreen UI
This commit is contained in:
brreynie 2023-04-18 23:02:09 +02:00 committed by GitHub Enterprise
commit 295f3b730a
7 changed files with 132 additions and 10 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,6 +12,8 @@ abstract class FunctionalTimer(initialValue: Int) {
abstract fun hasEnded(): Boolean
abstract fun hasCurrentCountdownEnded(): Boolean
enum class StudyState {
FOCUS, DONE, BREAK, FOCUS_REMAINING
}