public RadarChartRenderer(RadarChart chart, ChartAnimator animator, ViewPortHandler viewPortHandler) { super(animator, viewPortHandler); mChart = chart; mHighlightPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mHighlightPaint.setStyle(Paint.Style.STROKE); mHighlightPaint.setStrokeWidth(2f); mHighlightPaint.setColor(Color.rgb(255, 187, 115)); mWebPaint = new Paint(Paint.ANTI_ALIAS_FLAG); mWebPaint.setStyle(Paint.Style.STROKE); mHighlightCirclePaint = new Paint(Paint.ANTI_ALIAS_FLAG); }
public BubbleChartRenderer(BubbleDataProvider chart, ChartAnimator animator, ViewPortHandler viewPortHandler) { super(animator, viewPortHandler); mChart = chart; mRenderPaint.setStyle(Style.FILL); mHighlightPaint.setStyle(Style.STROKE); mHighlightPaint.setStrokeWidth(Utils.convertDpToPixel(1.5f)); }
private void setupPaint() { mPaint.setAntiAlias(true); mPaint.setStyle(Paint.Style.FILL); mPaint.setStrokeWidth(1.0f); }
public MoreDetailsView(Context context, AttributeSet attrs) { super(context, attrs); Resources resources = getResources(); iconPaint = new Paint(Paint.ANTI_ALIAS_FLAG); float strokeSize = resources.getDimensionPixelSize(R.dimen.leak_canary_more_stroke_width); iconPaint.setStrokeWidth(strokeSize); // This lint check doesn't work for libraries which have a common prefix. @SuppressLint("CustomViewStyleable") // TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.leak_canary_MoreDetailsView); int plusColor = a.getColor(R.styleable.leak_canary_MoreDetailsView_leak_canary_plus_color, Color.BLACK); a.recycle(); iconPaint.setColor(plusColor); }
@Override protected void drawZeroLine(Canvas c) { int clipRestoreCount = c.save(); mZeroLineClippingRect.set(mViewPortHandler.getContentRect()); mZeroLineClippingRect.inset(-mYAxis.getZeroLineWidth(), 0.f); c.clipRect(mLimitLineClippingRect); // draw zero line MPPointD pos = mTrans.getPixelForValues(0f, 0f); mZeroLinePaint.setColor(mYAxis.getZeroLineColor()); mZeroLinePaint.setStrokeWidth(mYAxis.getZeroLineWidth()); Path zeroLinePath = mDrawZeroLinePathBuffer; zeroLinePath.reset(); zeroLinePath.moveTo((float) pos.x - 1, mViewPortHandler.contentTop()); zeroLinePath.lineTo((float) pos.x - 1, mViewPortHandler.contentBottom()); // draw a path because lines don't support dashing on lower android versions c.drawPath(zeroLinePath, mZeroLinePaint); c.restoreToCount(clipRestoreCount); }
private void drawDeselectedCircles(Canvas canvas) { mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(mStrokeWidth); mPaint.setColor(mCircleColor); for (int i = 0, j = mCirclePoints.size(); i < j; i++) { PointF pointF = mCirclePoints.get(i); canvas.drawCircle(pointF.x, pointF.y, mRadius, mPaint); } }
public DisplayerConfig() { PAINT = new TextPaint(); PAINT.setStrokeWidth(STROKE_WIDTH); PAINT_DUPLICATE = new TextPaint(PAINT); ALPHA_PAINT = new Paint(); UNDERLINE_PAINT = new Paint(); UNDERLINE_PAINT.setStrokeWidth(UNDERLINE_HEIGHT); UNDERLINE_PAINT.setStyle(Style.STROKE); BORDER_PAINT = new Paint(); BORDER_PAINT.setStyle(Style.STROKE); BORDER_PAINT.setStrokeWidth(BORDER_WIDTH); }
public BezierRadarHeader(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mSpinnerStyle = SpinnerStyle.Scale; final View thisView = this; final DensityUtil density = new DensityUtil(); mPath = new Path(); mPaint = new Paint(); mPaint.setAntiAlias(true); mDotRadius = density.dip2px(7); mRadarRadius = density.dip2px(20); mRadarCircle = density.dip2px(7); mPaint.setStrokeWidth(density.dip2px(3)); thisView.setMinimumHeight(density.dip2px(100)); if (thisView.isInEditMode()) { mWaveTop = 1000; mRadarScale = 1; mRadarAngle = 270; } else { mRadarScale = 0; } TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.BezierRadarHeader); mEnableHorizontalDrag = ta.getBoolean(R.styleable.BezierRadarHeader_srlEnableHorizontalDrag, mEnableHorizontalDrag); setAccentColor(ta.getColor(R.styleable.BezierRadarHeader_srlAccentColor, 0xFFffffff)); setPrimaryColor(ta.getColor(R.styleable.BezierRadarHeader_srlPrimaryColor, 0xFF222222)); mManualAccentColor = ta.hasValue(R.styleable.BezierRadarHeader_srlAccentColor); mManualPrimaryColor = ta.hasValue(R.styleable.BezierRadarHeader_srlPrimaryColor); ta.recycle(); }
public YAxisRenderer(ViewPortHandler viewPortHandler, YAxis yAxis, Transformer trans) { super(viewPortHandler, trans, yAxis); this.mYAxis = yAxis; if(mViewPortHandler != null) { mAxisLabelPaint.setColor(Color.BLACK); mAxisLabelPaint.setTextSize(Utils.convertDpToPixel(10f)); mZeroLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mZeroLinePaint.setColor(Color.GRAY); mZeroLinePaint.setStrokeWidth(1f); mZeroLinePaint.setStyle(Paint.Style.STROKE); } }
private void setupPaint() { mPaint.setAntiAlias(true); mPaint.setStrokeWidth(mStrokeWidth); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeCap(Paint.Cap.ROUND); }
private OvalPaintHistoryEvent(RectF oval, Paint paint) { this.oval = new RectF(oval); this.paint = new Paint(paint); this.paint.setColor(paint.getColor()); this.paint.setStrokeWidth(paint.getStrokeWidth()); } }
protected void setupGridPaint() { mGridPaint.setColor(mXAxis.getGridColor()); mGridPaint.setStrokeWidth(mXAxis.getGridLineWidth()); mGridPaint.setPathEffect(mXAxis.getGridDashPathEffect()); }
public void renderLimitLineLine(Canvas c, LimitLine limitLine, float[] position) { mLimitLineSegmentsBuffer[0] = position[0]; mLimitLineSegmentsBuffer[1] = mViewPortHandler.contentTop(); mLimitLineSegmentsBuffer[2] = position[0]; mLimitLineSegmentsBuffer[3] = mViewPortHandler.contentBottom(); mLimitLinePath.reset(); mLimitLinePath.moveTo(mLimitLineSegmentsBuffer[0], mLimitLineSegmentsBuffer[1]); mLimitLinePath.lineTo(mLimitLineSegmentsBuffer[2], mLimitLineSegmentsBuffer[3]); mLimitLinePaint.setStyle(Paint.Style.STROKE); mLimitLinePaint.setColor(limitLine.getLineColor()); mLimitLinePaint.setStrokeWidth(limitLine.getLineWidth()); mLimitLinePaint.setPathEffect(limitLine.getDashPathEffect()); c.drawPath(mLimitLinePath, mLimitLinePaint); }
private void init() { mMiddleLineColor = ContextCompat.getColor(getContext(), R.color.ucrop_color_progress_wheel_line); mProgressLineWidth = getContext().getResources().getDimensionPixelSize(R.dimen.ucrop_width_horizontal_wheel_progress_line); mProgressLineHeight = getContext().getResources().getDimensionPixelSize(R.dimen.ucrop_height_horizontal_wheel_progress_line); mProgressLineMargin = getContext().getResources().getDimensionPixelSize(R.dimen.ucrop_margin_horizontal_wheel_progress_line); mProgressLinePaint = new Paint(Paint.ANTI_ALIAS_FLAG); mProgressLinePaint.setStyle(Paint.Style.STROKE); mProgressLinePaint.setStrokeWidth(mProgressLineWidth); }
@Override public void renderShape(Canvas c, IScatterDataSet dataSet, ViewPortHandler viewPortHandler, float posX, float posY, Paint renderPaint) { final float shapeHalf = dataSet.getScatterShapeSize() / 2f; renderPaint.setStyle(Paint.Style.STROKE); renderPaint.setStrokeWidth(Utils.convertDpToPixel(1f)); c.drawLine( posX - shapeHalf, posY - shapeHalf, posX + shapeHalf, posY + shapeHalf, renderPaint); c.drawLine( posX + shapeHalf, posY - shapeHalf, posX - shapeHalf, posY + shapeHalf, renderPaint); }
private void setupProgressPaint() { progressPaint = new Paint(); progressPaint.setAntiAlias(true); progressPaint.setStyle(Paint.Style.STROKE); progressPaint.setColor(0xffffffff); progressPaint.setStrokeWidth(PROGRESS_STROKE_SIZE); }
private void setupPaint() { mPaint.setAntiAlias(true); mPaint.setStrokeWidth(mStrokeWidth); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeCap(Paint.Cap.ROUND); }
private LinePaintHistoryEvent( float startX, float startY, float stopX, float stopY, Paint paint) { this.paint = new Paint(paint); this.paint.setColor(paint.getColor()); this.paint.setStrokeWidth(paint.getStrokeWidth()); this.startX = startX; this.startY = startY; this.stopX = stopX; this.stopY = stopY; } }
/** * Draws the zero line. */ protected void drawZeroLine(Canvas c) { int clipRestoreCount = c.save(); mZeroLineClippingRect.set(mViewPortHandler.getContentRect()); mZeroLineClippingRect.inset(0.f, -mYAxis.getZeroLineWidth()); c.clipRect(mZeroLineClippingRect); // draw zero line MPPointD pos = mTrans.getPixelForValues(0f, 0f); mZeroLinePaint.setColor(mYAxis.getZeroLineColor()); mZeroLinePaint.setStrokeWidth(mYAxis.getZeroLineWidth()); Path zeroLinePath = mDrawZeroLinePath; zeroLinePath.reset(); zeroLinePath.moveTo(mViewPortHandler.contentLeft(), (float) pos.y); zeroLinePath.lineTo(mViewPortHandler.contentRight(), (float) pos.y); // draw a path because lines don't support dashing on lower android versions c.drawPath(zeroLinePath, mZeroLinePaint); c.restoreToCount(clipRestoreCount); }
@Override public void renderShape(Canvas c, IScatterDataSet dataSet, ViewPortHandler viewPortHandler, float posX, float posY, Paint renderPaint) { final float shapeHalf = dataSet.getScatterShapeSize() / 2f; renderPaint.setStyle(Paint.Style.STROKE); renderPaint.setStrokeWidth(Utils.convertDpToPixel(1f)); c.drawLine( posX, posY - (2 * shapeHalf), posX + (2 * shapeHalf), posY, renderPaint); c.drawLine( posX, posY - (2 * shapeHalf), posX - (2 * shapeHalf), posY, renderPaint); } }