Example usage for android.graphics Paint clearShadowLayer

List of usage examples for android.graphics Paint clearShadowLayer

Introduction

In this page you can find the example usage for android.graphics Paint clearShadowLayer.

Prototype

public void clearShadowLayer() 

Source Link

Document

Clear the shadow layer.

Usage

From source file:org.navitproject.navit.NavitGraphics.java

protected void draw_text(Paint paint, int x, int y, String text, int size, int dx, int dy, int bgcolor) {
    int oldcolor = paint.getColor();
    Path path = null;//from w  w  w  .  j  a v a2s .  co  m

    paint.setTextSize(size / 15);
    paint.setStyle(Paint.Style.FILL);

    if (dx != 0x10000 || dy != 0) {
        path = new Path();
        path.moveTo(x, y);
        path.rLineTo(dx, dy);
        paint.setTextAlign(android.graphics.Paint.Align.LEFT);
    }

    if (bgcolor != 0) {
        paint.setStrokeWidth(3);
        paint.setColor(bgcolor);
        paint.setStyle(Paint.Style.STROKE);
        if (path == null) {
            draw_canvas.drawText(text, x, y, paint);
        } else {
            draw_canvas.drawTextOnPath(text, path, 0, 0, paint);
        }
        paint.setStyle(Paint.Style.FILL);
        paint.setColor(oldcolor);
    }

    if (path == null) {
        draw_canvas.drawText(text, x, y, paint);
    } else {
        draw_canvas.drawTextOnPath(text, path, 0, 0, paint);
    }
    paint.clearShadowLayer();
}