Best code examples for Android Path class (android.graphics.Path)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Path class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Path examples from Open Source projects
This code example shows how to use the following methods: close, lineTo, moveTo
64:	Path path = new Path(); 
65:	path.moveTo(left, top); 
66:	path.lineTo(right, top); 
67:	path.lineTo(right, bottom); 
68:	path.lineTo(left, bottom); 
69:	path.close(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: close, lineTo
37:	path = new Path(); 
-
43:	path.close(); 
-
45:	path.lineTo(1.0f, 1.0f); 
46:	path.lineTo(0.0f, 2.0f); 
47:	path.lineTo(0.0f, 0.0f); 
48:	path.close(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: cubicTo, moveTo
50:	Path path = new Path(); 
-
56:	path.moveTo(0.0f, 0.0f); 
57:	path.cubicTo(0.0f, 0.0f, 100.0f, 150.0f, 100.0f, 200.0f); 
58:	path.cubicTo(100.0f, 200.0f, 50.0f, 300.0f, -80.0f, 200.0f); 
59:	path.cubicTo(-80.0f, 200.0f, 100.0f, 200.0f, 200.0f, 0.0f); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo
66:	Path path = new Path(); 
67:	path.moveTo(getWidth() * (0.5f - 0.5f * start / max), 0); 
68:	path.lineTo(getWidth() * (0.5f + 0.5f * start / max), 0); 
69:	path.lineTo(getWidth() * (0.5f + 0.5f * end / max), getHeight()); 
70:	path.lineTo(getWidth() * (0.5f - 0.5f * end / max), getHeight()); 
71:	path.close(); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: lineTo, moveTo
197:	Path path = new Path(); 
198:	path.moveTo(p1.x, p1.y); 
199:	path.lineTo(p2.x, p2.y); 
200:	path.lineTo(p3.x, p3.y); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: close, cubicTo, lineTo, moveTo, reset
112:	mColorPath.reset(); 
-
118:	mColorPath.moveTo(indicatorLeft, mRect.top); 
119:	mColorPath.cubicTo(indicatorLeft, midBottomY, 
-
122:	mColorPath.lineTo(width+xoff-1, 0); 
123:	mColorPath.cubicTo(width+xoff-1, midTopY, 
-
126:	mColorPath.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo
64:	Path path = new Path(); 
65:	path.moveTo(left, top); 
66:	path.lineTo(right, top); 
67:	path.lineTo(right, bottom); 
68:	path.lineTo(left, bottom); 
69:	path.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo
24:	path = new Path(); 
25:	path.moveTo(0, 0); 
26:	path.lineTo(width, 0); 
27:	path.lineTo(width, height); 
28:	path.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, computeBounds, lineTo, moveTo, quadTo
268:	mPath.reset(); 
269:	mPath.moveTo(mX1, mY1); 
270:	mPath.quadTo(mCtrlx, mCtrly, mX2, mY2); 
-
272:	mPath.computeBounds(rectBuffer, false); 
-
275:	mPath.lineTo(mX2 + 1, mY2); 
276:	mPath.quadTo(mCtrlx + 1, mCtrly, mX1 + 1, mY1); 
277:	mPath.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close, computeBounds, cubicTo, lineTo, moveTo
287:	mPath.reset(); 
288:	mPath.moveTo(mX1, mY1); 
289:	mPath.cubicTo(mCtrlx1, mCtrly1, mCtrlx2, mCtrly2, mX2, mY2); 
-
292:	mPath.computeBounds(rect, false); 
-
296:	mPath.lineTo(mX2 + 1, mY2); 
297:	mPath.cubicTo(mCtrlx2 + 1, mCtrly2, mCtrlx1 + 1, mCtrly1, mX1 + 1, mY1); 
298:	mPath.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addRoundRect
73:	Path path = new Path(); 
74:	path.addRoundRect(rectF, (float)cornerRadius, (float)cornerRadius, Path.Direction.CCW); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: close
73:	path.close(); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: lineTo, moveTo
144:	Path path = new Path(); 
145:	path.moveTo(strokewidth, (strokewidth / 2)); 
146:	path.lineTo(canvas.getWidth() / 2, (strokewidth / 2)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: lineTo, moveTo, reset
132:	path.reset(); 
133:	path.moveTo(l, b); 
134:	path.lineTo(l, t + mAvatar.getFarOffset()); 
-
137:	path.reset(); 
138:	path.moveTo(l, t); 
139:	path.lineTo(l, t + mAvatar.getCloseOffset()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo
101:	path.moveTo(cx - width / 2.0f, cy); 
102:	path.lineTo(cx, cy + height); 
103:	path.lineTo(cx + width / 2.0f, cy); 
104:	path.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addArc
76:	final Path fillPath = new Path(); 
77:	fillPath.addArc(circleRect, 0f, 360f); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addCircle
54:	mPath = new Path(); 
55:	mPath.addCircle(SIZE * 0.5f, SIZE * 0.5f, SIZE * 0.275f, Path.Direction.CW); 
56:	mPath.addCircle(SIZE * 0.5f, SIZE * 0.5f, SIZE * 0.225f, Path.Direction.CCW); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: cubicTo, moveTo
49:	Path path = new Path(); 
-
55:	path.moveTo(0.0f, 0.0f); 
56:	path.cubicTo(0.0f, 0.0f, 100.0f, 150.0f, 100.0f, 200.0f); 
57:	path.cubicTo(100.0f, 200.0f, 50.0f, 300.0f, -80.0f, 200.0f); 
58:	path.cubicTo(-80.0f, 200.0f, 100.0f, 200.0f, 200.0f, 0.0f); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: arcTo, close, lineTo, reset
97:	this.mPath = new Path(); 
-
475:	mPath.reset(); 
-
482:	mPath.arcTo(mOval, mStartAngle, mAngleExtent); 
-
484:	mPath.lineTo(mOval.centerX(), mOval.centerY()); 
-
486:	mPath.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo, rewind
55:	mIndicatorPath.rewind(); 
56:	mIndicatorPath.moveTo(xPos, 0); 
57:	mIndicatorPath.lineTo(xPos + height, height); 
58:	mIndicatorPath.lineTo(xPos - height, height); 
59:	mIndicatorPath.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: lineTo, moveTo, reset
134:	path.reset(); 
135:	path.moveTo(l, b); 
136:	path.lineTo(l, t + mAvatar.getFarOffset()); 
-
139:	path.reset(); 
140:	path.moveTo(l, t); 
141:	path.lineTo(l, t + mAvatar.getCloseOffset()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: lineTo, moveTo
89:	Path path = new Path(); 
90:	path.moveTo(mX1, mY1); 
91:	path.lineTo(mX2, mY2); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo, reset
47:	mPath.reset(); 
48:	mPath.moveTo(0, getHeight()); 
49:	mPath.lineTo(getWidth(), getHeight() / 2); 
50:	mPath.lineTo(0, 0); 
51:	mPath.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
35:	mBorderPath = new Path(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, reset, set
296:	mClosedTempPath.reset(); 
297:	mClosedTempPath.set(mPath); 
298:	mClosedTempPath.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: cubicTo, moveTo
45:	Path path = new Path(); 
-
51:	path.moveTo(0.0f, 0.0f); 
52:	path.cubicTo(0.0f, 0.0f, 100.0f, 150.0f, 100.0f, 200.0f); 
53:	path.cubicTo(100.0f, 200.0f, 50.0f, 300.0f, -80.0f, 200.0f); 
54:	path.cubicTo(-80.0f, 200.0f, 100.0f, 200.0f, 200.0f, 0.0f); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: lineTo, moveTo
106:	Path glarePath = new Path(); 
107:	glarePath.moveTo(rect.centerX()-rect.width()/2, rect.centerY()-rect.height()/2); 
108:	glarePath.lineTo(rect.centerX()-rect.width()/2, rect.centerY()+rect.height()/2-rect.height()/5); 
109:	glarePath.lineTo(rect.centerX()+rect.width()/2, rect.centerY()-rect.height()/2+rect.height()/5); 
110:	glarePath.lineTo(rect.centerX()+rect.width()/2, rect.centerY()-rect.height()/2); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: close, lineTo, moveTo
39:	Path path = new Path(); 
40:	path.moveTo(x1, y1); 
41:	path.lineTo(x2, y2); 
42:	path.lineTo(x3, y3); 
43:	path.close(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addArc
97:	final Path fillPath = new Path(); 
98:	fillPath.addArc(circleRect, 0f, 360f); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addCircle
54:	mPath = new Path(); 
55:	mPath.addCircle(SIZE * 0.5f, SIZE * 0.5f, SIZE * 0.275f, Path.Direction.CW); 
56:	mPath.addCircle(SIZE * 0.5f, SIZE * 0.5f, SIZE * 0.225f, Path.Direction.CCW); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addOval, addRect, lineTo, moveTo, setFillType
102:	Path path = new Path(); 
-
112:	path.setFillType(Path.FillType.WINDING); 
-
114:	path.addOval(oval, Path.Direction.CCW); 
-
117:	path.addRect(line, Path.Direction.CW); 
-
120:	path.addRect(line, Path.Direction.CCW); 
-
123:	path.moveTo(left.x, left.y); 
124:	path.moveTo(right.x, right.y); 
125:	path.lineTo(right.x - width * (float) Math.cos(angle - Math.PI / 6) ,right.y - width * (float) Math.sin(angle - Math.PI / 6) ); 
126:	path.moveTo(right.x, right.y); 
127:	path.lineTo(right.x - width * (float) Math.cos(angle + Math.PI / 6) ,right.y - width * (float) Math.sin(angle + Math.PI / 6) ); 
128:	path.lineTo(right.x - width * (float) Math.cos(angle - Math.PI / 6) ,right.y - width * (float) Math.sin(angle - Math.PI / 6) ); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
58:	private Path mPathOutline = new Path(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: lineTo, moveTo
609:	mPath = new Path(); 
610:	mPath.moveTo(0, 0); 
611:	mPath.lineTo((float)Math.cos(-CORNER_ANGLE) * mSize, 
-
613:	mPath.lineTo(mSize, 0); 
614:	mPath.lineTo((float)Math.cos(CORNER_ANGLE) * mSize, 
-
616:	mPath.lineTo(0, 0); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods:
66:	public Path pathSide = new Path(); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: lineTo, moveTo
609:	mHeadingX = x; 
610:	mHeadingY = y; 
611:	updateHeading(); 
-
613:	 
614:	private void updateHeading() { 
-
616:	if (mHeadingMagnitude > 0.1f) { 
Full Snippet Info
7
CodeRank
Related Android Path Questions & Answers:
See Code Examples for Android Path Methods: