Code example for Path

Methods: lineTo

0
 
            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);
        } 
 
        @Override 
        public boolean onTouchEvent(MotionEvent event) {
            invalidate();
            return super.onTouchEvent(event);