when using the synthetic property on a view it com...
# android
t
when using the synthetic property on a view it compiles to
itemView.findViewById(R.id.some_view_id)
which is different than how it works when used on an activity or fragment. so what you can do in your view holder so that findViewById is only called once per view is something like this:
Copy code
class SomeViewHolder(itemView: View): RecyclerView.ViewHolder(itemView) {
  val someView by lazy { itemView.some_view_id }

  /* rest of impl here */
}
👍 2