RDownloadView.java 文件源码

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

项目:RLibrary 作者:
private void initView(Context context) {
        normalDrawable = ContextCompat.getDrawable(getContext(), R.drawable.base_icon_download);
        finishDrawable = ContextCompat.getDrawable(getContext(), R.drawable.base_icon_yixiazai);
        if (isInEditMode()) {
            SkinHelper.init(context);
        } else {
            finishDrawable.mutate().setColorFilter(SkinHelper.getSkin().getThemeSubColor(), PorterDuff.Mode.MULTIPLY);
        }

        normalDrawable.setBounds(0, 0, normalDrawable.getIntrinsicWidth(), normalDrawable.getIntrinsicHeight());
        finishDrawable.setBounds(0, 0, normalDrawable.getIntrinsicWidth(), normalDrawable.getIntrinsicHeight());

        mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        mStrokeWidth = 2 * getResources().getDisplayMetrics().density;
        mPaint.setStrokeWidth(mStrokeWidth);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeCap(Paint.Cap.ROUND);//设置笔触的模式
//        mPaint.setStrokeJoin(Paint.Join.ROUND);//设置连接模式, 在绘制矩形各个角的时候有效果

        oval = new RectF();
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号