Created
October 24, 2020 15:29
-
-
Save mustafayigitt/e10d2d014c58740d2a0c041f9790629c to your computer and use it in GitHub Desktop.
Base viewholder and Itemcallback
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
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