RoundProgressBar.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:cardinalsSample 作者:
public RoundProgressBar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    paint = new Paint();

    TypedArray mTypedArray = context.obtainStyledAttributes(attrs, R.styleable.RoundProgressBar);

    //获取自定义属性和默认值
    roundColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundColor, Color.GRAY);
    roundProgressColor = mTypedArray.getColor(R.styleable.RoundProgressBar_roundProgressColor, Color.BLUE);
    textColor = mTypedArray.getColor(R.styleable.RoundProgressBar_textColor, Color.BLUE);
    textSize = mTypedArray.getDimension(R.styleable.RoundProgressBar_textSize, 14);
    roundWidth = mTypedArray.getDimension(R.styleable.RoundProgressBar_roundWidth, 4);
    max = mTypedArray.getInteger(R.styleable.RoundProgressBar_max, 100);
    textIsDisplayable = mTypedArray.getBoolean(R.styleable.RoundProgressBar_textIsDisplayable, true);
    style = mTypedArray.getInt(R.styleable.RoundProgressBar_style, STROKE);

    mTypedArray.recycle();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号