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

import android.content.Context;
import android.support.constraint.ConstraintLayout;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.TextView;

import kr.co.zumo.app.R;

/**
 * BannerView
 * <pre>
 * </pre>
 *
 * @author 민효동
 * @version 1.0
 * @history 민효동   [2018. 9. 28.]   [최초 작성]
 * @since 2018. 9. 28.
 */
public class BannerView extends ConstraintLayout {

  private String title;
  private String description;

  public BannerView(Context context) {
    super(context);
    init(context);
  }

  public BannerView(Context context, AttributeSet attrs) {
    super(context, attrs);
    init(context);
  }

  public BannerView(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    init(context);
  }

  public BannerView(Context context, String title, String description) {
    super(context);

    this.title = title;
    this.description = description;

    init(context);
  }

  private void init(Context context) {
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.banner_view, this);

    ((TextView) findViewById(R.id.text_title)).setText(title);
    ((TextView) findViewById(R.id.text_description)).setText(description);
  }
}
