use of android.graphics.Paint in project VirtualApp by asLody.
the class LauncherIconView method init.
private void init(Context context, AttributeSet attrs) {
mMediumAnimTime = getContext().getResources().getInteger(android.R.integer.config_mediumAnimTime);
final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ProgressImageView);
try {
this.mProgress = a.getInteger(R.styleable.ProgressImageView_pi_progress, 0);
this.mStrokeWidth = a.getDimensionPixelOffset(R.styleable.ProgressImageView_pi_stroke, 8);
this.mRadius = a.getDimensionPixelOffset(R.styleable.ProgressImageView_pi_radius, 0);
this.mIsSquare = a.getBoolean(R.styleable.ProgressImageView_pi_force_square, false);
this.mMaskColor = a.getColor(R.styleable.ProgressImageView_pi_mask_color, Color.argb(180, 0, 0, 0));
this.mPaint = new Paint();
mPaint.setColor(mMaskColor);
mPaint.setAntiAlias(true);
this.mShimmerPaint = new Paint();
mShimmerPaint.setColor(Color.WHITE);
} finally {
a.recycle();
}
mShimmerViewHelper = new ShimmerViewHelper(this, mShimmerPaint, attrs);
}
use of android.graphics.Paint in project StepView by baoyachi.
the class VerticalStepViewIndicator method init.
/**
* init
*/
private void init() {
mPath = new Path();
mEffects = new DashPathEffect(new float[] { 8, 8, 8, 8 }, 1);
//初始化
mCircleCenterPointPositionList = new ArrayList<>();
mUnCompletedPaint = new Paint();
mCompletedPaint = new Paint();
mUnCompletedPaint.setAntiAlias(true);
mUnCompletedPaint.setColor(mUnCompletedLineColor);
mUnCompletedPaint.setStyle(Paint.Style.STROKE);
mUnCompletedPaint.setStrokeWidth(2);
mCompletedPaint.setAntiAlias(true);
mCompletedPaint.setColor(mCompletedLineColor);
mCompletedPaint.setStyle(Paint.Style.STROKE);
mCompletedPaint.setStrokeWidth(2);
mUnCompletedPaint.setPathEffect(mEffects);
mCompletedPaint.setStyle(Paint.Style.FILL);
//已经完成线的宽高 set mCompletedLineHeight
mCompletedLineHeight = 0.05f * defaultStepIndicatorNum;
//圆的半径 set mCircleRadius
mCircleRadius = 0.28f * defaultStepIndicatorNum;
//线与线之间的间距 set mLinePadding
mLinePadding = 0.85f * defaultStepIndicatorNum;
//已经完成的icon
mCompleteIcon = ContextCompat.getDrawable(getContext(), R.drawable.complted);
//正在进行的icon
mAttentionIcon = ContextCompat.getDrawable(getContext(), R.drawable.attention);
//未完成的icon
mDefaultIcon = ContextCompat.getDrawable(getContext(), R.drawable.default_icon);
//default draw
mIsReverseDraw = true;
}
use of android.graphics.Paint in project StickyHeaderListView by sfsheng0322.
the class GlideCircleTransform method circleCrop.
private static Bitmap circleCrop(BitmapPool pool, Bitmap source) {
if (source == null)
return null;
int size = Math.min(source.getWidth(), source.getHeight());
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap squared = Bitmap.createBitmap(source, x, y, size, size);
Bitmap result = pool.get(size, size, Bitmap.Config.ARGB_8888);
if (result == null) {
result = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
}
Canvas canvas = new Canvas(result);
Paint paint = new Paint();
paint.setShader(new BitmapShader(squared, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP));
paint.setAntiAlias(true);
float r = size / 2f;
canvas.drawCircle(r, r, r, paint);
return result;
}
use of android.graphics.Paint in project CircleBar by songnick.
the class RefreshProgress method drawSlowIndicator.
private void drawSlowIndicator(float startAngle, Canvas canvas) {
Paint circlePaint = new Paint();
circlePaint.setAntiAlias(true);
circlePaint.setColor(Color.parseColor("#A8D7A7"));
circlePaint.setStrokeWidth(7);
circlePaint.setStyle(Paint.Style.STROKE);
canvas.drawPath(getArcPath(), circlePaint);
int restoreCount = canvas.save();
canvas.translate(rectF.centerX(), rectF.centerY());
circlePaint.setStyle(Paint.Style.FILL);
canvas.drawPath(getBallPath(startAngle + 90), circlePaint);
canvas.drawPath(getBallPath(startAngle + 90 + 30 + 90), circlePaint);
canvas.drawPath(getBallPath(startAngle + 90 + 30 + 90 + 30 + 90), circlePaint);
canvas.restoreToCount(restoreCount);
}
use of android.graphics.Paint in project CircleBar by songnick.
the class IndicatorRadioButton method initPaint.
private void initPaint() {
mPaint = new Paint();
mPaint.setStrokeWidth(getResources().getDimension(R.dimen.default_size));
mPaint.setAntiAlias(true);
}
Aggregations