Glimpse: Set extra mime types in shareIntent()

Change-Id: I5b86fbc788dc5fb1da073a500868ac2e3683ad65
This commit is contained in:
Luca Stefani 2023-08-08 08:58:12 +02:00 committed by Sebastiano Barezzi
parent 020ea47a06
commit 50b56e82b8
1 changed files with 4 additions and 1 deletions

View File

@ -19,7 +19,10 @@ fun Intent.shareIntent(vararg medias: Media) = apply {
type = when {
medias.all { it.mediaType == IMAGE } -> "image/*"
medias.all { it.mediaType == VIDEO } -> "video/*"
else -> "*/*"
else -> {
putExtra(Intent.EXTRA_MIME_TYPES, arrayOf("image/*", "video/*"))
"*/*"
}
}
flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
}