From 57450ac5f777222369f06d6d3c3e2e0def05930b Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 9 Dec 2018 10:00:06 +0100 Subject: [PATCH] change the way new note types are determined, to a radio button --- .../notes/pro/dialogs/NewNoteDialog.kt | 2 +- .../main/res/layout/dialog_import_folder.xml | 14 ++++---- app/src/main/res/layout/dialog_new_note.xml | 34 +++++++++++++++---- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/NewNoteDialog.kt b/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/NewNoteDialog.kt index a1979614..115d3fbc 100644 --- a/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/NewNoteDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/notes/pro/dialogs/NewNoteDialog.kt @@ -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() diff --git a/app/src/main/res/layout/dialog_import_folder.xml b/app/src/main/res/layout/dialog_import_folder.xml index cbd2d5ae..ab434c9e 100644 --- a/app/src/main/res/layout/dialog_import_folder.xml +++ b/app/src/main/res/layout/dialog_import_folder.xml @@ -1,13 +1,14 @@ + android:paddingTop="@dimen/activity_margin" + android:paddingRight="@dimen/activity_margin"> + tools:text="myfile.txt"/> diff --git a/app/src/main/res/layout/dialog_new_note.xml b/app/src/main/res/layout/dialog_new_note.xml index 1c77391d..385bc1d4 100644 --- a/app/src/main/res/layout/dialog_new_note.xml +++ b/app/src/main/res/layout/dialog_new_note.xml @@ -18,13 +18,35 @@ android:textCursorDrawable="@null" android:textSize="@dimen/normal_text_size"/> - + android:paddingTop="@dimen/small_margin" + android:paddingRight="@dimen/small_margin" + android:text="@string/new_note_type"/> + + + + + + +