Code example for Vector

Methods: add

0
 */ 
public class Doodle implements Parcelable {
 
    private final int color;
    private final Path normalizedPath = new Path();
    private final Vector<PointF> points = new Vector<PointF>();
 
    /** 
     * Creates paint for doodles. 
     */ 
    public static Paint createPaint() {
        Paint paint = new Paint(Paint.DITHER_FLAG | Paint.ANTI_ALIAS_FLAG);
        paint.setStyle(Paint.Style.STROKE);
        paint.setStrokeJoin(Paint.Join.ROUND);
        paint.setStrokeCap(Paint.Cap.ROUND);
        paint.setStrokeWidth(15);
        return paint;
    } 
 
    public Doodle(int color, PointF startPoint) {
        this.color = Color.argb(192, Color.red(color), Color.green(color), Color.blue(color));
        normalizedPath.moveTo(startPoint.x, startPoint.y);
        points.add(startPoint);
    } 
 
    /** 
     * Adds control points whose coordinates range from 0 to 1 to construct the doodle path. 
     *