From 75405a1413d19f957dbdea1cd93c1f27ea52d07e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 4 Dec 2016 14:58:13 +0100 Subject: [PATCH] make sure the dialogs are cancelable by clicking outside --- .../com/simplemobiletools/filemanager/dialogs/CopyDialog.kt | 1 + .../simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt | 1 + .../simplemobiletools/filemanager/dialogs/RenameItemDialog.kt | 1 + 3 files changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt index fb527c6f..2011aef7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CopyDialog.kt @@ -46,6 +46,7 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList, val c .setNegativeButton(R.string.cancel, null) .create().apply { window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) + setCanceledOnTouchOutside(true) show() getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({ if (destinationPath == context.resources.getString(R.string.select_destination) || destinationPath.isEmpty()) { diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt index f93be107..bd6bac0c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/CreateNewItemDialog.kt @@ -23,6 +23,7 @@ class CreateNewItemDialog(val context: Context, val path: String, val listener: .setNegativeButton(R.string.cancel, null) .create().apply { window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) + setCanceledOnTouchOutside(true) show() getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(View.OnClickListener { val name = view.item_name.value diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/RenameItemDialog.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/RenameItemDialog.kt index 06ba8115..0d62a9e5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/RenameItemDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/dialogs/RenameItemDialog.kt @@ -26,6 +26,7 @@ class RenameItemDialog(val context: Context, val item: FileDirItem, val listener .setNegativeButton(R.string.cancel, null) .create().apply { window!!.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE) + setCanceledOnTouchOutside(true) show() getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({ val newName = view.item_name.value