change name of SelectedTimerRepo to SelectedTimerState
This commit is contained in:
		
							parent
							
								
									b3651bbbe5
								
							
						
					
					
						commit
						d8b95f5d5b
					
				
					 3 changed files with 7 additions and 7 deletions
				
			
		|  | @ -9,6 +9,6 @@ import javax.inject.Singleton | ||||||
|  * Because this is a singleton-class the view-models of both screens observe the same data. |  * Because this is a singleton-class the view-models of both screens observe the same data. | ||||||
|  */ |  */ | ||||||
| @Singleton | @Singleton | ||||||
| class SelectedTimerRepo @Inject constructor(){ | class SelectedTimerState @Inject constructor(){ | ||||||
|     var selectedTimer: FunctionalTimer? = null |     var selectedTimer: FunctionalTimer? = null | ||||||
| } | } | ||||||
|  | @ -3,17 +3,17 @@ package be.ugent.sel.studeez.screens.session | ||||||
| import be.ugent.sel.studeez.data.local.models.timer_functional.FunctionalTimer | import be.ugent.sel.studeez.data.local.models.timer_functional.FunctionalTimer | ||||||
| import be.ugent.sel.studeez.domain.LogService | import be.ugent.sel.studeez.domain.LogService | ||||||
| import be.ugent.sel.studeez.screens.StudeezViewModel | import be.ugent.sel.studeez.screens.StudeezViewModel | ||||||
| import be.ugent.sel.studeez.data.SelectedTimerRepo | import be.ugent.sel.studeez.data.SelectedTimerState | ||||||
| import dagger.hilt.android.lifecycle.HiltViewModel | import dagger.hilt.android.lifecycle.HiltViewModel | ||||||
| import javax.inject.Inject | import javax.inject.Inject | ||||||
| 
 | 
 | ||||||
| @HiltViewModel | @HiltViewModel | ||||||
| class SessionViewModel @Inject constructor( | class SessionViewModel @Inject constructor( | ||||||
|     private val selectedTimerRepo: SelectedTimerRepo, |     private val selectedTimerState: SelectedTimerState, | ||||||
|     logService: LogService |     logService: LogService | ||||||
| ) : StudeezViewModel(logService) { | ) : StudeezViewModel(logService) { | ||||||
| 
 | 
 | ||||||
|     fun getTimer() : FunctionalTimer { |     fun getTimer() : FunctionalTimer { | ||||||
|         return selectedTimerRepo.selectedTimer!! |         return selectedTimerState.selectedTimer!! | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| package be.ugent.sel.studeez.screens.timer_selection | package be.ugent.sel.studeez.screens.timer_selection | ||||||
| 
 | 
 | ||||||
| import be.ugent.sel.studeez.data.SelectedTimerRepo | import be.ugent.sel.studeez.data.SelectedTimerState | ||||||
| import be.ugent.sel.studeez.data.local.models.timer_info.TimerInfo | import be.ugent.sel.studeez.data.local.models.timer_info.TimerInfo | ||||||
| import be.ugent.sel.studeez.domain.LogService | import be.ugent.sel.studeez.domain.LogService | ||||||
| import be.ugent.sel.studeez.domain.TimerDAO | import be.ugent.sel.studeez.domain.TimerDAO | ||||||
|  | @ -13,7 +13,7 @@ import javax.inject.Inject | ||||||
| @HiltViewModel | @HiltViewModel | ||||||
| class TimerSelectionViewModel @Inject constructor( | class TimerSelectionViewModel @Inject constructor( | ||||||
|     private val timerDAO: TimerDAO, |     private val timerDAO: TimerDAO, | ||||||
|     private val selectedTimerRepo: SelectedTimerRepo, |     private val selectedTimerState: SelectedTimerState, | ||||||
|     logService: LogService |     logService: LogService | ||||||
| ) : StudeezViewModel(logService) { | ) : StudeezViewModel(logService) { | ||||||
| 
 | 
 | ||||||
|  | @ -22,7 +22,7 @@ class TimerSelectionViewModel @Inject constructor( | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     fun startSession(open: (String) -> Unit, timerInfo: TimerInfo) { |     fun startSession(open: (String) -> Unit, timerInfo: TimerInfo) { | ||||||
|         selectedTimerRepo.selectedTimer = timerInfo.getFunctionalTimer() |         selectedTimerState.selectedTimer = timerInfo.getFunctionalTimer() | ||||||
|         open(StudeezDestinations.SESSION_SCREEN) |         open(StudeezDestinations.SESSION_SCREEN) | ||||||
|     } |     } | ||||||
| } | } | ||||||
		Reference in a new issue
	
	 Lukas Barragan Torres
						Lukas Barragan Torres