ColorChip.java 文件源码

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

项目:k-9-master 作者:
public ColorChip(int color, boolean messageRead, Path shape) {

        if (shape.equals(STAR)) {
            mDrawable = new ShapeDrawable(new PathShape(shape, 280f, 280f));

        } else {
            mDrawable = new ShapeDrawable(new PathShape(shape, 320f, 320f));
        }
        if (shape.equals(CHECKMARK)) {
            mDrawable.getPaint().setStrokeWidth(50);
        } else {
            mDrawable.getPaint().setStrokeWidth(20);
        }
        if (messageRead) {
            // Read messages get an outlined circle
            mDrawable.getPaint().setStyle(Paint.Style.STROKE);
        } else {
            // Unread messages get filled, while retaining the outline, so that they stay the same size
            mDrawable.getPaint().setStyle(Paint.Style.FILL_AND_STROKE);

        }
        mDrawable.getPaint().setColor(color);


    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号