package com.bjzc.bhzhgd.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import com.bjzc.bhzhgd.base.BaseAdapterViewBinding
import com.bjzc.bhzhgd.bean.DeviceZhgdBean
import com.bjzc.bhzhgd.databinding.AdapterDeviceThreeLevelBinding
import com.bjzc.bhzhgd.databinding.AdapterDeviceTwoLevelBinding

class DeviceThreeLevelAdapter(var context: Context,
                               var data: MutableList<DeviceZhgdBean.DataBean>) : BaseAdapterViewBinding<AdapterDeviceThreeLevelBinding>(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?
    ) = AdapterDeviceThreeLevelBinding.inflate(inflater, parent, false)

    override fun handleData(position: Int, binding: AdapterDeviceThreeLevelBinding) {
        val item: DeviceZhgdBean.DataBean = data[position]
        binding.tvGsmc.text = item.gsmc
        binding.tvMc.text = item.mc
        binding.tvSl.text = item.sl
        binding.tvRl.text = item.rl
        binding.tvXs.text = item.xs
        binding.tvGl.text = item.gl
        binding.tvDy.text = item.dy
        binding.tvKzl.text = item.kzl
        binding.tvZrl.text = item.zrl
        binding.tvBz.text = item.bz
        binding.tvZrr.text = item.zrr
        binding.tvYdsbdxbh.text = item.ydsbdxbh
        binding.tvSjhm.text = item.sjhm

    }

}