use of android.graphics.Path in project platform_frameworks_base by android.
the class RadialTimePickerView method onDraw.
@Override
public void onDraw(Canvas canvas) {
final float alphaMod = mInputEnabled ? 1 : mDisabledAlpha;
drawCircleBackground(canvas);
final Path selectorPath = mSelectorPath;
drawSelector(canvas, selectorPath);
drawHours(canvas, selectorPath, alphaMod);
drawMinutes(canvas, selectorPath, alphaMod);
drawCenter(canvas, alphaMod);
}
use of android.graphics.Path in project JamsMusicPlayer by psaravan.
the class PicassoDrawable method drawDebugIndicator.
private void drawDebugIndicator(Canvas canvas) {
DEBUG_PAINT.setColor(WHITE);
Path path = getTrianglePath(new Point(0, 0), (int) (16 * density));
canvas.drawPath(path, DEBUG_PAINT);
DEBUG_PAINT.setColor(loadedFrom.debugColor);
path = getTrianglePath(new Point(0, 0), (int) (15 * density));
canvas.drawPath(path, DEBUG_PAINT);
}
use of android.graphics.Path in project JamsMusicPlayer by psaravan.
the class PicassoDrawable method getTrianglePath.
private static Path getTrianglePath(Point p1, int width) {
Point p2 = new Point(p1.x + width, p1.y);
Point p3 = new Point(p1.x, p1.y + width);
Path path = new Path();
path.moveTo(p1.x, p1.y);
path.lineTo(p2.x, p2.y);
path.lineTo(p3.x, p3.y);
return path;
}
use of android.graphics.Path in project JamsMusicPlayer by psaravan.
the class Pin method init.
private void init() {
mPath = new Path();
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setStyle(Paint.Style.FILL);
setColor(mPinColor);
}
use of android.graphics.Path in project Genius-Android by qiujuer.
the class BalloonMarkerDrawable method computePath.
private void computePath(Rect bounds) {
final float currentScale = mCurrentScale;
final Path path = mPath;
final RectF rect = mRect;
final Matrix matrix = mMatrix;
path.reset();
int totalSize = Math.min(bounds.width(), bounds.height());
float initial = mClosedStateSize;
float currentSize = initial + ((float) totalSize - initial) * currentScale;
float halfSize = currentSize / 2f;
float inverseScale = 1f - currentScale;
float cornerSize = halfSize * inverseScale;
float[] corners = new float[] { halfSize, halfSize, halfSize, halfSize, halfSize, halfSize, cornerSize, cornerSize };
rect.set(bounds.left, bounds.top, bounds.left + currentSize, bounds.top + currentSize);
path.addRoundRect(rect, corners, Path.Direction.CCW);
matrix.reset();
matrix.postRotate(-45, bounds.left + halfSize, bounds.top + halfSize);
matrix.postTranslate((bounds.width() - currentSize) / 2, 0);
float hDiff = (bounds.bottom - currentSize - mExternalOffset) * inverseScale;
matrix.postTranslate(0, hDiff);
path.transform(matrix);
}
Aggregations