package com.abbidot.tracker.adapter

import android.content.Context
import com.abbidot.baselibrary.list.BaseRecyclerAdapter
import com.abbidot.baselibrary.list.RecyclerViewHolder
import com.abbidot.tracker.R
import com.baidu.mapapi.search.core.PoiInfo

/**
 *Created  by .yzq on 2022/7/4/004.
 * @link
 * @description:百度地图搜索地址返回结果
 */
class BaiduMapPoiSearchResultAdapter(ctx: Context, list: MutableList<PoiInfo>?) :
    BaseRecyclerAdapter<PoiInfo>(ctx, list) {
    override fun getEmptyLayoutId(viewType: Int) = 0

    override fun getItemLayoutId(viewType: Int) = R.layout.item_baidu_map_poi_result

    override fun bindData(holder: RecyclerViewHolder?, position: Int, item: PoiInfo) {
        holder!!.setText(R.id.baidu_map_poi_name, item.name)
        holder.setText(R.id.baidu_map_poi_address, item.address)
    }
}