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

前端 未结 5 1805
时光说笑
时光说笑 2021-02-14 07:28

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:46

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

    Then pass it to MyViewHolder

提交回复
热议问题