package com.bonait.bnframework.modules.home.fragment.mode;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bonait.bnframework.R;
import com.bonait.bnframework.common.helper.I.MyClickListener;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class jingdutiao extends LinearLayout {
    @BindView(R.id.t_progressBar)
    ProgressBar t_progressBar;
    @BindView(R.id.t_text)
    TextView t_text;
    /**
     * 当前进度
     */
    public int value=0;
    private View root;

    public jingdutiao(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        root= LayoutInflater.from(context).inflate(R.layout.item_jingdutiao, this);
        ButterKnife.bind(this, root);
        Init();
    }

    public void Init()
    {
        SetValue(0);
    }

    /**
     * 设置级别
     * @param
     */
    public void SetValue(int data)
    {
        value=data;
        t_progressBar.setProgress(data);
        t_text.setText(data+"%");
    }
}
