mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
- wip: app crash when gson can not deserialize note
This commit is contained in:
@ -72,7 +72,7 @@ class Config(context: Context) : BaseConfig(context) {
|
||||
set(useIncognitoMode) = prefs.edit().putBoolean(USE_INCOGNITO_MODE, useIncognitoMode).apply()
|
||||
|
||||
var lastCreatedNoteType: Int
|
||||
get() = prefs.getInt(LAST_CREATED_NOTE_TYPE, TYPE_TEXT)
|
||||
get() = prefs.getInt(LAST_CREATED_NOTE_TYPE, NoteType.TYPE_TEXT.value)
|
||||
set(lastCreatedNoteType) = prefs.edit().putInt(LAST_CREATED_NOTE_TYPE, lastCreatedNoteType).apply()
|
||||
|
||||
var moveUndoneChecklistItems: Boolean
|
||||
|
@ -37,8 +37,7 @@ const val GRAVITY_CENTER = 1
|
||||
const val GRAVITY_RIGHT = 2
|
||||
|
||||
// note types
|
||||
const val TYPE_TEXT = 0
|
||||
const val TYPE_CHECKLIST = 1
|
||||
enum class NoteType(val value: Int) { TYPE_TEXT(0), TYPE_CHECKLIST(1) }
|
||||
|
||||
// mime types
|
||||
const val MIME_TEXT_PLAIN = "text/plain"
|
||||
|
@ -32,7 +32,7 @@ class NotesHelper(val context: Context) {
|
||||
|
||||
if (notes.isEmpty()) {
|
||||
val generalNote = context.resources.getString(R.string.general_note)
|
||||
val note = Note(null, generalNote, "", TYPE_TEXT)
|
||||
val note = Note(null, generalNote, "", NoteType.TYPE_TEXT.value)
|
||||
context.notesDB.insertOrUpdate(note)
|
||||
notes.add(note)
|
||||
}
|
||||
|
Reference in New Issue
Block a user