Java Code Examples for android.graphics.Paint.setStrokeJoin()

The following are Jave code examples for showing how to use setStrokeJoin() of the android.graphics.Paint class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: ImageEraser   File: MainActivity.java   View Source Code Vote up 6 votes
public void UpdateCanvas() {
    canvasMaster.drawColor(0, Mode.CLEAR);
    canvasMaster.drawBitmap(lastEditedBitmap, 0.0f, 0.0f, null);
    int i = 0;
    while (true) {
        if (i >= paths.size()) {
            break;
        }
        int brushSize = brushSizes.get(i);
        Paint paint = new Paint();
        paint.setColor(0);
        paint.setStyle(Style.STROKE);
        paint.setAntiAlias(true);
        paint.setStrokeJoin(Join.ROUND);
        paint.setStrokeCap(Cap.ROUND);
        paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
        paint.setStrokeWidth((float) brushSize);
        canvasMaster.drawPath(paths.get(i), paint);
        i += 1;
    }
    touchImageView.invalidate();
}
 
Example 2
Project: filepicker   File: TuyaView.java   View Source Code Vote up 6 votes
private void setPaintStyle() {
    mPaint = new Paint();
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);
    mPaint.setAntiAlias(true);
    mPaint.setDither(true);
    if (currentStyle == 1) {
        mPaint.setStrokeWidth(currentSize);
        mPaint.setColor(currentColor);
    } else {
        mPaint.setAlpha(0);
        mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
        mPaint.setColor(Color.TRANSPARENT);
        mPaint.setStrokeWidth(50);
    }

    mMaskPaint = new Paint();
    mMaskPaint.setStrokeWidth(3);
    mMaskPaint.setTextAlign(Paint.Align.RIGHT);
    mMaskPaint.setColor(Color.GREEN);
    mMaskPaint.setTextSize(40);
}
 
Example 3
Project: EasyChart   File: EasyGraphHistogram.java   View Source Code Vote up 6 votes
private void init() {
    borderPaint = new Paint();
    borderPaint.setColor(borderColor);
    borderPaint.setStyle(Paint.Style.STROKE);
    borderPaint.setStrokeWidth(borderWidth);
    rectPaint = new Paint();
    rectPaint.setColor(rectColor);
    rectPaint.setStyle(Paint.Style.FILL);
    linePaint = new Paint();
    linePaint.setAntiAlias(true);
    linePaint.setColor(lineColor);
    linePaint.setStyle(Paint.Style.STROKE);
    linePaint.setStrokeWidth(lineWidth);
    linePaint.setStrokeJoin(Paint.Join.ROUND);
    textPaint = new TextPaint();
    textPaint.setAntiAlias(true);
    textPaint.setColor(textColor);
    textPaint.setTextSize(textSize);
    fm = textPaint.getFontMetrics();
    path = new Path();
    pathDst = new Path();
    pm = new PathMeasure();
    selectedIndex = -1;
}
 
Example 4
Project: MontageCam   File: CustomPaintView.java   View Source Code Vote up 6 votes
private void init(Context context) {
    mPaint = new Paint();
    mPaint.setAntiAlias(true);

    mPaint.setColor(Color.RED);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);


    mEraserPaint = new Paint();
    mEraserPaint.setAlpha(0);
    mEraserPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
    mEraserPaint.setAntiAlias(true);
    mEraserPaint.setDither(true);
    mEraserPaint.setStyle(Paint.Style.STROKE);
    mEraserPaint.setStrokeJoin(Paint.Join.ROUND);
    mEraserPaint.setStrokeCap(Paint.Cap.ROUND);
    mEraserPaint.setStrokeWidth(40);
}
 
Example 5
Project: open-rmbt   File: SimpleGraph.java   View Source Code Vote up 6 votes
private SimpleGraph(final int color, final long maxNsecs, final float width, final float height, final float strokeWidth)
{
    this.maxNsecs = maxNsecs;
    // this.width = width;
    this.height = height;
    nsecWidth = width / maxNsecs;
    
    paintStroke = new Paint();
    paintStroke.setColor(color);
    paintStroke.setAlpha(204); // 80%
    paintStroke.setStyle(Style.STROKE);
    paintStroke.setStrokeWidth(strokeWidth);
    paintStroke.setStrokeCap(Cap.ROUND);
    paintStroke.setStrokeJoin(Join.ROUND);
    paintStroke.setAntiAlias(true);
    
    paintFill = new Paint();
    paintFill.setColor(color);
    paintFill.setAlpha(51); // 20%
    paintFill.setStyle(Style.FILL);
    paintFill.setAntiAlias(true);
    
    pathStroke = new Path();
    pathFill = new Path();
}
 
Example 6
Project: ImageEraser   File: MainActivity.java   View Source Code Vote up 5 votes
public void UpdateLastEiditedBitmapForUndoLimit() {
    Canvas canvas = new Canvas(lastEditedBitmap);
    for (int i = 0; i < 1; i += 1) {
        int brushSize = brushSizes.get(i);
        Paint paint = new Paint();
        paint.setColor(0);
        paint.setStyle(Style.STROKE);
        paint.setAntiAlias(true);
        paint.setStrokeJoin(Join.ROUND);
        paint.setStrokeCap(Cap.ROUND);
        paint.setXfermode(new PorterDuffXfermode(Mode.SRC));
        paint.setStrokeWidth((float) brushSize);
        canvas.drawPath(paths.get(i), paint);
    }
}
 
Example 7
Project: Canvas-Library   File: CanvasView.java   View Source Code Vote up 5 votes
public CanvasView(Context c) {
    super(c);
    context = c;

    // we set a new Path
    mPath = new Path();

    // and we set a new Paint with the desired attributes
    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setColor(Color.BLACK);
    mPaint.setStyle(Paint.Style.STROKE);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeWidth(4f);
}
 
Example 8
Project: Melophile   File: CircularSeekBar.java   View Source Code Vote up 5 votes
/**
 * Initializes the {@code Paint} objects with the appropriate styles.
 */
private void initPaints() {
    mCirclePaint = new Paint();
    mCirclePaint.setAntiAlias(true);
    mCirclePaint.setDither(true);
    mCirclePaint.setColor(mCircleColor);
    mCirclePaint.setStrokeWidth(mCircleStrokeWidth);
    mCirclePaint.setStyle(Paint.Style.STROKE);
    mCirclePaint.setStrokeJoin(Paint.Join.ROUND);
    mCirclePaint.setStrokeCap(Paint.Cap.ROUND);

    mCircleFillPaint = new Paint();
    mCircleFillPaint.setAntiAlias(true);
    mCircleFillPaint.setDither(true);
    mCircleFillPaint.setColor(mCircleFillColor);
    mCircleFillPaint.setStyle(Paint.Style.FILL);

    mCircleProgressPaint = new Paint();
    mCircleProgressPaint.setAntiAlias(true);
    mCircleProgressPaint.setDither(true);
    mCircleProgressPaint.setColor(mCircleProgressColor);
    mCircleProgressPaint.setStrokeWidth(mCircleStrokeWidth);
    mCircleProgressPaint.setStyle(Paint.Style.STROKE);
    mCircleProgressPaint.setStrokeJoin(Paint.Join.ROUND);
    mCircleProgressPaint.setStrokeCap(Paint.Cap.ROUND);

    mCircleProgressGlowPaint = new Paint();
    mCircleProgressGlowPaint.set(mCircleProgressPaint);
    mCircleProgressGlowPaint.setMaskFilter(new BlurMaskFilter((5f * DPTOPX_SCALE), BlurMaskFilter.Blur.NORMAL));

    mPointerPaint = new Paint();
    mPointerPaint.setAntiAlias(true);
    mPointerPaint.setDither(true);
    mPointerPaint.setStyle(Paint.Style.FILL);
    mPointerPaint.setColor(mPointerColor);
    mPointerPaint.setStrokeWidth(mPointerRadius);

    mPointerHaloPaint = new Paint();
    mPointerHaloPaint.set(mPointerPaint);
    mPointerHaloPaint.setColor(mPointerHaloColor);
    mPointerHaloPaint.setAlpha(mPointerAlpha);
    mPointerHaloPaint.setStrokeWidth(mPointerRadius + mPointerHaloWidth);

    mPointerHaloBorderPaint = new Paint();
    mPointerHaloBorderPaint.set(mPointerPaint);
    mPointerHaloBorderPaint.setStrokeWidth(mPointerHaloBorderWidth);
    mPointerHaloBorderPaint.setStyle(Paint.Style.STROKE);

}
 
Example 9
Project: DoChart   File: LineDrawItem.java   View Source Code Vote up 5 votes
public LineDrawItem(){
    // 内部构造器
    mPaint = new Paint();
    mPaint.setAntiAlias(true);
    mPaint.setStrokeWidth(10);
    mPaint.setStrokeJoin(Paint.Join.ROUND);
    mPaint.setStrokeCap(Paint.Cap.ROUND);

}
 
Example 10
Project: Phoenix-for-VK   File: CircleRoadProgress.java   View Source Code Vote up 5 votes
private void drawRoad(Paint paint, Canvas canvas) {
    paint.setDither(true);
    paint.setColor(roadColor);
    paint.setStyle(Paint.Style.STROKE);
    paint.setStrokeWidth(roadStrokeWidth);
    paint.setStrokeCap(Paint.Cap.ROUND);
    paint.setStrokeJoin(Paint.Join.ROUND);
    canvas.drawCircle(circleCenterPointX, circleCenterPointY, roadRadius, paint);
}
 
Example 11
Project: PeSanKita-android   File: CanvasView.java   View Source Code Vote up 5 votes
/**
 * This method creates the instance of Paint.
 * In addition, this method sets styles for Paint.
 *
 * @return paint This is returned as the instance of Paint
 */
private Paint createPaint() {
  Paint paint = new Paint();

  paint.setAntiAlias(true);
  paint.setStyle(this.paintStyle);
  paint.setStrokeWidth(this.paintStrokeWidth);
  paint.setStrokeCap(this.lineCap);
  paint.setStrokeJoin(Paint.Join.MITER);  // fixed

  // for Text
  if (this.mode == Mode.TEXT) {
    paint.setTypeface(this.fontFamily);
    paint.setTextSize(this.fontSize);
    paint.setTextAlign(this.textAlign);
    paint.setStrokeWidth(0F);
  }

  if (this.mode == Mode.ERASER) {
    // Eraser
    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
    paint.setARGB(0, 0, 0, 0);

    // paint.setColor(this.baseColor);
    // paint.setShadowLayer(this.blur, 0F, 0F, this.baseColor);
  } else {
    // Otherwise
    paint.setColor(this.paintStrokeColor);
    paint.setShadowLayer(this.blur, 0F, 0F, this.paintStrokeColor);
    paint.setAlpha(this.opacity);
  }

  return paint;
}
 
Example 12
Project: Sega   File: SimpleRatingBar.java   View Source Code Vote up 5 votes
/**
 * Inits paint objects and default values.
 */
private void initView() {
    starPath = new Path();
    cornerPathEffect = new CornerPathEffect(starCornerRadius);

    paintStarOutline = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarOutline.setStyle(Paint.Style.FILL_AND_STROKE);
    paintStarOutline.setAntiAlias(true);
    paintStarOutline.setDither(true);
    paintStarOutline.setStrokeJoin(Paint.Join.ROUND);
    paintStarOutline.setStrokeCap(Paint.Cap.ROUND);
    paintStarOutline.setColor(Color.BLACK);
    paintStarOutline.setPathEffect(cornerPathEffect);

    paintStarBorder = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarBorder.setStyle(Paint.Style.STROKE);
    paintStarBorder.setStrokeJoin(Paint.Join.ROUND);
    paintStarBorder.setStrokeCap(Paint.Cap.ROUND);
    paintStarBorder.setStrokeWidth(starBorderWidth);
    paintStarBorder.setPathEffect(cornerPathEffect);

    paintStarBackground = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarBackground.setStyle(Paint.Style.FILL_AND_STROKE);
    paintStarBackground.setAntiAlias(true);
    paintStarBackground.setDither(true);
    paintStarBackground.setStrokeJoin(Paint.Join.ROUND);
    paintStarBackground.setStrokeCap(Paint.Cap.ROUND);

    paintStarFill = new Paint(Paint.ANTI_ALIAS_FLAG | Paint.DITHER_FLAG);
    paintStarFill.setStyle(Paint.Style.FILL_AND_STROKE);
    paintStarFill.setAntiAlias(true);
    paintStarFill.setDither(true);
    paintStarFill.setStrokeJoin(Paint.Join.ROUND);
    paintStarFill.setStrokeCap(Paint.Cap.ROUND);

    defaultStarSize = applyDimension(COMPLEX_UNIT_DIP, 30, getResources().getDisplayMetrics());
}
 
Example 13
Project: airgram   File: DrawingView.java   View Source Code Vote up 5 votes
private void init() {
  mPath = new Path();
  mBitmapPaint = new Paint(Paint.DITHER_FLAG);
  mPaint = new Paint();
  mPaint.setAntiAlias(true);
  mPaint.setDither(true);
  mPaint.setColor(Color.WHITE);
  mPaint.setStyle(Paint.Style.STROKE);
  mPaint.setStrokeJoin(Paint.Join.ROUND);
  mPaint.setStrokeCap(Paint.Cap.ROUND);
  mPaint.setStrokeWidth(mPenSize);
  mDrawMode = true;
  mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SCREEN));
}
 
Example 14
Project: Khonsu   File: MapNavActivity.java   View Source Code Vote up 5 votes
private void drawPaths(List<Path> paths) {
    mMap.draw(c);
    Paint paint = new Paint();
    paint.setColor(ContextCompat.getColor(this, R.color.grey500));
    paint.setStrokeWidth(10);
    paint.setStrokeJoin(Paint.Join.ROUND);
    for(Path path : paths){
        float startX = (float) (path.getStartX() * mapWidth);
        float endX = (float) (path.getEndX() * mapWidth);
        float startY = (float) (path.getStartY() * mapHeight);
        float endY = (float) (path.getEndY() * mapHeight);
        c.drawLine(startX, startY, endX, endY, paint);
    }
    mMap.setImageBitmap(bmp);
}
 
Example 15
Project: QiangHongBao   File: TagImageView.java   View Source Code Vote up 5 votes
private void init(Context context, AttributeSet attrs) {
	TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.TagImageView);
	mTagOrientation = ta.getInteger(R.styleable.TagImageView_tagOrientation, 0);
	mTagBackgroundColor = ta.getColor(R.styleable.TagImageView_tagBackgroundColor, mTagBackgroundColor);
	mCornerDistance = ta.getDimension(R.styleable.TagImageView_tagCornerDistance, mCornerDistance);
	mTagWidth = ta.getDimension(R.styleable.TagImageView_tagWidth, mTagWidth);
	String tagText = ta.getString(R.styleable.TagImageView_tagText);
	if (!TextUtils.isEmpty(tagText)) {
		mTagText = tagText;
	}
	mTagTextSize = ta.getDimension(R.styleable.TagImageView_tagTextSize, mTagTextSize);
	mTagTextColor = ta.getColor(R.styleable.TagImageView_tagTextColor, mTagTextColor);
	mTagTextDownX = ta.getDimension(R.styleable.TagImageView_tagTextDownX, mTagTextDownX);
	mTagTextRotate = ta.getInteger(R.styleable.TagImageView_tagTextRotate, mTagTextRotate);
	isEnable = ta.getBoolean(R.styleable.TagImageView_tagEnable, isEnable);
	ta.recycle();

	mStartPoint = new Point();
	mEndPoint = new Point();
	mTagTextBound = new Rect();

	mTagPath = new Path();

	mTagBgPaint = new Paint();
	mTagBgPaint.setAntiAlias(true);
	mTagBgPaint.setDither(true);
	mTagBgPaint.setStyle(Paint.Style.STROKE);
	mTagBgPaint.setStrokeJoin(Paint.Join.ROUND);
	mTagBgPaint.setStrokeCap(Paint.Cap.SQUARE);

	mTagTextPaint = new Paint();
	mTagBgPaint.setAntiAlias(true);
	mTagTextPaint.setDither(false);
}
 
Example 16
Project: Fitto   File: CanvasBoardView.java   View Source Code Vote up 4 votes
private void init(Context context, AttributeSet attrs) {
    TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs,
            R.styleable.CanvasBoardView, 0, 0);
    playerUser = typedArray.getString(R.styleable.CanvasBoardView_playerUser);
    playerComputer = typedArray.getString(R.styleable.CanvasBoardView_playerComputer);
    computerStoneColor = typedArray.getString(R.styleable.CanvasBoardView_computerStoneColor);
    userStoneColor = typedArray.getString(R.styleable.CanvasBoardView_userStoneColor);
    maximumInitialStones =
            typedArray.getInt(R.styleable.CanvasBoardView_maximumInitialStones, 8);
    stoneRadius = typedArray.getInt(R.styleable.CanvasBoardView_stoneRadius, 20);
    canvasMargin = typedArray.getInt(R.styleable.CanvasBoardView_margin, 20);
    userStonePaint = new Paint();
    userStonePaint.setAntiAlias(true);
    userStonePaint.setDither(true);
    userStonePaint.setColor(Color.parseColor(userStoneColor));
    userStonePaint.setStrokeWidth(stoneRadius);

    computerStonePaint = new Paint();
    computerStonePaint.setAntiAlias(true);
    computerStonePaint.setDither(true);
    computerStonePaint.setColor(Color.parseColor(computerStoneColor));
    computerStonePaint.setStrokeWidth(stoneRadius);

    pickedStonePaint = new Paint();
    pickedStonePaint.setAntiAlias(true);
    pickedStonePaint.setDither(true);
    pickedStonePaint.setColor(Color.parseColor("#8C8C8C"));
    pickedStonePaint.setStrokeWidth(stoneRadius);

    boardPaint = new Paint();
    boardPaint.setAntiAlias(true);
    boardPaint.setDither(true);
    boardPaint.setColor(ContextCompat.getColor(context, R.color.colorAccent));
    boardPaint.setStyle(Paint.Style.STROKE);
    boardPaint.setStrokeJoin(Paint.Join.ROUND);
    boardPaint.setStrokeWidth(4);

    tripletPath = new Path();

    displayMessagePaint = new Paint();
    displayMessagePaint.setAntiAlias(true);
    displayMessagePaint.setTextAlign(Paint.Align.CENTER);
    displayMessagePaint.setTextSize(2 * canvasMargin);
    displayMessagePaint.setColor(Color.parseColor(computerStoneColor));

    scoreMessagePaint = new Paint();
    scoreMessagePaint.setAntiAlias(true);
    scoreMessagePaint.setTextAlign(Paint.Align.CENTER);
    scoreMessagePaint.setTextSize((float) 1.5 * canvasMargin);
    scoreMessagePaint.setColor(Color.parseColor(userStoneColor));

    tripletPaint = new Paint();
    tripletPaint.setAntiAlias(true);
    tripletPaint.setStyle(Paint.Style.STROKE);
    tripletPaint.setColor(Color.parseColor(computerStoneColor));
    tripletPaint.setStrokeWidth(5);

    typedArray.recycle();

    settingsPreferences = PreferenceManager.getDefaultSharedPreferences(context);

    // 24 junctions starting from 1 to 24
    junctionsArray = new Junction[25];

    gameUtility = new GameUtility();
    this.context = context;
    vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
    mediaPlayer = MediaPlayer.create(context, R.raw.served);
}
 
Example 17
Project: PureMusic   File: CircularSeekBar.java   View Source Code Vote up 4 votes
/**
 * Initializes the {@code Paint} objects with the appropriate styles.
 */
protected void initPaints() {
	mCirclePaint = new Paint();
	mCirclePaint.setAntiAlias(true);
	mCirclePaint.setDither(true);
	mCirclePaint.setColor(mCircleColor);
	mCirclePaint.setStrokeWidth(mCircleStrokeWidth);
	mCirclePaint.setStyle(Paint.Style.STROKE);
	mCirclePaint.setStrokeJoin(Paint.Join.ROUND);
	mCirclePaint.setStrokeCap(Paint.Cap.ROUND);

	mCircleFillPaint = new Paint();
	mCircleFillPaint.setAntiAlias(true);
	mCircleFillPaint.setDither(true);
	mCircleFillPaint.setColor(mCircleFillColor);
	mCircleFillPaint.setStyle(Paint.Style.FILL);

	mCircleProgressPaint = new Paint();
	mCircleProgressPaint.setAntiAlias(true);
	mCircleProgressPaint.setDither(true);
	mCircleProgressPaint.setColor(mCircleProgressColor);
	mCircleProgressPaint.setStrokeWidth(mCircleStrokeWidth);
	mCircleProgressPaint.setStyle(Paint.Style.STROKE);
	mCircleProgressPaint.setStrokeJoin(Paint.Join.ROUND);
	mCircleProgressPaint.setStrokeCap(Paint.Cap.ROUND);

	mCircleProgressGlowPaint = new Paint();
	mCircleProgressGlowPaint.set(mCircleProgressPaint);
	mCircleProgressGlowPaint.setMaskFilter(new BlurMaskFilter((5f * DPTOPX_SCALE), BlurMaskFilter.Blur.NORMAL));

	mPointerPaint = new Paint();
	mPointerPaint.setAntiAlias(true);
	mPointerPaint.setDither(true);
	mPointerPaint.setStyle(Paint.Style.FILL);
	mPointerPaint.setColor(mPointerColor);
	mPointerPaint.setStrokeWidth(mPointerRadius);

	mPointerHaloPaint = new Paint();
	mPointerHaloPaint.set(mPointerPaint);
	mPointerHaloPaint.setColor(mPointerHaloColor);
	mPointerHaloPaint.setAlpha(mPointerAlpha);
	mPointerHaloPaint.setStrokeWidth(mPointerRadius + mPointerHaloWidth);

	mPointerHaloBorderPaint = new Paint();
	mPointerHaloBorderPaint.set(mPointerPaint);
	mPointerHaloBorderPaint.setStrokeWidth(mPointerHaloBorderWidth);
	mPointerHaloBorderPaint.setStyle(Paint.Style.STROKE);

}
 
Example 18
Project: Hello-Music-droid   File: CircularSeekBar.java   View Source Code Vote up 4 votes
/**
 * Initializes the {@code Paint} objects with the appropriate styles.
 */
private void initPaints() {
    mCirclePaint = new Paint();
    mCirclePaint.setAntiAlias(true);
    mCirclePaint.setDither(true);
    mCirclePaint.setColor(mCircleColor);
    mCirclePaint.setStrokeWidth(mCircleStrokeWidth);
    mCirclePaint.setStyle(Paint.Style.STROKE);
    mCirclePaint.setStrokeJoin(Paint.Join.ROUND);
    mCirclePaint.setStrokeCap(Paint.Cap.ROUND);

    mCircleFillPaint = new Paint();
    mCircleFillPaint.setAntiAlias(true);
    mCircleFillPaint.setDither(true);
    mCircleFillPaint.setColor(mCircleFillColor);
    mCircleFillPaint.setStyle(Paint.Style.FILL);

    mCircleProgressPaint = new Paint();
    mCircleProgressPaint.setAntiAlias(true);
    mCircleProgressPaint.setDither(true);
    mCircleProgressPaint.setColor(mCircleProgressColor);
    mCircleProgressPaint.setStrokeWidth(mCircleStrokeWidth);
    mCircleProgressPaint.setStyle(Paint.Style.STROKE);
    mCircleProgressPaint.setStrokeJoin(Paint.Join.ROUND);
    mCircleProgressPaint.setStrokeCap(Paint.Cap.ROUND);

    mCircleProgressGlowPaint = new Paint();
    mCircleProgressGlowPaint.set(mCircleProgressPaint);
    mCircleProgressGlowPaint.setMaskFilter(new BlurMaskFilter((5f * DPTOPX_SCALE), BlurMaskFilter.Blur.NORMAL));

    mPointerPaint = new Paint();
    mPointerPaint.setAntiAlias(true);
    mPointerPaint.setDither(true);
    mPointerPaint.setStyle(Paint.Style.FILL);
    mPointerPaint.setColor(mPointerColor);
    mPointerPaint.setStrokeWidth(mPointerRadius);

    mPointerHaloPaint = new Paint();
    mPointerHaloPaint.set(mPointerPaint);
    mPointerHaloPaint.setColor(mPointerHaloColor);
    mPointerHaloPaint.setAlpha(mPointerAlpha);
    mPointerHaloPaint.setStrokeWidth(mPointerRadius + mPointerHaloWidth);

    mPointerHaloBorderPaint = new Paint();
    mPointerHaloBorderPaint.set(mPointerPaint);
    mPointerHaloBorderPaint.setStrokeWidth(mPointerHaloBorderWidth);
    mPointerHaloBorderPaint.setStyle(Paint.Style.STROKE);

}
 
Example 19
Project: DoChart   File: StockArrowView.java   View Source Code Vote up 3 votes
private void initPaint() {

        mPaint = new Paint();
        mPaint.setStrokeWidth(lineWidth);
        mPaint.setColor(firstIndexColor);

        colorRectPaint = new Paint();
        colorRectPaint.setStrokeWidth(5);
        colorRectPaint.setColor(Color.BLACK);


        erasurePaint = new Paint();
        erasurePaint.setStrokeWidth(lineWidth);
        erasurePaint.setStrokeCap(Paint.Cap.SQUARE);
        erasurePaint.setColor(Color.WHITE);


        mPaint.setAntiAlias(true);
        mPaint.setStyle(Paint.Style.STROKE);
        mPaint.setStrokeCap(Paint.Cap.ROUND);
        mPaint.setStrokeJoin(Paint.Join.ROUND);


        arrowPaint = new Paint();
        arrowPaint.setStrokeWidth(1);
        arrowPaint.setColor(firstIndexColor);

    }
 
Example 20
Project: Yamblz.LightsOut   File: GameView.java   View Source Code Vote up 3 votes
public GameView(Context context, AttributeSet attributeSet) {
    super(context, attributeSet);

    gestureDetector = new GestureDetector(context, new MyGestureDetector());



    WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    Display display = wm.getDefaultDisplay();
    canvasSize = display.getWidth();


    cellSize = (int) (canvasSize / horizontalCountOfCells);

    bitmap = Bitmap.createBitmap((int) canvasSize, (int) canvasSize, Bitmap.Config.ARGB_8888);
    bitmapPaint = new Paint(Paint.DITHER_FLAG);

    paint = new Paint();
    paint.setAntiAlias(true);
    paint.setDither(true);
    paint.setColor(0xffff0505);
    paint.setStrokeWidth(5f);
    paint.setStyle(Paint.Style.STROKE);
    paint.setStrokeJoin(Paint.Join.ROUND);
    paint.setStrokeCap(Paint.Cap.ROUND);

}