Skip to content

Commit

Permalink
[f]: fixed PermissionSheet non expandable after hide
Browse files Browse the repository at this point in the history
  • Loading branch information
BadKiko committed Feb 12, 2024
1 parent d8ef20b commit 5345006
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion kige/src/main/java/com/kiko/kige/ui/components/KigePicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ fun KigePicker(
onSelect
)
} else {
PermissionSheet(rememberKigeState.rememberPermissionState) {
PermissionSheet(
{ rememberKigeState.hide(coroutineScope) },
rememberKigeState.rememberPermissionState
) {
CreateGallerySheet(
coroutineScope,
rememberKigeState.rememberGalleryState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ import androidx.compose.ui.unit.dp
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.isGranted
import com.google.accompanist.permissions.rememberPermissionState
import com.kiko.kige.data.state.KigeState
import com.kiko.kige.data.state.PermissionState
import com.kiko.kige.data.utils.GalleryUtils
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterial3Api::class, ExperimentalPermissionsApi::class)
@Composable
internal fun PermissionSheet(
onHide: () -> Unit,
rememberKigePermissionState: PermissionState,
onGivenPermission: @Composable () -> Unit
) {
Expand All @@ -47,7 +49,10 @@ internal fun PermissionSheet(
if (rememberKigePermissionState.visibleState.value) {
ModalBottomSheet(
sheetState = rememberKigePermissionState.sheetState,
onDismissRequest = { rememberKigePermissionState.hide(coroutineScope) }) {
onDismissRequest = {
onHide()
rememberKigePermissionState.hide(coroutineScope)
}) {
Column(
modifier = Modifier.padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally,
Expand Down

0 comments on commit 5345006

Please sign in to comment.