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.adapter.model.OkrListViewHolderData;
import kr.co.hanwha.hifive.base.BaseViewHolder;

/**
 * Created by aaron on 2018. 9. 18.
 */
public class SettingMyHomeOkrUnitViewHolder extends BaseViewHolder {
    private View mViewTopMargin;
    private TextView mTextViewUnit;

    public SettingMyHomeOkrUnitViewHolder(@NonNull ViewGroup viewGroup) {
        super(viewGroup, R.layout.item_setting_my_home_okr_unit);

        mViewTopMargin = itemView.findViewById(R.id.topMargin_View);
        mTextViewUnit = (TextView) itemView.findViewById(R.id.unit_textView);
    }

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

        if (index == 0) {
            mViewTopMargin.setVisibility(View.GONE);
        }

        if (object instanceof OkrListViewHolderData) {
            OkrListViewHolderData data = (OkrListViewHolderData) object;
            mTextViewUnit.setText(data.getName());
        }
    }
}
