package com.yidian.shenghuoquan.bmanagercenter.ui.store.adapter

import android.annotation.SuppressLint
import android.widget.TextView
import com.amap.api.services.core.PoiItem
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yidian.bcommon.extensions.hide
import com.yidian.bcommon.extensions.show
import com.yidian.shenghuoquan.bmanagercenter.R


/**
 * 附近pio适配器
 */
class PioListAdapter : BaseQuickAdapter<PoiItem, BaseViewHolder>(R.layout.item_store_address) {

  @SuppressLint("SetTextI18n")
  override fun convert(holder: BaseViewHolder, item: PoiItem) {
    holder.getView<TextView>(R.id.list_view_title_text).text = item.title
    holder.getView<TextView>(R.id.list_view_area_text).text = item.provinceName + item.cityName + item.adName
    if (holder.layoutPosition == 0) {
      holder.getView<TextView>(R.id.tv_current_location).show()
    } else {
      holder.getView<TextView>(R.id.tv_current_location).hide()
    }
  }
}
