NoteType refactored

This commit is contained in:
merkost 2023-07-10 11:11:34 +10:00
parent f626389f85
commit 487350b0da
2 changed files with 15 additions and 3 deletions

View File

@ -44,9 +44,6 @@ const val GRAVITY_LEFT = 0
const val GRAVITY_CENTER = 1
const val GRAVITY_RIGHT = 2
// note types
enum class NoteType(val value: Int) { TYPE_TEXT(0), TYPE_CHECKLIST(1) }
// mime types
const val MIME_TEXT_PLAIN = "text/plain"

View File

@ -0,0 +1,15 @@
package com.simplemobiletools.notes.pro.models
import kotlinx.serialization.Serializable
@Serializable
enum class NoteType(val value: Int) {
TYPE_TEXT(0),
TYPE_CHECKLIST(1);
companion object {
fun fromValue(value: Int): NoteType {
return values().find { it.value == value } ?: TYPE_TEXT
}
}
}