From 64fa74f6cd0e56afdacc8522f17002da700685d1 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 26 May 2017 09:30:14 +0200 Subject: [PATCH] remove some explicit thread creations for toasts --- .../com/simplemobiletools/gallery/activities/EditActivity.kt | 5 +---- .../simplemobiletools/gallery/activities/MediaActivity.kt | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 342699774..d9dfdf39e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -155,10 +155,7 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener private fun scanFinalPath(path: String) { scanPath(path) { setResult(Activity.RESULT_OK, intent) - runOnUiThread { - toast(R.string.file_saved) - } - + toast(R.string.file_saved) finish() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index 804624b06..f76074a7a 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -408,9 +408,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { val filtered = files.filter { it.exists() && it.isImageVideoGif() } as ArrayList deleteFiles(filtered) { if (!it) { - runOnUiThread { - toast(R.string.unknown_error_occurred) - } + toast(R.string.unknown_error_occurred) } else if (mMedia.isEmpty()) { finish() }