change the way new note types are determined, to a radio button

This commit is contained in:
tibbi
2018-12-09 10:00:06 +01:00
parent 60671c7774
commit 57450ac5f7
3 changed files with 37 additions and 13 deletions

View File

@ -31,7 +31,7 @@ class NewNoteDialog(val activity: Activity, callback: (note: Note) -> Unit) {
title.isEmpty() -> activity.toast(R.string.no_title)
activity.notesDB.getNoteIdWithTitle(title) != null -> activity.toast(R.string.title_taken)
else -> {
val type = if (view.note_checklist.isChecked) TYPE_CHECKLIST else TYPE_TEXT
val type = if (view.new_note_type.checkedRadioButtonId == view.type_checklist.id) TYPE_CHECKLIST else TYPE_TEXT
val newNote = Note(null, title, "", type)
callback(newNote)
dismiss()