package com.unis.sxzcl.ui.user;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.unis.model.bean.VersionBean;
import com.unis.sxzcl.R;

import org.jetbrains.annotations.NotNull;

/**
 * 版本记录适配器
 * 创建人: mQ
 * 创建时间: 2021/1/12 9:50
 */
public class VersionRecordAdapter extends BaseQuickAdapter<VersionBean, BaseViewHolder> implements LoadMoreModule {


    public VersionRecordAdapter() {
        super(R.layout.item_version_record);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, VersionBean item) {
        holder.setText(R.id.tv_title, "v" + item.getVersionName())
                .setText(R.id.tv_content, item.getContent());

        if (holder.getLayoutPosition() == 0) {
            holder.setGone(R.id.view_newest, false);
        } else {
            holder.setGone(R.id.view_newest, true);
        }
    }
}
