make sure the dialogs are cancelable by clicking outside

This commit is contained in:
tibbi 2016-12-04 14:58:13 +01:00
parent ecf4d9ee95
commit 75405a1413
3 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,7 @@ class CopyDialog(val activity: SimpleActivity, val files: ArrayList<File>, 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()) {

View File

@ -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

View File

@ -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