use of android.graphics.Paint in project UltimateAndroid by cymcsg.
the class HoloCircularProgressBar method updateBackgroundColor.
/**
* updates the paint of the background
*/
private void updateBackgroundColor() {
mBackgroundColorPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBackgroundColorPaint.setColor(mProgressBackgroundColor);
mBackgroundColorPaint.setStyle(Paint.Style.STROKE);
mBackgroundColorPaint.setStrokeWidth(mCircleStrokeWidth);
invalidate();
}
use of android.graphics.Paint in project UltimateAndroid by cymcsg.
the class TimelyView method init.
private void init() {
// A new paint with the style as stroke.
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.BLACK);
mPaint.setStrokeWidth(5.0f);
mPaint.setStyle(Paint.Style.STROKE);
mPath = new Path();
}
use of android.graphics.Paint in project phonegap-plugin-push by phonegap.
the class GCMIntentService method getCircleBitmap.
private Bitmap getCircleBitmap(Bitmap bitmap) {
final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
final Canvas canvas = new Canvas(output);
final int color = Color.RED;
final Paint paint = new Paint();
final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
final RectF rectF = new RectF(rect);
paint.setAntiAlias(true);
canvas.drawARGB(0, 0, 0, 0);
paint.setColor(color);
float cx = bitmap.getWidth() / 2;
float cy = bitmap.getHeight() / 2;
float radius = cx < cy ? cx : cy;
canvas.drawCircle(cx, cy, radius, paint);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
canvas.drawBitmap(bitmap, rect, rect, paint);
bitmap.recycle();
return output;
}
use of android.graphics.Paint in project plaid by nickbutcher.
the class ThreadedCommentDrawable method draw.
@Override
public void draw(Canvas canvas) {
for (int thread = 0; thread < threads; thread++) {
int left = halfThreadWidth + (thread * (threadWidth + gap));
canvas.drawLine(left, 0, left, getBounds().bottom, paint);
}
}
use of android.graphics.Paint in project plaid by nickbutcher.
the class GridItemDividerDecoration method onDrawOver.
@Override
public void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
if (parent.isAnimating())
return;
final int childCount = parent.getChildCount();
final RecyclerView.LayoutManager lm = parent.getLayoutManager();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
RecyclerView.ViewHolder viewHolder = parent.getChildViewHolder(child);
if (requiresDivider(viewHolder)) {
final int right = lm.getDecoratedRight(child);
final int bottom = lm.getDecoratedBottom(child);
// draw the bottom divider
canvas.drawRect(lm.getDecoratedLeft(child), bottom - dividerSize, right, bottom, paint);
// draw the right edge divider
canvas.drawRect(right - dividerSize, lm.getDecoratedTop(child), right, bottom - dividerSize, paint);
}
}
}
Aggregations