From 6ed2929dd3ebea881255cb0136e9fe794f19d91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gajda?= Date: Mon, 23 Nov 2015 21:24:46 +0100 Subject: [PATCH] "Cancel" as default text for negativeButton If *Cancel* became default text for negative button it could be omitted. --- dsl/static/src/common/AlertDialogBuilder.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsl/static/src/common/AlertDialogBuilder.kt b/dsl/static/src/common/AlertDialogBuilder.kt index e4471fd2..4f8fa298 100644 --- a/dsl/static/src/common/AlertDialogBuilder.kt +++ b/dsl/static/src/common/AlertDialogBuilder.kt @@ -107,7 +107,7 @@ class AlertDialogBuilder(val ctx: Context) { builder.setPositiveButton(title, { dialog, which -> dialog.f() }) } - fun negativeButton(textResource: Int = android.R.string.ok, f: DialogInterface.() -> Unit = { dismiss() }) { + fun negativeButton(textResource: Int = android.R.string.cancel, f: DialogInterface.() -> Unit = { dismiss() }) { negativeButton(ctx.getString(textResource), f) } @@ -135,4 +135,4 @@ class AlertDialogBuilder(val ctx: Context) { builder.setCursor(cursor, { dialog, which -> f(which) }, labelColumn) } -} \ No newline at end of file +}