mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-06-05 17:00:23 +02:00
display success toast at saving notes
This commit is contained in:
@ -216,12 +216,17 @@ class MainActivity : SimpleActivity(), ViewPager.OnPageChangeListener {
|
||||
out.write(content)
|
||||
}
|
||||
}
|
||||
toast(R.string.file_saved)
|
||||
noteSavedSuccessfully()
|
||||
} catch (e: Exception) {
|
||||
toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
|
||||
fun noteSavedSuccessfully() {
|
||||
val message = String.format(getString(R.string.note_saved_successfully), mCurrentNote.title)
|
||||
toast(message)
|
||||
}
|
||||
|
||||
private fun getCurrentNoteText() = (view_pager.adapter as NotesPagerAdapter).getCurrentNoteText(view_pager.currentItem)
|
||||
|
||||
private fun displayDeleteNotePrompt() {
|
||||
|
@ -77,6 +77,7 @@ class NoteFragment : Fragment() {
|
||||
private fun saveNoteValue(note: Note) {
|
||||
if (note.path.isEmpty()) {
|
||||
mDb.updateNoteValue(note)
|
||||
(activity as MainActivity).noteSavedSuccessfully()
|
||||
} else {
|
||||
(activity as MainActivity).saveNoteValueToFile(note.path, getCurrentNoteViewText())
|
||||
}
|
||||
|
Reference in New Issue
Block a user