editing renameItemDialog style so its not that indented

This commit is contained in:
tibbi 2016-11-17 17:06:19 +01:00
parent 0d583c4f32
commit f4f2adde24
1 changed files with 20 additions and 19 deletions

View File

@ -27,7 +27,11 @@ class RenameItemDialog(val context: Context, val path: String, val item: FileDir
show() show()
getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({ getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener({
val newName = view.item_name.value val newName = view.item_name.value
if (newName.isAValidFilename()) { if (!newName.isAValidFilename()) {
context.toast(R.string.invalid_name)
return@setOnClickListener
}
val currFile = File(path, item.name) val currFile = File(path, item.name)
val newFile = File(path, newName) val newFile = File(path, newName)
@ -50,9 +54,6 @@ class RenameItemDialog(val context: Context, val path: String, val item: FileDir
context.toast(R.string.error_occurred) context.toast(R.string.error_occurred)
} }
} }
} else {
context.toast(R.string.invalid_name)
}
}) })
} }
} }