package kr.co.hanwha.hifive.base;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;

/**
 * Created by sanghoonkwon on 2018. 1. 10..
 */

public class BaseViewHolder extends RecyclerView.ViewHolder {

    private Context mContext;

    public BaseViewHolder(ViewGroup viewGroup, int layoutRes) {
        super(LayoutInflater.from(viewGroup.getContext()).inflate(layoutRes, viewGroup, false));
        this.mContext = viewGroup.getContext();
    }

    public void onBind(@NonNull Object object, @NonNull int index) {
    }

    public Context getContext() {
        return mContext;
    }

    public int getHeight() {
        itemView.measure(0, 0);
        return itemView.getMeasuredHeight();
    }
}
