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;
}
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);
}
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();
}
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();
}
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();
}
Aggregations