ensure proper note being focused at viewpager

This commit is contained in:
tibbi
2018-11-07 23:10:05 +01:00
parent 27c815ec3f
commit a6b9cbba9b
2 changed files with 9 additions and 9 deletions

View File

@ -190,12 +190,12 @@ class NoteFragment : androidx.fragment.app.Fragment() {
private fun saveNoteValue(note: Note) {
if (note.path.isEmpty()) {
NotesHelper(activity!!).insertOrUpdateNote(note) {
(activity as MainActivity).noteSavedSuccessfully(note.title)
(activity as? MainActivity)?.noteSavedSuccessfully(note.title)
}
} else {
val currentText = getCurrentNoteViewText()
if (currentText != null) {
(activity as MainActivity).exportNoteValueToFile(note.path, currentText, true)
(activity as? MainActivity)?.exportNoteValueToFile(note.path, currentText, true)
}
}
}