mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-06-05 21:59:17 +02:00
improve file opening + allow opening GIFs
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user