You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
Kotlin
48 lines
1.4 KiB
Kotlin
|
10 months ago
|
package com.rehome.dywoa.adapter
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
import android.content.Context
|
||
|
|
import android.view.LayoutInflater
|
||
|
|
import android.view.View
|
||
|
|
import android.view.ViewGroup
|
||
|
|
import com.rehome.dywoa.base.BaseViewBindingAdapter
|
||
|
|
import com.rehome.dywoa.bean.MjApplyBean
|
||
|
|
import com.rehome.dywoa.databinding.AdapterMjApplyBinding
|
||
|
|
|
||
|
|
|
||
|
|
class MjApplyAdapter(var context: Context,
|
||
|
|
var data: MutableList<MjApplyBean.Row>, var btnMjOnClickListener: MjAdapterBtnClickListener) : BaseViewBindingAdapter<AdapterMjApplyBinding>(context) {
|
||
|
|
|
||
|
|
|
||
|
|
override fun getCount(): Int {
|
||
|
|
return data.count()
|
||
|
|
}
|
||
|
|
|
||
|
|
override fun getItem(position: Int): Any {
|
||
|
|
return data[position]
|
||
|
|
}
|
||
|
|
|
||
|
|
override fun getItemId(position: Int): Long {
|
||
|
|
return position.toLong()
|
||
|
|
}
|
||
|
|
|
||
|
|
override fun getBinding(
|
||
|
|
inflater: LayoutInflater,
|
||
|
|
parent: ViewGroup?
|
||
|
|
) = AdapterMjApplyBinding.inflate(inflater, parent, false)
|
||
|
|
override fun handleData(position: Int, binding: AdapterMjApplyBinding) {
|
||
|
|
val item: MjApplyBean.Row = data[position]
|
||
|
|
binding.tvJhmc.text = item.jhmc
|
||
|
|
|
||
|
|
binding.tvZy.text = item.zymc
|
||
|
|
binding.tvZxsj.text = item.zxsj
|
||
|
|
binding.tvZds.text = item.zds
|
||
|
|
|
||
|
|
binding.tvYjds.text = item.yjds
|
||
|
|
binding.tvLjds.text = item.ljds
|
||
|
|
binding.btnMjApply.setOnClickListener {
|
||
|
|
btnMjOnClickListener.onClick(position)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|