Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created May 9, 2018 09:41
Show Gist options
  • Select an option

  • Save anitaa1990/58dfb247f3dca15adfd9160285da1ce0 to your computer and use it in GitHub Desktop.

Select an option

Save anitaa1990/58dfb247f3dca15adfd9160285da1ce0 to your computer and use it in GitHub Desktop.
public void addTasks(List<Note> newNotes) {
NoteDiffUtil noteDiffUtil = new NoteDiffUtil(notes, newNotes);
DiffUtil.DiffResult diffResult = DiffUtil.calculateDiff(noteDiffUtil);
notes.clear();
notes.addAll(newNotes);
diffResult.dispatchUpdatesTo(this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment