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

The following are Jave code examples for showing how to use getStrokeWidth() 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: FlexibleRichTextView   File: ShadowBox.java   View Source Code Vote up 6 votes
public void draw(Canvas g2, float x, float y) {
	float th = thickness / 2;
	box.draw(g2, x + space + thickness, y);
	Paint st = AjLatexMath.getPaint();
	float w = st.getStrokeWidth();
	int c = st.getColor();
	Style s = st.getStyle();
	st.setStrokeWidth(thickness);
	st.setStyle(Style.STROKE);
	float penth = 0;// (float) Math.abs(1 / g2.getTransform().getScaleX());
	g2.drawRect(x + th, y - height + th, x + th + width - shadowRule
			- thickness, y + th + depth - shadowRule - thickness, st);
	st.setStyle(Style.FILL);
	g2.drawRect(x + shadowRule - penth, y + depth - shadowRule - penth, x
			- penth + width, y + depth - penth, st);
	g2.drawRect(x + width - shadowRule - penth, y - height + th
			+ shadowRule, x + width - penth, y + shadowRule + depth - 2
			* shadowRule, st);

	st.setColor(c);
	st.setStrokeWidth(w);
	st.setStyle(s);
	st.clearShadowLayer();

}
 
Example 2
Project: FlexibleRichTextView   File: HorizontalRule.java   View Source Code Vote up 6 votes
public void draw(Canvas g2, float x, float y) {
Paint st = AjLatexMath.getPaint();
Style s = st.getStyle();
float w = st.getStrokeWidth();
st.setStyle(Style.FILL);
st.setStrokeWidth(0);
int c = st.getColor();
if (color != null)
    st.setColor(color);
if (speShift == 0) {
	g2.drawRect(x, y - height, x + width, y, st);
} else {
    g2.drawRect(x, y - height + speShift, x + width, y + speShift, st);
}
	st.setColor(c);
	st.setStyle(s);
st.setStrokeWidth(w);
   }
 
Example 3
Project: FlexibleRichTextView   File: JavaFontRenderingBox.java   View Source Code Vote up 6 votes
public void draw(Canvas g2, float x, float y) {
		drawDebug(g2, x, y);
//		Paint st=AjLatexMath.getPaint();
//		st.setTextSize(AjLatexMath.getTextSize());
		Paint st =new Paint();
		float w = st.getStrokeWidth();
		Style s = st.getStyle();
		Typeface f = st.getTypeface();
		st.setStrokeWidth(0);//
		st.setStyle(Style.FILL_AND_STROKE);
		st.setTypeface(font);
		g2.save();
		g2.translate(x, y);
		g2.scale(0.5f * size, 0.5f * size);
//		g2.drawText(str, x, y, st);
		g2.drawText(str, 0, 0, st);
		g2.restore();
		st.setStyle(s);
		st.setStrokeWidth(w);
		st.setTypeface(f);
	}
 
Example 4
Project: FlexibleRichTextView   File: GeoGebraLogoBox.java   View Source Code Vote up 6 votes
public void draw(Canvas g2, float x, float y) {
	g2.save();
	Paint st = AjLatexMath.getPaint();
	int c = st.getColor();
	Style s = st.getStyle();
	float w = st.getStrokeWidth();

	g2.translate(x + 0.25f * height / 2.15f, y - 1.75f / 2.15f * height);
	st.setColor(gray);
	st.setStrokeWidth(3.79999995f);
	g2.scale(0.05f * height / 2.15f, 0.05f * height / 2.15f);
	g2.rotate((float) Math.toDegrees((-26 * Math.PI / 180)), 20.5f, 17.5f);
	g2.drawArc(new RectF(0f, 0f, 43f, 32f), 0f, 360f, false, st);
	g2.rotate((float) Math.toDegrees((26 * Math.PI / 180)), 20.5f, 17.5f);
	st.setStyle(Style.STROKE);
	drawCircle(st, g2, 16f, -5f);
	drawCircle(st, g2, -1f, 7f);
	drawCircle(st, g2, 5f, 28f);
	drawCircle(st, g2, 27f, 24f);
	drawCircle(st, g2, 36f, 3f);

	st.setColor(c);
	st.setStyle(s);
	st.setStrokeWidth(w);
	g2.restore();
}
 
Example 5
Project: FlexibleRichTextView   File: OvalBox.java   View Source Code Vote up 6 votes
public void draw(Canvas g2, float x, float y) {
	box.draw(g2, x + space + thickness, y);
	Paint st = AjLatexMath.getPaint();
	float w = st.getStrokeWidth();
	st.setStrokeWidth(thickness);
	Style s = st.getStyle();
	st.setStyle(Style.STROKE);
	float th = thickness / 2;
	float r = 0.5f * Math
			.min(width - thickness, height + depth - thickness);
	g2.drawRoundRect(new RectF(x + th, y - height + th, x + th + width
			- thickness, y - height + th + height + depth - thickness), r,
			r, st);
	st.setStrokeWidth(w);
	st.setStyle(s);
	// drawDebug(g2, x, y);
}
 
Example 6
Project: buildAPKsApps   File: DialChart.java   View Source Code Vote up 6 votes
/**
 * Returns the angle for a specific chart value.
 * 
 * @param canvas the canvas
 * @param angle the needle angle value
 * @param centerX the center x value
 * @param centerY the center y value
 * @param radius the radius
 * @param arrow if a needle or an arrow to be painted
 * @param paint the paint settings
 * @return the angle
 */
private void drawNeedle(Canvas canvas, double angle, int centerX, int centerY, double radius,
    boolean arrow, Paint paint) {
  double diff = Math.toRadians(90);
  int needleSinValue = (int) (NEEDLE_RADIUS * Math.sin(angle - diff));
  int needleCosValue = (int) (NEEDLE_RADIUS * Math.cos(angle - diff));
  int needleX = (int) (radius * Math.sin(angle));
  int needleY = (int) (radius * Math.cos(angle));
  int needleCenterX = centerX + needleX;
  int needleCenterY = centerY + needleY;
  float[] points;
  if (arrow) {
    int arrowBaseX = centerX + (int) (radius * 0.85 * Math.sin(angle));
    int arrowBaseY = centerY + (int) (radius * 0.85 * Math.cos(angle));
    points = new float[] { arrowBaseX - needleSinValue, arrowBaseY - needleCosValue,
        needleCenterX, needleCenterY, arrowBaseX + needleSinValue, arrowBaseY + needleCosValue };
    float width = paint.getStrokeWidth();
    paint.setStrokeWidth(5);
    canvas.drawLine(centerX, centerY, needleCenterX, needleCenterY, paint);
    paint.setStrokeWidth(width);
  } else {
    points = new float[] { centerX - needleSinValue, centerY - needleCosValue, needleCenterX,
        needleCenterY, centerX + needleSinValue, centerY + needleCosValue };
  }
  drawPath(canvas, points, paint, true);
}
 
Example 7
Project: GestureLockView   File: GestureLockPainter.java   View Source Code Vote up 6 votes
/**
 * 绘制按下状态的点
 *
 * @param point      单位点
 * @param canvas     画布
 * @param pressPaint 按下状态画笔
 */
@Override
public void drawPressPoint(Point point, Canvas canvas, Paint pressPaint) {
    // 1.记录画笔的原始属性(绘制过程中需要修改的属性),绘制结束时进行还原
    Paint.Style style = pressPaint.getStyle();
    float originStrokeWidth = pressPaint.getStrokeWidth();
    // 2.绘制实心点
    pressPaint.setStyle(Paint.Style.FILL);
    canvas.drawCircle(point.x, point.y, point.radius / 3, pressPaint);
    // 3.绘制空心圆边界
    pressPaint.setStyle(Paint.Style.STROKE);
    pressPaint.setStrokeWidth(point.radius / 16);
    canvas.drawCircle(point.x, point.y, point.radius, pressPaint);
    // 4.结束绘制,还原画笔属性
    pressPaint.setStyle(style);
    pressPaint.setStrokeWidth(originStrokeWidth);
}
 
Example 8
Project: GestureLockView   File: GestureLockPainter.java   View Source Code Vote up 6 votes
/**
 * 绘制出错状态的点
 *
 * @param point      单位点
 * @param canvas     画布
 * @param errorPaint 错误状态画笔
 */
@Override
public void drawErrorPoint(Point point, Canvas canvas, Paint errorPaint) {
    // 1.记录画笔的原始属性(绘制过程中需要修改的属性),绘制结束时进行还原
    Paint.Style style = errorPaint.getStyle();
    float originStrokeWidth = errorPaint.getStrokeWidth();
    // 2.绘制实心点
    errorPaint.setStyle(Paint.Style.FILL);
    canvas.drawCircle(point.x, point.y, point.radius / 3, errorPaint);
    // 3.绘制空心圆
    errorPaint.setStyle(Paint.Style.STROKE);
    errorPaint.setStrokeWidth(point.radius / 16);
    canvas.drawCircle(point.x, point.y, point.radius, errorPaint);
    // 4.结束绘制,还原画笔属性
    errorPaint.setStyle(style);
    errorPaint.setStrokeWidth(originStrokeWidth);
}
 
Example 9
Project: gmlrva   File: DecoratorDrawOverManager.java   View Source Code Vote up 6 votes
/**
 * Procedure meant to handle the drawing stage of a {@link SimpleDividerItemDecoration}'s divider, via
 * {@link Paint} object.
 * @param canvas the {@link Canvas} object where the divider will be drawn.
 * @param parent the parent {@link RecyclerView} for the applied {@link SimpleDividerItemDecoration}.
 * @param state the parent {@link RecyclerView.State} for the applied {@link SimpleDividerItemDecoration}.
 * @param drawnDivider the configured divider's {@link Paint} object.
 * @param position the divider's target position. This value is ranged.
 *                 See {@link GenericDecorationDividerPosition} for more information.
 */
public void applyDrawnDivider(@NonNull final Canvas canvas, @NonNull final RecyclerView parent,
                              @NonNull final RecyclerView.State state, @NonNull final Paint drawnDivider,
                              @IntRange(from = 0, to = 5) final int position) {
    /* The stroke width was set in the spec, but to correctly draw the line we have to offset by width / 2 */
    final int offset = (int) (drawnDivider.getStrokeWidth() / 2);

    /* This will iterate over every visible view */
    final int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
        final View view = parent.getChildAt(i); // get the view
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) view.getLayoutParams();
        final int pos = params.getViewAdapterPosition(); // get the position

        /* Draw the separator */
        if (pos < state.getItemCount()) {
            if (drawnDivider.getStyle().equals(Paint.Style.STROKE)) {
                mDrawnDividerHelper.drawDottedDivider(canvas, view, offset, drawnDivider, position);
            } else {
                mDrawnDividerHelper.drawLineDivider(canvas, view, offset, drawnDivider, position);
            }

        }
    }
}
 
Example 10
Project: FlexibleRichTextView   File: FramedBox.java   View Source Code Vote up 5 votes
public void draw(Canvas g2, float x, float y) {
	Paint st = AjLatexMath.getPaint();
	float w = st.getStrokeWidth();
	Style s = st.getStyle();
	int c = st.getColor();
	st.setStrokeWidth(thickness);
	st.setStyle(Style.FILL_AND_STROKE);
	float th = thickness / 2;
	if (bg != null) {
		st.setColor(bg);
		g2.drawRect(x + th, y - height + th, x + th + width - thickness, y
				+ th + depth - thickness, st);
	}
	st.setStyle(Style.STROKE);
	if (line != null) {
		st.setColor(line);
		g2.drawRect(x + th, y - height + th, x + th + width - thickness, y
				+ th + depth - thickness, st);
	} else {
		g2.drawRect(x + th, y - height + th, x + th + width - thickness, y
				+ th + depth - thickness, st);
	}
	// drawDebug(g2, x, y);
	st.setStrokeWidth(w);
	st.setStyle(s);
	box.draw(g2, x + space + thickness, y);
	// st.setStyle(s);
	st.setColor(c);
}
 
Example 11
Project: AOdia   File: DiagramView.java   View Source Code Vote up 5 votes
/**
 * 点線を描画する
 * canvas.drawLineと同様の使い方ができると考えてよい

 * @param canvas
 * @param x1
 * @param y1
 * @param x2
 * @param y2
 * @param paint
 */
private void drawDotLine(Canvas canvas,float x1,float y1,float x2,float y2,Paint paint){
    float x=(x2-x1)/(float)Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    float y=(y2-y1)/(float)Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
    float loop = paint.getStrokeWidth() * 2;
    if(x>y) {
        for (int i = 0; i < (x2 - x1) / (loop) / x; i++) {
            canvas.drawPoint(x1 + (loop) * x * i, y1 + (loop) * y * i, paint);
        }
    }
    for (int i = 0; i < (y2 - y1) / (loop) / y; i++) {
        canvas.drawPoint(x1 + (loop) * x * i, y1 + (loop) * y * i, paint);
    }
}
 
Example 12
Project: iosched-reader   File: SVGParser.java   View Source Code Vote up 5 votes
private void doLimits(RectF box, Paint paint) {
	Matrix m = matrixStack.getLast();
	m.mapRect(tmpLimitRect, box);
	float width2 = (paint == null) ? 0 : paint.getStrokeWidth() / 2;
	doLimits2(tmpLimitRect.left - width2, tmpLimitRect.top - width2);
	doLimits2(tmpLimitRect.right + width2, tmpLimitRect.bottom + width2);
}
 
Example 13
Project: Markwon   File: SpannableTheme.java   View Source Code Vote up 5 votes
public int tableBorderWidth(@NonNull Paint paint) {
    final int out;
    if (tableBorderWidth == -1) {
        out = (int) (paint.getStrokeWidth() + .5F);
    } else {
        out = tableBorderWidth;
    }
    return out;
}
 
Example 14
Project: GestureLockView   File: GestureLockPainter.java   View Source Code Vote up 5 votes
/**
 * 绘制正常状态的点
 *
 * @param point       单位点
 * @param canvas      画布
 * @param normalPaint 正常状态画笔
 */
@Override
public void drawNormalPoint(Point point, Canvas canvas, Paint normalPaint) {
    // 1.记录画笔的原始属性(绘制过程中需要修改的属性),绘制结束时进行还原
    Paint.Style style = normalPaint.getStyle();
    float originStrokeWidth = normalPaint.getStrokeWidth();
    // 2.绘制空心圆边界
    normalPaint.setStyle(Paint.Style.STROKE);
    normalPaint.setStrokeWidth(point.radius / 32);
    canvas.drawCircle(point.x, point.y, point.radius, normalPaint);
    // 3.结束绘制,还原画笔属性
    normalPaint.setStyle(style);
    normalPaint.setStrokeWidth(originStrokeWidth);
}
 
Example 15
Project: FlexibleRichTextView   File: FcscoreBox.java   View Source Code Vote up 4 votes
public void draw(Canvas g2, float x, float y) {
	Paint st = AjLatexMath.getPaint();
	/*
	 * AffineTransform transf = g2.getTransform(); Stroke oldStroke =
	 * g2.getStroke();
	 * 
	 * final double sx = transf.getScaleX(); final double sy =
	 * transf.getScaleY();
	 */
	float s = 1;
	/*
	 * if (sx == sy) { // There are rounding problems due to scale factor:
	 * lines could have different // spacing... // So the increment
	 * (space+thickness) is done in using integer. s = sx; AffineTransform t
	 * = (AffineTransform) transf.clone(); t.scale(1 / sx, 1 / sy);
	 * g2.setTransform(t); }
	 */
	float w = st.getStrokeWidth();
	Style ss = st.getStyle();
	st.setStrokeWidth((float) (s * thickness));
	st.setStyle(Style.STROKE);
	float th = thickness / 2.f;
	float xx = x + space;
	xx = (float) (xx * s + (space / 2.f) * s);
	final int inc = (int) Math.round((space + thickness) * s);

	for (int i = 0; i < N; i++) {
		g2.drawLine(xx + th * s, (y - height) * s, xx + th * s, y * s, st);
		xx += inc;
	}

	if (strike) {
		g2.drawLine((x + space) * s, (y - height / 2.f) * s, xx - s * space
				/ 2, (y - height / 2.f) * s, st);
	}

	// g2.setTransform(transf);
	// g2.setStroke(oldStroke);
	st.setStrokeWidth(w);
	st.setStyle(ss);
}
 
Example 16
Project: buildAPKsApps   File: ScatterChart.java   View Source Code Vote up 4 votes
/**
 * The graphical representation of a series.
 * 
 * @param canvas the canvas to paint to
 * @param paint the paint to be used for drawing
 * @param points the array of points to be used for drawing the series
 * @param seriesRenderer the series renderer
 * @param yAxisValue the minimum value of the y axis
 * @param seriesIndex the index of the series currently being drawn
 * @param startIndex the start index of the rendering points
 */
@Override
public void drawSeries(Canvas canvas, Paint paint, List<Float> points,
    XYSeriesRenderer renderer, float yAxisValue, int seriesIndex, int startIndex) {
  paint.setColor(renderer.getColor());
  final float stroke = paint.getStrokeWidth();
  if (renderer.isFillPoints()) {
    paint.setStyle(Style.FILL);
  } else {
    paint.setStrokeWidth(renderer.getPointStrokeWidth());
    paint.setStyle(Style.STROKE);
  }
  int length = points.size();
  switch (renderer.getPointStyle()) {
  case X:
    paint.setStrokeWidth(renderer.getPointStrokeWidth());
    for (int i = 0; i < length; i += 2) {
      drawX(canvas, paint, points.get(i), points.get(i + 1));
    }
    break;
  case CIRCLE:
    for (int i = 0; i < length; i += 2) {
      drawCircle(canvas, paint, points.get(i), points.get(i + 1));
    }
    break;
  case TRIANGLE:
    float[] path = new float[6];
    for (int i = 0; i < length; i += 2) {
      drawTriangle(canvas, paint, path, points.get(i), points.get(i + 1));
    }
    break;
  case SQUARE:
    for (int i = 0; i < length; i += 2) {
      drawSquare(canvas, paint, points.get(i), points.get(i + 1));
    }
    break;
  case DIAMOND:
    path = new float[8];
    for (int i = 0; i < length; i += 2) {
      drawDiamond(canvas, paint, path, points.get(i), points.get(i + 1));
    }
    break;
  case POINT:
    for (int i = 0; i < length; i += 2) {
      canvas.drawPoint(points.get(i), points.get(i + 1), paint);
    }
    break;
  }
  paint.setStrokeWidth(stroke);
}
 
Example 17
Project: SDHtmlTextView   File: BorderSpan.java   View Source Code Vote up 4 votes
@Override
public void drawBackground(Canvas c, Paint p,
                           int left, int right,
                           int top, int baseline, int bottom,
                           CharSequence text, int start, int end,
                           int lnum) {

    int baseMargin = 0;

    if ( style.getMarginLeft() != null ) {
        StyleValue styleValue = style.getMarginLeft();

        if ( styleValue.getUnit() == StyleValue.Unit.PX ) {
            if ( styleValue.getIntValue() > 0 ) {
                baseMargin = styleValue.getIntValue();
            }
        } else if ( styleValue.getFloatValue() > 0f ) {
            baseMargin = (int) (styleValue.getFloatValue() * HtmlSpanner.HORIZONTAL_EM_WIDTH);
        }

        //Leave a little bit of room
        baseMargin--;
    }

    if ( baseMargin > 0 ) {
        left = left + baseMargin;
    }

    int originalColor = p.getColor();
    float originalStrokeWidth = p.getStrokeWidth();

    if ( usecolour && style.getBackgroundColor() != null ) {
        p.setColor(style.getBackgroundColor());
        p.setStyle(Paint.Style.FILL);

        c.drawRect(left,top,right,bottom,p);
    }

    if ( usecolour && style.getBorderColor() != null ) {
        p.setColor( style.getBorderColor() );
    }

    int strokeWidth;

    if ( style.getBorderWidth() != null && style.getBorderWidth().getUnit() == StyleValue.Unit.PX ) {
        strokeWidth = style.getBorderWidth().getIntValue();
    } else {
        strokeWidth = 1;
    }

    p.setStrokeWidth( strokeWidth );
    right -= strokeWidth;

    p.setStyle(Paint.Style.STROKE);

    if ( start <= this.start ) {
        Log.d("BorderSpan", "Drawing first line");
        c.drawLine(left, top, right, top, p);
    }

    if ( end >= this.end ) {
        Log.d("BorderSpan", "Drawing last line");
        c.drawLine(left, bottom, right, bottom, p);
    }

    c.drawLine(left,top,left,bottom, p);
    c.drawLine(right,top,right,bottom, p);


    p.setColor(originalColor);
    p.setStrokeWidth(originalStrokeWidth);
}
 
Example 18
Project: SDHtmlTextView   File: HorizontalLineSpan.java   View Source Code Vote up 4 votes
@Override
public void drawBackground(Canvas c, Paint p,
                           int left, int right,
                           int top, int baseline, int bottom,
                           CharSequence text, int start, int end,
                           int lnum) {

    int baseMargin = 0;

    if ( style.getMarginLeft() != null ) {
        StyleValue styleValue = style.getMarginLeft();

        if ( styleValue.getUnit() == StyleValue.Unit.PX ) {
            if ( styleValue.getIntValue() > 0 ) {
                baseMargin = styleValue.getIntValue();
            }
        } else if ( styleValue.getFloatValue() > 0f ) {
            baseMargin = (int) (styleValue.getFloatValue() * HtmlSpanner.HORIZONTAL_EM_WIDTH);
        }

        //Leave a little bit of room
        baseMargin--;
    }

    if ( baseMargin > 0 ) {
        left = left + baseMargin;
    }

    int originalColor = p.getColor();
    float originalStrokeWidth = p.getStrokeWidth();

    p.setColor(Color.parseColor("#000000"));
    if (style.getBorderColor() != null ) {
        p.setColor( style.getBorderColor() );
    }

    int strokeWidth;

    if ( style.getBorderWidth() != null && style.getBorderWidth().getUnit() == StyleValue.Unit.PX ) {
        strokeWidth = style.getBorderWidth().getIntValue();
    } else {
        strokeWidth = 1;
    }

    p.setStrokeWidth( strokeWidth );
    right -= strokeWidth;

    p.setStyle(Paint.Style.STROKE);

    Log.d("HorizontalSpan", "Drawing line");

    int center=(bottom+top)/2;
    c.drawLine(left, center, right, center, p);

    p.setColor(originalColor);
    p.setStrokeWidth(originalStrokeWidth);
}
 
Example 19
Project: SmartMath   File: FlatChart.java   View Source Code Vote up 4 votes
public void drawLine(Canvas canvas, Position3D p3PrevPoint, Position3D p3NextPoint, Paint paint, LineStyle lineStyle)	{
	if (lineStyle.menumLinePattern == LINEPATTERN.LINEPATTERN_NON)	{
		return;
	}
	int nOriginalColor = paint.getColor();
	Style styleOriginal = paint.getStyle();
	float fOriginalStrokeWidth = paint.getStrokeWidth();
	PathEffect pathEffectOriginal = paint.getPathEffect();

	if (lineStyle.mclr != null)	{
		paint.setColor(lineStyle.mclr.getARGB());
	}
	paint.setStyle(Style.STROKE);
	paint.setStrokeWidth((float)lineStyle.mdLineWidth);
	switch (lineStyle.menumLinePattern)	{
	case LINEPATTERN_DASH:
	{
		paint.setPathEffect(new DashPathEffect(new float[]{(float)mdVerySmallSize, (float)mdTinySize}, 0));
		break;
	}
	case LINEPATTERN_DOT:
	{
		paint.setPathEffect(new DashPathEffect(new float[]{(float)mdVeryTinySize, (float)mdTinySize}, 0));
		break;
	}
	case LINEPATTERN_DASH_DOT:
	{
		paint.setPathEffect(new DashPathEffect(new float[]{(float)mdVerySmallSize, (float)mdTinySize, (float)mdVeryTinySize, (float)mdTinySize}, 0));
		break;
	}
	/* case LINEPATTERN_NON:	// need not to consider LINEPATTERN_NON
	{
		paint.setPathEffect(new DashPathEffect(new float[]{0, (float)mdMediumSize}, 0));
		break;
	} */
	default:	// solid
		paint.setPathEffect(new PathEffect());
	}
	
	float fX0 = (float)p3PrevPoint.getX(), fY0 = (float)p3PrevPoint.getY(),
			fX1 = (float)p3NextPoint.getX(), fY1 = (float)p3NextPoint.getY();
	canvas.drawLine(fX0, fY0, fX1, fY1, paint);
	
	paint.setColor(nOriginalColor);
	paint.setStyle(styleOriginal);
	paint.setStrokeWidth(fOriginalStrokeWidth);
	paint.setPathEffect(pathEffectOriginal);
}
 
Example 20
Project: Android-LabelView   File: LabelView.java   View Source Code Vote up 2 votes
/**
 * Measure the minimum height required to display the view. <br />
 * Based on FontMetrics of text value and label value in addition to the line stroke width.
 *
 * <p><strong>NOTE: View padding is not taken into account.</strong></p>
 * @param textMetrics FontMetrics based on the text value.
 * @param labelMetrics FontMetrics based on the label value.
 * @param linePaint Paint used to draw the dividing line
 * @return measured minimum height.
 */
private int measureMinimumHeight(Paint.FontMetrics textMetrics, Paint.FontMetrics labelMetrics, Paint linePaint) {
    return (int) ((textMetrics.bottom - textMetrics.top) + (labelMetrics.bottom - labelMetrics.top) + linePaint.getStrokeWidth());
}