package kr.co.hanwha.hifive.view;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import kr.co.hanwha.hifive.R;

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

public class HFReceiverEtcView extends LinearLayout {
    private TextView mTextView;

    public HFReceiverEtcView(Context context) {
        super(context);
        initialize(context, null);
    }

    public HFReceiverEtcView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        initialize(context, attrs);
    }

    public HFReceiverEtcView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initialize(context, attrs);
    }

    private void initialize(Context context, @Nullable AttributeSet attrs) {
        if (isInEditMode()) return;

        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.view_hf_receiver_etc, this, true);

        mTextView = (TextView) findViewById(R.id.textView);
    }

    public void setCount(@NonNull int count) {
        mTextView.setText(String.format(getContext().getString(R.string.add_task_receiver_etc), count));
    }
}