From dab7102e61faec621e6ba7b44b5c7f2d1806815d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Apr 2017 09:52:43 +0200 Subject: [PATCH] check if the opened file is a proper type --- .../com/simplemobiletools/draw/activities/MainActivity.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt index ef4fa25..3b8e8a5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/activities/MainActivity.kt @@ -108,7 +108,13 @@ class MainActivity : SimpleActivity(), MyCanvas.PathsChangedListener { private fun openFile() { FilePickerDialog(this, curPath) { + if (it.endsWith(".svg")) { + } else if (File(it).isImageSlow()) { + + } else { + toast(R.string.invalid_file_format) + } } }