Persist preference for Lock Swiping #26

Merged
wbrawner merged 3 commits from persist-lock-swiping into main 2024-08-22 06:06:08 +00:00
Showing only changes of commit 094ac1fccf - Show all commits

View file

@ -1,5 +1,6 @@
package com.wbrawner.simplemarkdown.ui
import androidx.activity.compose.BackHandler
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
@ -29,6 +30,11 @@ fun MarkdownNavigationDrawer(
) {
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
val coroutineScope = rememberCoroutineScope()
BackHandler(enabled = drawerState.isOpen) {
coroutineScope.launch {
drawerState.close()
}
}
DismissibleNavigationDrawer(
gesturesEnabled = drawerState.isOpen,
drawerState = drawerState,