fetch the proper file content for file types

This commit is contained in:
tibbi 2017-03-08 22:13:39 +01:00
parent c5fc3d2bd5
commit b2dec578f8
1 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import com.simplemobiletools.notes.helpers.DBHelper
import com.simplemobiletools.notes.helpers.NOTE_ID
import com.simplemobiletools.notes.models.Note
import kotlinx.android.synthetic.main.fragment_note.view.*
import java.io.File
class NoteFragment : Fragment() {
var noteId = 0
@ -84,7 +85,11 @@ class NoteFragment : Fragment() {
fun getCurrentNoteViewText() = view.notes_view.text.toString()
private fun getNoteStoredValue(): String {
return note.value
return if (note.path.isNotEmpty()) {
File(note.path).readText()
} else {
note.value
}
}
override fun onResume() {