Preserve behaviour pre-fix(i.e if a user opened the drawer and landscaped by choice).

pull/547/head
KotlinGeekDev 2023-08-11 23:32:27 +01:00
rodzic 6875fdc4d0
commit d921eb6138
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -77,8 +77,9 @@ fun MainScreen(
val navState = navController.currentBackStackEntryAsState()
val orientation = LocalConfiguration.current.orientation
val currentDrawerState = scaffoldState.drawerState.currentValue
LaunchedEffect(key1 = orientation) {
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
if (orientation == Configuration.ORIENTATION_LANDSCAPE && currentDrawerState == DrawerValue.Closed) {
scaffoldState.drawerState.close()
}
}