From 37b96992763317fd5e61909fcec4a97ca05a8a40 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 15 Aug 2021 23:25:37 +0200 Subject: [PATCH] a bit more code shortening --- .../filemanager/pro/activities/ReadTextActivity.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/ReadTextActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/ReadTextActivity.kt index ef0d2d9e..7b2eb97d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/ReadTextActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/ReadTextActivity.kt @@ -100,9 +100,7 @@ class ReadTextActivity : SimpleActivity() { override fun onBackPressed() { val hasUnsavedChanges = originalText != read_text_view.text.toString() when { - isSearchActive -> { - closeSearch() - } + isSearchActive -> closeSearch() hasUnsavedChanges && System.currentTimeMillis() - lastSavePromptTS > SAVE_DISCARD_PROMPT_INTERVAL -> { lastSavePromptTS = System.currentTimeMillis() ConfirmationAdvancedDialog(this, "", R.string.save_before_closing, R.string.save, R.string.discard) { @@ -113,9 +111,7 @@ class ReadTextActivity : SimpleActivity() { } } } - else -> { - super.onBackPressed() - } + else -> super.onBackPressed() } }