Merge pull request #68 from SELab1/timers

fix issues
This commit is contained in:
lbarraga 2023-04-17 16:02:49 +02:00 committed by GitHub Enterprise
commit 7c0e15cb9d
6 changed files with 11 additions and 12 deletions

View file

@ -116,11 +116,11 @@ fun NavGraphBuilder.studeezGraph(appState: StudeezAppstate) {
}
composable(StudeezDestinations.TIMER_OVERVIEW_SCREEN) {
TimerOverviewScreen(openAndPopUp)
TimerOverviewScreen(open, openAndPopUp)
}
composable(StudeezDestinations.SESSION_SCREEN) {
SessionScreen(openAndPopUp)
SessionScreen(open, openAndPopUp)
}
// TODO Timers screen

View file

@ -22,7 +22,7 @@ fun PrimaryScreenTemplate(
title: String,
open: (String) -> Unit,
openAndPopUp: (String, String) -> Unit,
action: @Composable RowScope.() -> Unit,
action: @Composable RowScope.() -> Unit = {},
content: @Composable (PaddingValues) -> Unit
) {
val scaffoldState: ScaffoldState = rememberScaffoldState()

View file

@ -19,13 +19,8 @@ class DrawerViewModel @Inject constructor(
open(HOME_SCREEN)
}
fun onTimersClick(open: (String) -> Unit) {
// TODO
}
fun onTimersClick(openAndPopup: (String, String) -> Unit) {
// TODO is niet altijd het homescreen
openAndPopup(StudeezDestinations.TIMER_OVERVIEW_SCREEN, StudeezDestinations.HOME_SCREEN)
fun onTimersClick(openAndPopup: (String) -> Unit) {
openAndPopup(StudeezDestinations.TIMER_OVERVIEW_SCREEN)
}
fun onSettingsClick(open: (String) -> Unit) {

View file

@ -15,8 +15,8 @@ class HomeViewModel @Inject constructor(
logService: LogService
) : StudeezViewModel(logService) {
fun onStartSessionClick(openAndPopUp: (String, String) -> Unit) {
openAndPopUp(StudeezDestinations.SESSION_SCREEN, StudeezDestinations.HOME_SCREEN)
fun onStartSessionClick(openAndPopUp: (String) -> Unit) {
openAndPopUp(StudeezDestinations.SESSION_SCREEN)
}
fun onLogoutClick(openAndPopup: (String, String) -> Unit) {

View file

@ -18,11 +18,13 @@ import kotlinx.coroutines.delay
@Composable
fun SessionScreen(
open: (String) -> Unit,
openAndPopUp: (String, String) -> Unit,
viewModel: SessionViewModel = hiltViewModel()
) {
PrimaryScreenTemplate(
title = resources().getString(R.string.start_session),
open = open,
openAndPopUp = openAndPopUp
) {
Timer(viewModel)

View file

@ -27,6 +27,7 @@ import be.ugent.sel.studeez.resources
@Composable
fun TimerOverviewScreen(
open: (String) -> Unit,
openAndPopUp: (String, String) -> Unit,
viewModel: TimerOverviewViewModel = hiltViewModel()
) {
@ -35,6 +36,7 @@ fun TimerOverviewScreen(
PrimaryScreenTemplate(
title = resources().getString(R.string.timers),
open = open,
openAndPopUp = openAndPopUp
) {