Skip to content

Instantly share code, notes, and snippets.

@benbaxter
Created December 15, 2017 18:23
Show Gist options
  • Save benbaxter/3f8443c775e20986cad72b70f8016147 to your computer and use it in GitHub Desktop.
Save benbaxter/3f8443c775e20986cad72b70f8016147 to your computer and use it in GitHub Desktop.
public void setItems(final List itemList, final DiffCallback callback) {
if (callback == null) {
// shortcut when DiffCallback is not provided
mItems.clear();
mItems.addAll(itemList);
notifyChanged();
return;
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment