Skip to content

Commit

Permalink
Fix file picker dialog
Browse files Browse the repository at this point in the history
# Conflicts:
#	server/xefMobile/composeApp/src/androidMain/kotlin/com/xef/xefMobile/ui/composable/FilePickerDialog.kt
  • Loading branch information
JoseP3r32 committed May 27, 2024
1 parent bc3ecfd commit 12cd598
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.xef.xefMobile.ui.composable

import android.Manifest
import android.os.Build
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.clickable
Expand Down Expand Up @@ -35,8 +37,13 @@ fun FilePickerDialog(
val state = viewModel.state
val context = LocalContext.current

val permissionState =
rememberPermissionState(permission = android.Manifest.permission.READ_EXTERNAL_STORAGE)
val permissionState = rememberPermissionState(
permission = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
Manifest.permission.READ_MEDIA_IMAGES
} else {
Manifest.permission.READ_EXTERNAL_STORAGE
}
)

var selectedFile by remember { mutableStateOf<String?>(null) }

Expand Down

0 comments on commit 12cd598

Please sign in to comment.