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

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

import kr.co.hanwha.hifive.R;
import kr.co.hanwha.hifive.adapter.model.OkrListViewHolderData;
import kr.co.hanwha.hifive.base.BaseViewHolder;

/**
 * Created by aaron on 2018. 9. 18.
 */
public class SettingMyHomeOkrObjectViewHolder extends BaseViewHolder {
    private LinearLayout mLinearLayoutBody;
    private TextView mTextViewObject;

    public SettingMyHomeOkrObjectViewHolder(@NonNull ViewGroup viewGroup) {
        super(viewGroup, R.layout.item_setting_my_home_okr_object);

        mLinearLayoutBody = (LinearLayout) itemView.findViewById(R.id.body_linearLayout);
        mTextViewObject = (TextView) itemView.findViewById(R.id.object_textView);
    }

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

        if (object instanceof OkrListViewHolderData) {
            OkrListViewHolderData data = (OkrListViewHolderData) object;

            if (data.isHasEmptyKr()) mLinearLayoutBody.setBackgroundResource(R.drawable.box_rounded_project_campaign_bg_single);

            mTextViewObject.setText(data.getDesc());
        }
    }
}
