package com.rv.home.rv.module.ui.main.home.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ui.main.home.bean.ShopListBean;

/**
 * Created :Auser
 * Date: 2019/5/18.
 * Desc:选择门店适配器
 */

public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.DataBean,BaseViewHolder>{

    public SelectShopAdapter() {
        super(R.layout.rv_item_select_shop);
    }

    @Override
    protected void convert(BaseViewHolder helper, ShopListBean.DataBeanX.DataBean item) {
        helper.setText(R.id.tv_name,item.getName());
        helper.setText(R.id.tv_km,item.getDistance()!=null?String.format("%1$s%2$s%3$s"
                ,mContext.getString(R.string.rv_distance_you)
                ,item.getDistance()
                ,mContext.getString(R.string.rv_km)):"");
        helper.setText(R.id.tv_address,String.format("%1$s%2$s",mContext.getString(R.string.rv_shop_location),item.getAddrDetail()));

    }
}
