Created
April 21, 2019 02:38
-
-
Save enginebai/0c3a1627b82218b7db6cfeff57655cf1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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