Skip to content

Instantly share code, notes, and snippets.

@k0siara
Created May 30, 2021 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k0siara/f50b0fd6732206ac3028cda7e3a39aa8 to your computer and use it in GitHub Desktop.
Save k0siara/f50b0fd6732206ac3028cda7e3a39aa8 to your computer and use it in GitHub Desktop.
RenderItems.kt
fun renderItems(newItems: List){
val diffResult: DiffUtil.DiffResult = DiffUtil.calculateDiff(DiffUtilCallback(oldItems, newItems))
diffResult.dispatchUpdatesTo(this) // this : RecyclerView.Adapter
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment