package com.gh.gamecenter.adapter.viewholder;

import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.gh.gamecenter.common.base.BaseRecyclerViewHolder;
import com.gh.gamecenter.databinding.GameViewpagerItemBinding;

/**
 * Created by LGT on 2016/11/14.
 * viewHolder
 */
public class GameViewPagerViewHolder extends BaseRecyclerViewHolder {

    public GameViewpagerItemBinding binding;

    public GameViewPagerViewHolder(GameViewpagerItemBinding bind, int width) {
        super(bind.getRoot());
        binding = bind;
        // 傻逼viewpager拿不到高度，一定要自己算下，妈的，先不管了
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT, (int) (width / 16f * 7f));
        binding.viewPager.setLayoutParams(params);
    }

}
