adding a new ChecklistFragment and rename NoteFragment to TextFragment

This commit is contained in:
tibbi
2018-12-07 22:16:21 +01:00
parent 2d36835ebb
commit 22be4e4ac4
13 changed files with 370 additions and 317 deletions

View File

@ -10,7 +10,7 @@ import com.simplemobiletools.notes.pro.R
import com.simplemobiletools.notes.pro.activities.SimpleActivity
import com.simplemobiletools.notes.pro.extensions.notesDB
import com.simplemobiletools.notes.pro.helpers.NotesHelper
import com.simplemobiletools.notes.pro.helpers.TYPE_NOTE
import com.simplemobiletools.notes.pro.helpers.TYPE_TEXT
import com.simplemobiletools.notes.pro.models.Note
import kotlinx.android.synthetic.main.dialog_import_folder.view.*
import java.io.File
@ -70,7 +70,7 @@ class ImportFolderDialog(val activity: SimpleActivity, val path: String, val cal
}
private fun saveNote(title: String, value: String, path: String) {
val note = Note(null, title, value, TYPE_NOTE, path)
val note = Note(null, title, value, TYPE_TEXT, path)
NotesHelper(activity).insertOrUpdateNote(note)
}
}

View File

@ -10,7 +10,7 @@ import com.simplemobiletools.commons.extensions.value
import com.simplemobiletools.notes.pro.R
import com.simplemobiletools.notes.pro.extensions.notesDB
import com.simplemobiletools.notes.pro.helpers.TYPE_CHECKLIST
import com.simplemobiletools.notes.pro.helpers.TYPE_NOTE
import com.simplemobiletools.notes.pro.helpers.TYPE_TEXT
import com.simplemobiletools.notes.pro.models.Note
import kotlinx.android.synthetic.main.dialog_new_note.view.*
@ -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_NOTE
val type = if (view.note_checklist.isChecked) TYPE_CHECKLIST else TYPE_TEXT
val newNote = Note(null, title, "", type)
callback(newNote)
dismiss()

View File

@ -7,7 +7,7 @@ import com.simplemobiletools.commons.extensions.humanizePath
import com.simplemobiletools.commons.extensions.setupDialogStuff
import com.simplemobiletools.notes.pro.R
import com.simplemobiletools.notes.pro.activities.SimpleActivity
import com.simplemobiletools.notes.pro.helpers.TYPE_NOTE
import com.simplemobiletools.notes.pro.helpers.TYPE_TEXT
import com.simplemobiletools.notes.pro.models.Note
import kotlinx.android.synthetic.main.dialog_open_file.*
import kotlinx.android.synthetic.main.dialog_open_file.view.*
@ -45,7 +45,7 @@ class OpenFileDialog(val activity: SimpleActivity, val path: String, val callbac
private fun saveNote(storeContent: String, storePath: String) {
val filename = path.getFilenameFromPath()
val note = Note(null, filename, storeContent, TYPE_NOTE, storePath)
val note = Note(null, filename, storeContent, TYPE_TEXT, storePath)
callback(note)
dialog.dismiss()
}