#118 subclass of AbstractSessionScreen -> this file
This commit is contained in:
		
							parent
							
								
									6938b3e868
								
							
						
					
					
						commit
						5073e5cb22
					
				
					 3 changed files with 84 additions and 1 deletions
				
			
		|  | @ -1,2 +1,38 @@ | ||||||
| package be.ugent.sel.studeez.screens.session.sessionScreens.composables | package be.ugent.sel.studeez.screens.session.sessionScreens.composables | ||||||
| 
 | 
 | ||||||
|  | import androidx.compose.runtime.Composable | ||||||
|  | import be.ugent.sel.studeez.R | ||||||
|  | import be.ugent.sel.studeez.data.local.models.timer_functional.FunctionalPomodoroTimer | ||||||
|  | import be.ugent.sel.studeez.resources | ||||||
|  | import be.ugent.sel.studeez.screens.session.SessionActions | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | fun BreakSessionScreenComposable( | ||||||
|  |     open: (String) -> Unit, | ||||||
|  |     sessionActions: SessionActions, | ||||||
|  |     pomodoroTimer: FunctionalPomodoroTimer | ||||||
|  | ) { | ||||||
|  |     SessionScreen( | ||||||
|  |         open = open, | ||||||
|  |         sessionActions = sessionActions | ||||||
|  |     ) { | ||||||
|  |         motivationString(pomodoroTimer = pomodoroTimer) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | private fun motivationString(pomodoroTimer: FunctionalPomodoroTimer): String { | ||||||
|  |     if (pomodoroTimer.isInBreak) { | ||||||
|  |         return resources().getString(R.string.state_take_a_break) | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (pomodoroTimer.hasEnded()) { | ||||||
|  |         return resources().getString(R.string.state_done) | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     return resources().getQuantityString( | ||||||
|  |         R.plurals.state_focus_remaining, | ||||||
|  |         pomodoroTimer.breaksRemaining, | ||||||
|  |         pomodoroTimer.breaksRemaining | ||||||
|  |     ) | ||||||
|  | } | ||||||
|  | @ -1,2 +1,29 @@ | ||||||
| package be.ugent.sel.studeez.screens.session.sessionScreens.composables | package be.ugent.sel.studeez.screens.session.sessionScreens.composables | ||||||
| 
 | 
 | ||||||
|  | import androidx.compose.runtime.Composable | ||||||
|  | import be.ugent.sel.studeez.R | ||||||
|  | import be.ugent.sel.studeez.data.local.models.timer_functional.FunctionalCustomTimer | ||||||
|  | import be.ugent.sel.studeez.resources | ||||||
|  | import be.ugent.sel.studeez.screens.session.SessionActions | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | fun CustomTimerSessionScreenComposable( | ||||||
|  |     open: (String) -> Unit, | ||||||
|  |     sessionActions: SessionActions, | ||||||
|  |     customTimer: FunctionalCustomTimer | ||||||
|  | ) { | ||||||
|  |     SessionScreen( | ||||||
|  |         open = open, | ||||||
|  |         sessionActions = sessionActions | ||||||
|  |     ) { | ||||||
|  |         motivationString(customTimer = customTimer) | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | private fun motivationString(customTimer: FunctionalCustomTimer): String { | ||||||
|  |     if (customTimer.hasEnded()) { | ||||||
|  |         return resources().getString(R.string.state_done) | ||||||
|  |     } | ||||||
|  |     return resources().getString(R.string.state_focus) | ||||||
|  | } | ||||||
|  | @ -1,4 +1,24 @@ | ||||||
| package be.ugent.sel.studeez.screens.session.sessionScreens.composables | package be.ugent.sel.studeez.screens.session.sessionScreens.composables | ||||||
| 
 | 
 | ||||||
| class EndlessTimerSessionScreenComposable { | import androidx.compose.runtime.Composable | ||||||
|  | import be.ugent.sel.studeez.R | ||||||
|  | import be.ugent.sel.studeez.resources | ||||||
|  | import be.ugent.sel.studeez.screens.session.SessionActions | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | fun EndlessTimerSessionScreenComposable( | ||||||
|  |     open: (String) -> Unit, | ||||||
|  |     sessionActions: SessionActions, | ||||||
|  | ) { | ||||||
|  |     SessionScreen( | ||||||
|  |         open = open, | ||||||
|  |         sessionActions = sessionActions | ||||||
|  |     ) { | ||||||
|  |         motivationString() | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @Composable | ||||||
|  | private fun motivationString(): String { | ||||||
|  |     return resources().getString(R.string.state_focus) | ||||||
| } | } | ||||||
		Reference in a new issue
	
	 lbarraga
						lbarraga