From 9c9e7bec2bff96521e220adc92d7b2db6a55835b Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 17 Apr 2017 18:12:24 +0200 Subject: [PATCH] fix #231, properly handle some more image pick intents --- .../simplemobiletools/gallery/activities/MainActivity.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index 2dc2b02c7..7aa8e0de3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -260,9 +260,11 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun isSetWallpaperIntent(intent: Intent?) = intent?.action == Intent.ACTION_SET_WALLPAPER - private fun hasImageContentData(intent: Intent) = intent.data == MediaStore.Images.Media.EXTERNAL_CONTENT_URI + private fun hasImageContentData(intent: Intent) = (intent.data == MediaStore.Images.Media.EXTERNAL_CONTENT_URI || + intent.data == MediaStore.Images.Media.INTERNAL_CONTENT_URI) - private fun hasVideoContentData(intent: Intent) = intent.data == MediaStore.Video.Media.EXTERNAL_CONTENT_URI + private fun hasVideoContentData(intent: Intent) = (intent.data == MediaStore.Video.Media.EXTERNAL_CONTENT_URI || + intent.data == MediaStore.Video.Media.INTERNAL_CONTENT_URI) private fun isImageType(intent: Intent) = (intent.type?.startsWith("image/") == true || intent.type == MediaStore.Images.Media.CONTENT_TYPE)