Code example for Paint

Methods: setStrokeWidthsetStyle

0
        private Paint mPaint;
 
        public PathsView(Context context) {
            super(context);
 
            mPaint = new Paint();
            mPaint.setStyle(Paint.Style.STROKE);
            mPaint.setStrokeWidth(3);
 
            mPath = new Path();
            mPath.lineTo(100, 100);
            mPath.lineTo(200, 300);
        } 
 
        @Override 
        protected void onDraw(Canvas canvas) {
            mPath.offset(1, 1);
            mPaint.setColor(Color.RED);
            canvas.drawPath(mPath, mPaint);
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE