Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Cancel as default text for negativeButton #112

Merged
merged 1 commit into from
Nov 25, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dsl/static/src/common/AlertDialogBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -135,4 +135,4 @@ class AlertDialogBuilder(val ctx: Context) {
builder.setCursor(cursor, { dialog, which -> f(which) }, labelColumn)
}

}
}