Created
January 4, 2022 13:05
-
-
Save mustafayigitt/50c36c0edec9a895a31136eecc151f00 to your computer and use it in GitHub Desktop.
BaseDiffCallback is a item callback for BaseRecyclerAdapter(ListAdapter)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.recyclerview.widget.DiffUtil | |
class BaseDiffCallback<T : BaseComparable> : DiffUtil.ItemCallback<T>() { | |
override fun areItemsTheSame(oldItem: T, newItem: T) = | |
oldItem.id == newItem.id | |
override fun areContentsTheSame(oldItem: T, newItem: T) = | |
oldItem.equals(newItem) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment