display success toast at saving notes

This commit is contained in:
tibbi 2017-03-08 22:22:59 +01:00
parent b2dec578f8
commit 13d09de4be
11 changed files with 43 additions and 1 deletions

View File

@ -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() {

View File

@ -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())
}

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">Notiz auswählen</string>
<string name="rename_note">Notiz umbenennen</string>
<string name="general_note">Hauptnotiz</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="widget_note">Widget Notiz</string>

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">Seleccione una nota</string>
<string name="rename_note">Renombrar nota</string>
<string name="general_note">Nota principal</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="note_font_size">Tamaño de fuente</string>

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">Choisir une note</string>
<string name="rename_note">Renomme la note</string>
<string name="general_note">Note générale</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="widget_note">Note utilisée dans le widget</string>

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">Válassz egy jegyzetet</string>
<string name="rename_note">Jegyzet átnevezése</string>
<string name="general_note">Alapértelmezett jegyzet</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="widget_note">A widget-ben használt jegyzet</string>

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">Pick a note</string>
<string name="rename_note">Rename note</string>
<string name="general_note">General note</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="note_font_size">Note font size</string>

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">メモを選択</string>
<string name="rename_note">メモの名前を変更</string>
<string name="general_note">全般メモ</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="note_font_size">メモのフォントサイズ</string>

View File

@ -15,12 +15,16 @@
<string name="rename_note">Renomear nota</string>
<string name="general_note">Nota genérica</string>
<string name="open_file">Open file</string>
<!-- File notes -->
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
<string name="only_import_file_content">Only import the file content</string>
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="note_font_size">Tamanho do texto da nota</string>

View File

@ -15,12 +15,16 @@
<string name="rename_note">Rename note</string>
<string name="general_note">General note</string>
<string name="open_file">Open file</string>
<!-- File notes -->
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
<string name="only_import_file_content">Only import the file content</string>
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="note_font_size">Note font size</string>

View File

@ -14,6 +14,8 @@
<string name="pick_a_note">Pick a note</string>
<string name="rename_note">Rename note</string>
<string name="general_note">General note</string>
<!-- File notes -->
<string name="open_file">Open file</string>
<string name="save_as_file">Save as file</string>
<string name="file_too_large">File too large, the limit is 10MB</string>
@ -21,6 +23,8 @@
<string name="update_file_at_note">Update the file itself at updating the note</string>
<string name="delete_note_only">This will delete the note only.</string>
<string name="delete_file_itself">Delete the file itself too</string>
<string name="note_saved_successfully">Note \"%1$s\" saved successfully</string>
<string name="display_success_message">Display success message after saving a note</string>
<!-- Settings -->
<string name="widget_note">Note used in widget</string>