#52 Move drawer to toolbar

This commit is contained in:
Tibo De Peuter 2023-04-12 15:08:26 +02:00
parent 85e1b55507
commit 307f9e0d70
7 changed files with 88 additions and 51 deletions

View file

@ -1,7 +1,6 @@
package be.ugent.sel.studeez
import android.content.res.Resources
import androidx.compose.material.DrawerState
import androidx.compose.material.ScaffoldState
import androidx.compose.runtime.Stable
import androidx.navigation.NavHostController
@ -14,14 +13,11 @@ import kotlinx.coroutines.launch
@Stable
class StudeezAppstate(
val scaffoldState: ScaffoldState,
val drawerState: DrawerState,
val navController: NavHostController,
private val snackbarManager: SnackbarManager,
private val resources: Resources,
coroutineScope: CoroutineScope
) {
val coroutineScope: CoroutineScope = coroutineScope
init {
coroutineScope.launch {
snackbarManager.snackbarMessages.filterNotNull().collect { snackbarMessage ->
@ -52,8 +48,4 @@ class StudeezAppstate(
popUpTo(0) { inclusive = true }
}
}
fun openDrawer() {
coroutineScope.launch { drawerState.open() }
}
}