mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-22 11:30:10 +01:00
fix a glitch at creating notes synced to files
This commit is contained in:
parent
4564c6a561
commit
8897c39f6d
@ -482,9 +482,10 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun displayNewNoteDialog(value: String = "", title: String? = null) {
|
||||
private fun displayNewNoteDialog(value: String = "", title: String? = null, path: String = "") {
|
||||
NewNoteDialog(this, title) {
|
||||
it.value = value
|
||||
it.path = path
|
||||
addNewNote(it)
|
||||
}
|
||||
}
|
||||
@ -540,7 +541,7 @@ class MainActivity : SimpleActivity() {
|
||||
} else {
|
||||
runOnUiThread {
|
||||
OpenFileDialog(this, it.path) {
|
||||
displayNewNoteDialog(it.value, title = it.title)
|
||||
displayNewNoteDialog(it.value, title = it.title, it.path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ import java.io.FileNotFoundException
|
||||
|
||||
@Entity(tableName = "notes", indices = [(Index(value = ["id"], unique = true))])
|
||||
data class Note(
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "title") var title: String,
|
||||
@ColumnInfo(name = "value") var value: String,
|
||||
@ColumnInfo(name = "type") var type: Int,
|
||||
@ColumnInfo(name = "path") var path: String = "") {
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "title") var title: String,
|
||||
@ColumnInfo(name = "value") var value: String,
|
||||
@ColumnInfo(name = "type") var type: Int,
|
||||
@ColumnInfo(name = "path") var path: String = "") {
|
||||
|
||||
fun getNoteStoredValue(): String? {
|
||||
return if (path.isNotEmpty()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user