From 64d4c30a33d8fcf974276dbe5582ee3f6e285d52 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 8 Apr 2017 23:58:09 +0200 Subject: [PATCH] rescan svg file afer creation --- app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt | 5 ----- .../com/simplemobiletools/draw/dialogs/SaveImageDialog.kt | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt b/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt index 0125f32..2919465 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/Svg.kt @@ -8,7 +8,6 @@ import java.io.* import java.util.* object Svg { - @Throws(Exception::class) fun saveSvg(output: File, canvas: MyCanvas) { val backgroundColor = (canvas.background as ColorDrawable).color @@ -18,7 +17,6 @@ object Svg { writer.close() } - @Throws(IOException::class) private fun writeSvg(writer: Writer, backgroundColor: Int, paths: Map, width: Int, height: Int) { writer.write("") } - @Throws(IOException::class) private fun writePath(writer: Writer, path: MyPath, options: PaintOptions) { writer.write("") } - @Throws(Exception::class) fun loadSvg(file: File, canvas: MyCanvas) { val svg = parseSvg(file) @@ -72,7 +68,6 @@ object Svg { } } - @Throws(Exception::class) private fun parseSvg(file: File): SSvg { var inputStream: InputStream? = null val svg = SSvg() diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt b/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt index 52eebfa..0f3c0d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt @@ -80,7 +80,6 @@ class SaveImageDialog(val activity: SimpleActivity, val curPath: String, val can try { out = FileOutputStream(file) canvas.getBitmap().compress(Bitmap.CompressFormat.PNG, 100, out) - activity.scanFile(file) {} } catch (e: Exception) { return false } finally { @@ -89,6 +88,7 @@ class SaveImageDialog(val activity: SimpleActivity, val curPath: String, val can } SVG -> Svg.saveSvg(file, canvas) } + activity.scanFile(file) {} return true } }