Example usage for android.graphics ComposePathEffect ComposePathEffect

List of usage examples for android.graphics ComposePathEffect ComposePathEffect

Introduction

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

Prototype

public ComposePathEffect(PathEffect outerpe, PathEffect innerpe) 

Source Link

Document

Construct a PathEffect whose effect is to apply first the inner effect and the the outer pathEffect (e.g.

Usage

From source file:de.uni.stuttgart.informatik.ToureNPlaner.UI.Activities.MapScreen.MapScreen.java

private void setupWayOverlay() {
    Path p = new Path();
    p.moveTo(4.f, 0.f);//from  ww w .  j  av a 2 s .  c  o m
    p.lineTo(0.f, -4.f);
    p.lineTo(8.f, -4.f);
    p.lineTo(12.f, 0.f);
    p.lineTo(8.f, 4.f);
    p.lineTo(0.f, 4.f);

    Paint fastWayOverlayColor = new Paint(Paint.ANTI_ALIAS_FLAG);
    fastWayOverlayColor.setStyle(Paint.Style.STROKE);
    fastWayOverlayColor.setColor(Color.BLUE);
    fastWayOverlayColor.setAlpha(160);
    fastWayOverlayColor.setStrokeWidth(5.f);
    fastWayOverlayColor.setStrokeJoin(Paint.Join.ROUND);
    fastWayOverlayColor.setPathEffect(new ComposePathEffect(
            new PathDashPathEffect(p, 12.f, 0.f, PathDashPathEffect.Style.ROTATE), new CornerPathEffect(30.f)));

    // create the WayOverlay and add the ways
    this.fastWayOverlay = new FastWayOverlay(session, fastWayOverlayColor);
    mapView.getOverlays().add(this.fastWayOverlay);
    Result result = session.getResult();
    if (result != null) {
        addPathToMap(result.getWay());
    }
}