Example usage for android.graphics Outline Outline

List of usage examples for android.graphics Outline Outline

Introduction

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

Prototype

public Outline() 

Source Link

Document

Constructs an empty Outline.

Usage

From source file:org.protocoderrunner.apprunner.api.PUI.java

@ProtocoderScript
@APIParam(params = { "View", "x", "y", "w", "h" })
public void clipCircle(View v, final int x, final int y, final int w, final int h) {
    Outline outline = new Outline();
    outline.setOval(x, y, w, h);//  w w  w  .j  a va  2s  . c o  m
    v.setClipToOutline(true);

    ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() {
        @Override
        public void getOutline(View view, Outline outline) {
            // Or read size directly from the view's width/height
            outline.setOval(x, y, w, h);
        }
    };

    v.setOutlineProvider(viewOutlineProvider);
}