mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-19 18:10:07 +01:00
NoteType refactored
This commit is contained in:
parent
f626389f85
commit
487350b0da
@ -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"
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user