|
@@ -4,17 +4,24 @@ import com.yingyang.healthconsultation.R
|
|
|
import com.yingyang.healthconsultation.databinding.ItemSearchDoctorBinding
|
|
|
import com.yingyangfly.baselib.adapter.BaseDataBindingAdapter
|
|
|
import com.yingyangfly.baselib.db.DoctorBean
|
|
|
+import com.yingyangfly.baselib.ext.setOnSingleClickListener
|
|
|
|
|
|
/**
|
|
|
* 医生搜索adapter
|
|
|
*/
|
|
|
class SearchDoctorAdapter(override val layoutId: Int = R.layout.item_search_doctor) :
|
|
|
BaseDataBindingAdapter<DoctorBean, ItemSearchDoctorBinding>() {
|
|
|
+
|
|
|
+ var onClickListener: ((bean: DoctorBean) -> Unit)? = null
|
|
|
+
|
|
|
override fun onBindViewHolder(
|
|
|
binding: ItemSearchDoctorBinding,
|
|
|
item: DoctorBean,
|
|
|
position: Int
|
|
|
) {
|
|
|
binding.data = item
|
|
|
+ binding.doctorLayout.setOnSingleClickListener {
|
|
|
+ onClickListener?.invoke(item)
|
|
|
+ }
|
|
|
}
|
|
|
}
|