package com.sheep.gamegroup.view.adapter;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sheep.gamegroup.model.entity.GameInfoList;
import com.sheep.gamegroup.util.ViewUtil;
import com.sheep.jiuyan.samllsheep.R;

import java.util.List;



/**
 * Created by realicing on 2018/11/1.
 * realicing@sina.com
 * 主页游戏模块--玩转游戏中列表
 * 游戏详情中详情列表：游戏介绍、详情信息、用户评价、相关游戏、热门试玩
 * 游戏详情中福利列表：游戏评分、文章推荐、活动推荐
 */
public class AdpGcGameAppInfoList extends BaseQuickAdapter<GameInfoList, BaseViewHolder> {
    public AdpGcGameAppInfoList(List<GameInfoList> datas) {
        super(R.layout.item_gc_game_app_detail_list, datas);
    }

    @Override
    public void convert(BaseViewHolder viewHolder, final GameInfoList itemList) {
        View item_gc_game_app_list_top = viewHolder.itemView.findViewById(R.id.item_gc_game_app_list_top);
        View item_gc_game_app_list_bottom = viewHolder.itemView.findViewById(R.id.item_gc_game_app_list_bottom);
        TextView item_gc_game_app_list_tv = viewHolder.itemView.findViewById(R.id.item_gc_game_app_list_tv);
        TextView item_gc_game_app_list_more_tv = viewHolder.itemView.findViewById(R.id.item_gc_game_app_list_more_tv);
        RecyclerView recyclerView = viewHolder.itemView.findViewById(R.id.item_gc_game_app_list_rv);

        ViewUtil.setVisibility(item_gc_game_app_list_top, itemList.isShowTopLine());
        ViewUtil.setVisibility(item_gc_game_app_list_bottom, itemList.isShowBottomLine());
        ViewUtil.setText(item_gc_game_app_list_tv, itemList.getName());
        itemList.setMoreViewOnClickListener(item_gc_game_app_list_more_tv);

        recyclerView.setHasFixedSize(true);
        recyclerView.setNestedScrollingEnabled(false);
        recyclerView.setLayoutManager(itemList.getLayoutManager());
        recyclerView.setAdapter(itemList.getAdapter());
    }
}
