Skip to content

Instantly share code, notes, and snippets.

@NielsMasdorp
Created October 15, 2018 13:32
Show Gist options
  • Save NielsMasdorp/3a8d88ebdd350f46c0840b90cfb4bb37 to your computer and use it in GitHub Desktop.
Save NielsMasdorp/3a8d88ebdd350f46c0840b90cfb4bb37 to your computer and use it in GitHub Desktop.
Use Kotlin Android extensions to access views inside `RecyclerView` `ViewHolder`s
class SomeViewHolder(override val containerView: View) : RecyclerView.ViewHolder(containerView), LayoutContainer {

    fun bind(data: Data) {
        myFirstTextView.text = data.foo
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment