Skip to content

Instantly share code, notes, and snippets.

@ashwin-sp
Created January 4, 2019 14:40
Show Gist options
  • Save ashwin-sp/256f3b9f64817a6120631c6cf3ffde5e to your computer and use it in GitHub Desktop.
Save ashwin-sp/256f3b9f64817a6120631c6cf3ffde5e to your computer and use it in GitHub Desktop.
contentList.forEach {
if (it.commentID == -1 && it.feedID == -1) {
val content = it
FeedItemBindingModel_()
.id(it.id)
.content(it)
.listener(View.OnClickListener {
feedID = content.id
recycler_view.requestModelBuild()
showSoftKeyboard(edit_content)
})
.onLiked(View.OnClickListener {
contentList[content.id - 1] = Content(content.id, content.by, content.content, contentList[content.id - 1].likeCount + 1, content.feedID, content.commentID)
recycler_view.requestModelBuild()
})
.addTo(controller)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment