package com.android.jingdong.adaptor;

import com.android.jingdong.model.JD;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.android.jingdong.R;

import org.jetbrains.annotations.NotNull;

import java.util.List;

public class TaobaoRightAdapter extends BaseQuickAdapter<JD, BaseViewHolder> {

    public TaobaoRightAdapter(List<JD> JDS) {
        super(R.layout.item_taobao_right, JDS);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, JD JD) {
        baseViewHolder.setImageResource(R.id.snackRightImage, JD.getImage())
                .setText(R.id.snackRightName, JD.getName())
                .setText(R.id.snackRightPrice, "￥" + JD.getPrice());
    }
}
