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

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

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

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

public class MainHomeTitleHeaderViewHolder extends BaseViewHolder {
    private TextView mTextViewTitle;

    public MainHomeTitleHeaderViewHolder(@NonNull ViewGroup viewGroup) {

        super(viewGroup, R.layout.item_main_home_title_header);

        mTextViewTitle = (TextView) itemView.findViewById(R.id.title_textView);
    }

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

        if (object != null && object instanceof String) {
            String format = (String) object;
            mTextViewTitle.setText(String.format(format, count));
        }


//        if (count > 0) {
//            mTextViewCount.setText(Integer.toString(count));
//            mTextViewCount.setVisibility(View.VISIBLE);
//        } else {
//            mTextViewCount.setVisibility(View.GONE);
//        }
    }
}
