Created
January 6, 2019 12:46
-
-
Save tfcporciuncula/9f1cea54dac1617799e6817bd9d34fe1 to your computer and use it in GitHub Desktop.
BooksAdapter adding click listener
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
override fun onBindViewHolder(holder: DataBindingViewHolder<Listable>, position: Int) { | |
super.onBindViewHolder(holder, position) // make sure you keep this | |
holder.itemView.setOnClickListener { | |
// whatever you want! | |
// you could add a Presenter/ViewModel to the Adapter constructor and call a method, for instance: | |
// viewModel.onItemClicked() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment