Example #1
0
 public void updateNote(Note newNote, Note oldNote) {
   for (Note note : notes) {
     if (oldNote.getId().equals(note.getId())) {
       note.setTitle(newNote.getTitle());
       note.setContent(newNote.getContent());
       notes.remove(note);
       notes.add(0, note);
       notesRecyclerView.scrollToPosition(0);
       notesAdapter.notifyDataSetChanged();
       break;
     }
   }
 }
Example #2
0
 public void addNoteToList(Note note, int position) {
   notes.add(position, note);
   notesAdapter.notifyItemInserted(position);
 }
Example #3
0
 public void addNoteToList(Note note) {
   emptyView.setVisibility(View.GONE);
   notes.add(0, note);
   notesAdapter.notifyItemInserted(0);
 }