/*
 * COPYRIGHT (c) 2018 All rights reserved by HANWHA LIFE.
 */
package kr.co.zumo.app.lifeplus.view.fragment.signup;


import android.view.View;

import java.util.ArrayList;

import kr.co.zumo.app.lifeplus.util.ResourceUtil;
import kr.co.zumo.app.lifeplus.view.presenter.signup.SignUpItem;
import kr.co.zumo.app.lifeplus.bean.SignUpBenefitBean;
import kr.co.zumo.app.lifeplus.bean.SignUpBenefitListBean;

/**
 * BenefitHolder - 회원 가입 화면 혜택을 표시하는 클래스
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018-09-11]   [최초 작성]
 * @since 2018-09-11
 */
public class BenefitHolder extends BaseViewHolder {


  public BenefitHolder(View itemView) {
    super(itemView);
  }

  @Override
  void draw(SignUpItem item) {
    SignUpBenefitListBean bean = item.getBean(SignUpBenefitListBean.class);
    ArrayList<SignUpBenefitBean> list = bean.getSignUpBenefitBeans();

    SignUpBenefitCustomView view;
    SignUpBenefitBean benefitBean;

    int len = list.size();
    for (int i = 0; i < len; ++i) {
      view = itemView.findViewById(ResourceUtil.getId("custom_view" + (i + 1)));
      benefitBean = list.get(i);
      view.setSignUpBenefit(benefitBean.getImageResource(), benefitBean.getText(), benefitBean.getBenefitText(), benefitBean.getCategoryText());
    }

  }

  @Override
  public void setDisabled() {

  }

  @Override
  public void setEnabled() {

  }
}