BooheeCircleProgressBar.java 文件源码

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

项目:boohee_v5.6 作者:
protected void onDraw(Canvas canvas) {
    super.onDraw(canvas);
    int width = getWidth();
    int height = getHeight();
    if (width != height) {
        int min = Math.min(width, height);
        width = min;
        height = min;
    }
    this.paint.setAntiAlias(true);
    this.paint.setColor(-1);
    canvas.drawColor(0);
    this.paint.setStrokeWidth((float) this.progressStrokeWidth);
    this.paint.setStyle(Style.STROKE);
    this.oval.left = (float) (this.progressStrokeWidth / 2);
    this.oval.top = (float) (this.progressStrokeWidth / 2);
    this.oval.right = (float) (width - (this.progressStrokeWidth / 2));
    this.oval.bottom = (float) (height - (this.progressStrokeWidth / 2));
    this.paint.setColor(Color.parseColor("#4cd964"));
    canvas.drawArc(this.oval, -90.0f, 360.0f * (((float) this.progress) / ((float) this
            .maxProgress)), false, this.paint);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号