package kr.co.hanwha.hifive.adapter.viewholder;

import android.support.annotation.NonNull;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import kr.co.hanwha.hifive.R;
import kr.co.hanwha.hifive.base.BaseViewHolder;

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

public class MainEmptyListViewHolder extends BaseViewHolder {
    private TextView mTextViewEmpty;

    public MainEmptyListViewHolder(@NonNull ViewGroup viewGroup) {

        super(viewGroup, R.layout.item_main_empty_list);

        mTextViewEmpty = (TextView) itemView.findViewById(R.id.empty_textView);
    }

    @Override
    public void onBind(Object object, int height) {
        super.onBind(object, height);

        String message = (String) object;
        mTextViewEmpty.setText(message);

        if (height > 0) {
            LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height);
            mTextViewEmpty.setLayoutParams(param);
        }
    }
}