mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
appending package name with .pro
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
package com.simplemobiletools.notes.pro.models
|
||||
|
||||
import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
|
||||
data class Note(var id: Int, var title: String, var value: String, val type: Int, var path: String = "") {
|
||||
fun getNoteStoredValue(): String? {
|
||||
return if (path.isNotEmpty()) {
|
||||
return try {
|
||||
File(path).readText()
|
||||
} catch (e: FileNotFoundException) {
|
||||
null
|
||||
}
|
||||
} else {
|
||||
value
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.simplemobiletools.notes.pro.models
|
||||
|
||||
import java.util.*
|
||||
|
||||
class TextHistory {
|
||||
var position = 0
|
||||
val history = LinkedList<TextHistoryItem>()
|
||||
|
||||
fun getPrevious(): TextHistoryItem? {
|
||||
if (position == 0) {
|
||||
return null
|
||||
}
|
||||
position--
|
||||
return history[position]
|
||||
}
|
||||
|
||||
fun getNext(): TextHistoryItem? {
|
||||
if (position >= history.size) {
|
||||
return null
|
||||
}
|
||||
|
||||
val item = history[position]
|
||||
position++
|
||||
return item
|
||||
}
|
||||
|
||||
fun add(item: TextHistoryItem) {
|
||||
while (history.size > position) {
|
||||
history.removeLast()
|
||||
}
|
||||
|
||||
history.add(item)
|
||||
position++
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
package com.simplemobiletools.notes.pro.models
|
||||
|
||||
data class TextHistoryItem(val start: Int, val before: CharSequence?, val after: CharSequence?)
|
@ -0,0 +1,3 @@
|
||||
package com.simplemobiletools.notes.pro.models
|
||||
|
||||
data class Widget(var widgetId: Int, var noteId: Int)
|
Reference in New Issue
Block a user