Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
data class Post(
@SerializedName("id")
val id: String,
@SerializedName("sender")
val sender: String?,
@SerializedName("caption")
val caption: String?,
@SerializedName("media")
val media: String?,
@SerializedName("timestamp")
val timestamp: Long?
)
object PostDiffUtils : DiffUtil.ItemCallback<Post>() {
override fun areItemsTheSame(oldItem: Post, newItem: Post): Boolean {
return oldItem.id == oldItem.id
}
override fun areContentsTheSame(oldItem: Post, newItem: Post): Boolean {
return oldItem == newItem
}
}
interface PostApiService {
@GET("/feed")
fun getFeed(): Call<Response<List<Post>>>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.