Detect mime type when picking a file
The file picker will now try to detect the mime type of the selected file. If it cannot be detected, it will fallback to `application/octet-stream`.
This commit is contained in:
committed by
Benoit Marty
parent
943bbee131
commit
ebbcdc7478
@@ -30,8 +30,8 @@ class FakePickerProvider : PickerProvider {
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun registerFilePicker(mimeType: String, onResult: (Uri?) -> Unit): PickerLauncher<String, Uri?> {
|
||||
return NoOpPickerLauncher { onResult(result) }
|
||||
override fun registerFilePicker(mimeType: String, onResult: (Uri?, String?) -> Unit): PickerLauncher<String, Uri?> {
|
||||
return NoOpPickerLauncher { onResult(result, this.mimeType) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user