Skip to content

Instantly share code, notes, and snippets.

@mustafayigitt
Created October 24, 2020 15:29
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 mustafayigitt/e10d2d014c58740d2a0c041f9790629c to your computer and use it in GitHub Desktop.
Save mustafayigitt/e10d2d014c58740d2a0c041f9790629c to your computer and use it in GitHub Desktop.
Base viewholder and Itemcallback
class BaseViewHolder(container: ViewGroup) : RecyclerView.ViewHolder(container)
class BaseItemCallback<T : Any> : DiffUtil.ItemCallback<T>() {
override fun areItemsTheSame(oldItem: T, newItem: T) = oldItem.toString() == newItem.toString()
override fun areContentsTheSame(oldItem: T, newItem: T) = oldItem == newItem
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment