Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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