MyRoundCornerDrawable.java 文件源码

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

项目:phonk 作者:
@Override
public void draw(Canvas canvas) {
    int height = getBounds().height();
    int width = getBounds().width();

    // allow drawing out of bounds vertically
    Rect clipBounds = canvas.getClipBounds();
    clipBounds.inset(-12, -12);
    canvas.clipRect(clipBounds, Region.Op.REPLACE);

    RectF rect = new RectF(0.0f, 0.0f, width, height);

    // background
    canvas.drawRoundRect(rect, mRadius, mRadius, mPaintBg);

    // border
    canvas.drawRoundRect(rect, mRadius, mRadius, mPaintBorder);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号