appending package name with .pro

This commit is contained in:
tibbi
2018-11-07 11:48:09 +01:00
parent 20338bbe90
commit 0635dac078
34 changed files with 128 additions and 128 deletions

View File

@ -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
}
}
}

View File

@ -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++
}
}

View File

@ -0,0 +1,3 @@
package com.simplemobiletools.notes.pro.models
data class TextHistoryItem(val start: Int, val before: CharSequence?, val after: CharSequence?)

View File

@ -0,0 +1,3 @@
package com.simplemobiletools.notes.pro.models
data class Widget(var widgetId: Int, var noteId: Int)