From 5e1c5d55866f0c164cd6cc73fe6bb11d951c84a4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 13 Mar 2020 11:41:12 +0100 Subject: [PATCH] improve file opening + allow opening GIFs --- .../com/simplemobiletools/draw/pro/activities/MainActivity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt index 7820042..2934530 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/pro/activities/MainActivity.kt @@ -288,7 +288,7 @@ class MainActivity : SimpleActivity(), CanvasListener { private fun openUri(uri: Uri, intent: Intent): Boolean { val mime = MimeTypeMap.getSingleton() - val type = mime.getExtensionFromMimeType(contentResolver.getType(uri)) ?: intent.type + val type = mime.getExtensionFromMimeType(contentResolver.getType(uri)) ?: intent.type ?: contentResolver.getType(uri) return when (type) { "svg", "image/svg+xml" -> { my_canvas.mBackgroundBitmap = null @@ -296,7 +296,7 @@ class MainActivity : SimpleActivity(), CanvasListener { defaultExtension = SVG true } - "jpg", "jpeg", "png" -> { + "jpg", "jpeg", "png", "gif", "image/jpg", "image/png", "image/gif" -> { my_canvas.drawBitmap(this, uri) defaultExtension = JPG true