What is the right way of Android View Binding in the RecyclerView adapter class?

前端 未结 5 1493
[愿得一人]
[愿得一人] 2021-02-14 07:08

Here is the code I used in my RecycleView adapter class. I don\'t know this is the right way or not to use View Binding. If you have a better solution answer me. Th

5条回答
  •  北荒
    北荒 (楼主)
    2021-02-14 07:59

    You can create CommonCircleImageBinding directly in onCreateViewHolder by CommonCircleImageBinding.inflate(LayoutInflater.from(parent.getContext()))

    Then pass it to MyViewHolder

提交回复
热议问题