Skip to content

Instantly share code, notes, and snippets.

@pawegio
Last active January 23, 2017 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawegio/65e1f703ee900afa19d34c87c1421b77 to your computer and use it in GitHub Desktop.
Save pawegio/65e1f703ee900afa19d34c87c1421b77 to your computer and use it in GitHub Desktop.
class ViewHolder(view: View, val action: ((Item) -> Unit)? = null) : RecyclerView.ViewHolder(view) {
fun bind(item: Item) {
itemView.setOnClickListener { action?.invoke(item) }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment