SelectableRoundedImageView.java 文件源码

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

项目:boohee_v5.6 作者:
public void draw(Canvas canvas) {
    canvas.save();
    if (!this.mBoundsConfigured) {
        configureBounds(canvas);
        if (this.mBorderWidth > 0.0f) {
            adjustBorderWidthAndBorderBounds(canvas);
            setBorderRadii();
        }
        this.mBoundsConfigured = true;
    }
    if (this.mOval) {
        if (this.mBorderWidth > 0.0f) {
            adjustCanvasForBorder(canvas);
            this.mPath.addOval(this.mBounds, Direction.CW);
            canvas.drawPath(this.mPath, this.mBitmapPaint);
            this.mPath.reset();
            this.mPath.addOval(this.mBorderBounds, Direction.CW);
            canvas.drawPath(this.mPath, this.mBorderPaint);
        } else {
            this.mPath.addOval(this.mBounds, Direction.CW);
            canvas.drawPath(this.mPath, this.mBitmapPaint);
        }
    } else if (this.mBorderWidth > 0.0f) {
        adjustCanvasForBorder(canvas);
        this.mPath.addRoundRect(this.mBounds, this.mRadii, Direction.CW);
        canvas.drawPath(this.mPath, this.mBitmapPaint);
        this.mPath.reset();
        this.mPath.addRoundRect(this.mBorderBounds, this.mBorderRadii, Direction.CW);
        canvas.drawPath(this.mPath, this.mBorderPaint);
    } else {
        this.mPath.addRoundRect(this.mBounds, this.mRadii, Direction.CW);
        canvas.drawPath(this.mPath, this.mBitmapPaint);
    }
    canvas.restore();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号