package com.sheep.gamegroup.view.adapter;

import android.app.Activity;
import android.content.Context;
import android.view.View;

import com.sheep.gamegroup.model.entity.Welfare;
import com.sheep.gamegroup.util.ViewHolder;
import com.sheep.gamegroup.util.ViewUtil;
import com.sheep.jiuyan.samllsheep.R;

import java.util.List;

/**
 * Created by realicing on 2018/8/28.
 * realicing@sina.com
 */
public class DownloadWelfareAdapter extends AdbCommonRecycler<Welfare> implements View.OnClickListener{

    public DownloadWelfareAdapter(Context context, List<Welfare> list) {
        super(context, list);
    }

    @Override
    public int getViewIdByType(int type) {
        return R.layout.item_download_welfare;
    }

    @Override
    public void convert(ViewHolder holder, Welfare welfareCenter) {
        holder.itemView.setOnClickListener(this);
        View item_download_welfare_line = holder.getView(R.id.item_download_welfare_line);
        item_download_welfare_line.setVisibility(holder.getAdapterPosition() + 1 == getItemCount() ? View.GONE : View.VISIBLE);
    }

    @Override
    public void onClick(View view) {
        ViewUtil.shareGetWelfareDialog((Activity) context, null);
    }
}
