Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class NoteTypeFieldEditor : AnkiActivity() {
AlertDialog.Builder(this).show {
customView(view = fieldNameInput, paddingStart = 64, paddingEnd = 64, paddingTop = 32)
title(R.string.model_field_editor_add)
positiveButton(R.string.dialog_ok) {
positiveButton(R.string.menu_add) {
// Name is valid, now field is added
val fieldName = uniqueName(fieldNameInput)
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,20 @@ class CreateDeckDialog(
.Builder(context)
.show {
title(title)
positiveButton(R.string.dialog_ok) { onPositiveButtonClicked() }
// Resource ID for the dialog's positive action button text.
// Uses "Rename" for rename deck dialogs and "Create" for all other deck-related dialogs.
val positiveButtonTextRes =
when (deckDialogType) {
DeckDialogType.RENAME_DECK -> R.string.rename

DeckDialogType.DECK,
DeckDialogType.SUB_DECK,
DeckDialogType.FILTERED_DECK,
-> R.string.dialog_positive_create
}
positiveButton(positiveButtonTextRes) {
onPositiveButtonClicked()
}
negativeButton(R.string.dialog_cancel)
setView(R.layout.dialog_generic_text_input)
}.input(prefill = initialDeckName, displayKeyboard = true, waitForPositiveButton = false) { dialog, text ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class RenameCardTemplateDialog {
.Builder(context)
.show {
title(R.string.rename_card_type)
positiveButton(R.string.dialog_ok) { }
positiveButton(R.string.rename) { }
negativeButton(R.string.dialog_cancel)
setView(R.layout.dialog_generic_text_input)
}.input(
Expand Down
Loading