jeffdcamp
03/03/2017, 5:16 PMclass MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val nameEditText = view.nameEditText
}
// in adapter (onBindViewHolder)
holder.nameEditText.text = "Foo"
OR... do you access the view synthetic directly?
Example #2
class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
}
// in adapter (onBindViewHolder)
holder.itemView.nameEditText.text = "Foo"
It seems that only Activities and Fragments cache the synthetics... (https://youtrack.jetbrains.com/issue/KT-10542)... so if I don't store the EditText in the ViewHolder, will it do a findViewById(...) on every onBindViewHolder(...)?