Search in sources :

Example 71 with Path

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);
}
Also used : Path(android.graphics.Path)

Example 72 with Path

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);
}
Also used : Path(android.graphics.Path) Point(android.graphics.Point)

Example 73 with Path

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;
}
Also used : Path(android.graphics.Path) Point(android.graphics.Point)

Example 74 with 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);
}
Also used : Path(android.graphics.Path) Paint(android.graphics.Paint)

Example 75 with Path

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);
}
Also used : Path(android.graphics.Path) RectF(android.graphics.RectF) Matrix(android.graphics.Matrix) Paint(android.graphics.Paint)

Aggregations

Path (android.graphics.Path)631 Paint (android.graphics.Paint)237 RectF (android.graphics.RectF)142 Rect (android.graphics.Rect)40 Canvas (android.graphics.Canvas)39 Matrix (android.graphics.Matrix)36 TextPaint (android.text.TextPaint)27 Bitmap (android.graphics.Bitmap)26 ObjectAnimator (android.animation.ObjectAnimator)18 LinearGradient (android.graphics.LinearGradient)18 PointF (android.graphics.PointF)18 Point (android.graphics.Point)16 View (android.view.View)16 RadialGradient (android.graphics.RadialGradient)15 Animator (android.animation.Animator)13 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)12 PathMeasure (android.graphics.PathMeasure)11 PropertyValuesHolder (android.animation.PropertyValuesHolder)10 InflateException (android.view.InflateException)10 ViewGroup (android.view.ViewGroup)10