nieuwe SessionScreen.kt UI werkt met studystate en alle timer types
This commit is contained in:
		
							parent
							
								
									9d2c53d4e6
								
							
						
					
					
						commit
						3a68712cd9
					
				
					 6 changed files with 17 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -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
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -6,6 +6,10 @@ class FunctionalEndlessTimer() : FunctionalTimer(0) {
 | 
			
		|||
        return false
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun hasCurrentCountdownEnded(): Boolean {
 | 
			
		||||
        return false
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun tick() {
 | 
			
		||||
        time.plusOne()
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,4 +31,8 @@ class FunctionalPomodoroTimer(
 | 
			
		|||
    override fun hasEnded(): Boolean {
 | 
			
		||||
        return breaksRemaining == 0 && time.time == 0
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun hasCurrentCountdownEnded(): Boolean {
 | 
			
		||||
        return time.time == 0
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue