mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-11 22:20:07 +01:00
get the notes earlier at the importing process
This commit is contained in:
parent
a66ac61f98
commit
13dd6164bd
@ -245,7 +245,10 @@ class MainActivity : SimpleActivity() {
|
||||
|
||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||
if (it) {
|
||||
importFileWithSync(uri)
|
||||
NotesHelper(this).getNotes {
|
||||
mNotes = it
|
||||
importUri(uri)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -387,7 +390,7 @@ class MainActivity : SimpleActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun importFileWithSync(uri: Uri) {
|
||||
private fun importUri(uri: Uri) {
|
||||
when (uri.scheme) {
|
||||
"file" -> openPath(uri.path)
|
||||
"content" -> {
|
||||
@ -412,14 +415,11 @@ class MainActivity : SimpleActivity() {
|
||||
Note(null, title, "", TYPE_TEXT, path)
|
||||
}
|
||||
|
||||
NotesHelper(this).getNotes {
|
||||
mNotes = it
|
||||
if (mNotes.any { it.title.equals(note.title, true) }) {
|
||||
note.title += " (file)"
|
||||
}
|
||||
|
||||
addNewNote(note)
|
||||
if (mNotes.any { it.title.equals(note.title, true) }) {
|
||||
note.title += " (file)"
|
||||
}
|
||||
|
||||
addNewNote(note)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user