Search in sources :

Example 76 with Paint

use of android.graphics.Paint in project UltimateAndroid by cymcsg.

the class RippleBackground method drawSoftware.

private boolean drawSoftware(Canvas c, Paint p) {
    boolean hasContent = false;
    p.setColor(mColorOpaque);
    final int outerAlpha = (int) (mColorAlpha * mOuterOpacity + 0.5f);
    if (outerAlpha > 0 && mOuterRadius > 0) {
        p.setAlpha(outerAlpha);
        p.setStyle(Style.FILL);
        c.drawCircle(mOuterX, mOuterY, mOuterRadius, p);
        hasContent = true;
    }
    return hasContent;
}
Also used : Paint(android.graphics.Paint)

Example 77 with Paint

use of android.graphics.Paint in project UltimateAndroid by cymcsg.

the class CirclesDrawable method initCirclesProgress.

private void initCirclesProgress(int[] colors) {
    initColors(colors);
    mPath = new Path();
    Paint basePaint = new Paint();
    basePaint.setAntiAlias(true);
    mFstHalfPaint = new Paint(basePaint);
    mScndHalfPaint = new Paint(basePaint);
    mAbovePaint = new Paint(basePaint);
    setColorFilter(mColorFilter);
}
Also used : Path(android.graphics.Path) Paint(android.graphics.Paint)

Example 78 with Paint

use of android.graphics.Paint in project UltimateAndroid by cymcsg.

the class DownloadProgressBar method init.

private void init() {
    mCirclePaint = new Paint();
    mCirclePaint.setFlags(Paint.ANTI_ALIAS_FLAG);
    mCirclePaint.setStyle(Paint.Style.STROKE);
    mCirclePaint.setColor(mCircleBackgroundColor);
    mCirclePaint.setStrokeWidth(mStrokeWidth);
    mDrawingPaint = new Paint();
    mDrawingPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
    mDrawingPaint.setStyle(Paint.Style.STROKE);
    mDrawingPaint.setColor(mDrawingColor);
    mDrawingPaint.setStrokeWidth(mLineWidth);
    mProgressPaint = new Paint();
    mProgressPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
    mProgressPaint.setColor(mProgressColor);
    mProgressPaint.setStyle(Paint.Style.FILL);
    mProgressBackgroundPaint = new Paint();
    mProgressBackgroundPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
    mProgressBackgroundPaint.setColor(mProgressBackgroundColor);
    mProgressBackgroundPaint.setStyle(Paint.Style.FILL);
    mState = State.IDLE;
    setupAnimations();
}
Also used : Paint(android.graphics.Paint)

Example 79 with Paint

use of android.graphics.Paint in project UltimateAndroid by cymcsg.

the class HoloCircularProgressBar method updateMarkerColor.

/**
	 * updates the paint of the marker
	 */
private void updateMarkerColor() {
    mMarkerColorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mMarkerColorPaint.setColor(mProgressBackgroundColor);
    mMarkerColorPaint.setStyle(Paint.Style.STROKE);
    mMarkerColorPaint.setStrokeWidth(mCircleStrokeWidth / 2);
    invalidate();
}
Also used : Paint(android.graphics.Paint)

Example 80 with Paint

use of android.graphics.Paint in project UltimateAndroid by cymcsg.

the class HoloCircularProgressBar method updateProgressColor.

/**
	 * updates the paint of the progress and the thumb to give them a new visual
	 * style
	 */
private void updateProgressColor() {
    mProgressColorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mProgressColorPaint.setColor(mProgressColor);
    mProgressColorPaint.setStyle(Paint.Style.STROKE);
    mProgressColorPaint.setStrokeWidth(mCircleStrokeWidth);
    mThumbColorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mThumbColorPaint.setColor(mProgressColor);
    mThumbColorPaint.setStyle(Paint.Style.FILL_AND_STROKE);
    mThumbColorPaint.setStrokeWidth(mCircleStrokeWidth);
    invalidate();
}
Also used : Paint(android.graphics.Paint)

Aggregations

Paint (android.graphics.Paint)3611 Canvas (android.graphics.Canvas)815 Bitmap (android.graphics.Bitmap)735 RectF (android.graphics.RectF)484 Rect (android.graphics.Rect)400 Path (android.graphics.Path)281 TextPaint (android.text.TextPaint)269 PorterDuffXfermode (android.graphics.PorterDuffXfermode)232 Matrix (android.graphics.Matrix)173 SuppressLint (android.annotation.SuppressLint)148 Point (android.graphics.Point)147 TypedArray (android.content.res.TypedArray)134 BitmapShader (android.graphics.BitmapShader)117 View (android.view.View)103 Drawable (android.graphics.drawable.Drawable)99 BitmapDrawable (android.graphics.drawable.BitmapDrawable)92 ColorMatrix (android.graphics.ColorMatrix)76 ColorMatrixColorFilter (android.graphics.ColorMatrixColorFilter)66 Resources (android.content.res.Resources)65 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)57