package com.usai.apex.KPI;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.usai.apex.R;

public class KPIItemButton extends RelativeLayout {

    public KPIItemButton(Context context) {
        super(context);
    }

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

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

    private KPIDot mDot;
    private TextView mTextView;

    public void setDotColor(int color) {
        if (mDot == null) {
            mDot = findViewById(R.id.icon_view);
        }
        mDot.setDotColor(color);
    }

    public void setTitle(String title) {
        if (mTextView == null) {
            mTextView = findViewById(R.id.name_tv);
        }
        mTextView.setText(title);
    }

    public void setTitleColor(int color) {
        if (mTextView == null) {
            mTextView = findViewById(R.id.name_tv);
        }
        mTextView.setTextColor(color);
    }
}
