mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-17 16:57:23 +02:00
fetch the proper file content for file types
This commit is contained in:
parent
c5fc3d2bd5
commit
b2dec578f8
@ -22,6 +22,7 @@ import com.simplemobiletools.notes.helpers.DBHelper
|
|||||||
import com.simplemobiletools.notes.helpers.NOTE_ID
|
import com.simplemobiletools.notes.helpers.NOTE_ID
|
||||||
import com.simplemobiletools.notes.models.Note
|
import com.simplemobiletools.notes.models.Note
|
||||||
import kotlinx.android.synthetic.main.fragment_note.view.*
|
import kotlinx.android.synthetic.main.fragment_note.view.*
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
class NoteFragment : Fragment() {
|
class NoteFragment : Fragment() {
|
||||||
var noteId = 0
|
var noteId = 0
|
||||||
@ -84,7 +85,11 @@ class NoteFragment : Fragment() {
|
|||||||
fun getCurrentNoteViewText() = view.notes_view.text.toString()
|
fun getCurrentNoteViewText() = view.notes_view.text.toString()
|
||||||
|
|
||||||
private fun getNoteStoredValue(): String {
|
private fun getNoteStoredValue(): String {
|
||||||
return note.value
|
return if (note.path.isNotEmpty()) {
|
||||||
|
File(note.path).readText()
|
||||||
|
} else {
|
||||||
|
note.value
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user